Skip to content

Commit

Permalink
print weights
Browse files Browse the repository at this point in the history
  • Loading branch information
bassmang committed Nov 10, 2023
1 parent 7479250 commit 0e80608
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/vendor_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
working-directory: build
run: ctest --output-on-failure --no-tests=error --label-regex VWTestList --parallel 2
- name: Test
run: python3 test/run_tests.py -f --clean_dirty -E 0.001
run: python3 test/run_tests.py -f --clean_dirty -E 0.001 -t 148
env:
NUM_JOBS: 1
build_vendor_windows:
Expand Down
8 changes: 7 additions & 1 deletion vowpalwabbit/core/include/vw/core/gd_predict.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include "vw/core/example_predict.h"
#include "vw/core/interactions_predict.h"
#include "vw/core/v_array.h"
#include <iostream>

#undef VW_DEBUG_LOG
#define VW_DEBUG_LOG vw_dbg::GD_PREDICT
Expand Down Expand Up @@ -46,7 +47,12 @@ template <class DataT, void (*FuncT)(DataT&, float, float), class WeightsT>
inline void foreach_feature(
const WeightsT& weights, const VW::features& fs, DataT& dat, uint64_t offset = 0, float mult = 1.)
{
for (const auto& f : fs) { FuncT(dat, mult * f.value(), weights[static_cast<size_t>(f.index() + offset)]); }
for (const auto& f : fs)
{
std::cout << f.index() << "\n";
std::cout << weights[static_cast<size_t>(f.index() + offset)] << "\n";
FuncT(dat, mult * f.value(), weights[static_cast<size_t>(f.index() + offset)]);
}
}

template <class DataT, class WeightOrIndexT, void (*FuncT)(DataT&, float, WeightOrIndexT),
Expand Down

0 comments on commit 0e80608

Please sign in to comment.