Skip to content

Commit

Permalink
Make -q :: faster by calculating interactions on the fly instead of p…
Browse files Browse the repository at this point in the history
…re calculating them (#2807)
  • Loading branch information
olgavrou authored Feb 25, 2021
1 parent f375668 commit f47ac31
Show file tree
Hide file tree
Showing 37 changed files with 31,265 additions and 107 deletions.
2 changes: 1 addition & 1 deletion library/gd_mf_weights.cc
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ int main(int argc, char *argv[])

// global model params
std::vector<unsigned char> first_pair;
for (auto const& i : model->interactions)
for (auto const& i : model->interactions.interactions)
{
if(i.size() == 2)
{
Expand Down
17 changes: 16 additions & 1 deletion test/RunTests
Original file line number Diff line number Diff line change
Expand Up @@ -2131,9 +2131,24 @@ python3 ./cluster_test.py --vw ../build/vowpalwabbit/vw --spanning_tree ../build
pred-sets/ref/slates_simple_w_interactions.predict
pred-sets/ref/slates_w_interactions.inv
# Test 274: Test search_neighbor_features argument
# Test 274: test -q :: with many interactions
{VW} -d train-sets/ccb_lots_of_interactions.dat --ccb_explore_adf -q :: --invert_hash ccb_lots_of_interactions.inv
train-sets/ref/ccb_lots_of_interactions.stderr
pred-sets/ref/ccb_lots_of_interactions.inv
# Test 275: Test search_neighbor_features argument
{VW} -k -c -d train-sets/sequence_data --passes 2 --search_rollout ref --search_alpha 1e-8 --search_task sequence --search 5 --holdout_off --search_neighbor_features -3:w,-2:w,-1:w,1:w,2:w,3:w,-3:e,-2:e,-1:e,1:e,2:e,3:e,-3:s,-2:s,-1:s,1:s,2:s,3:s
train-sets/ref/slates_simple_w_interactions.stderr
train-sets/ref/search_neighbor_features.train.stderr
# Test 276: test -q :: with explicit interactions
{VW} -d train-sets/ccb_lots_of_interactions_mini.dat --ccb_explore_adf -q :: -q AB --interactions AAA --interactions ::: --invert_hash ccb_implicit_and_explicit_interactions.inv
train-sets/ref/ccb_implicit_and_explicit_interactions.stderr
pred-sets/ref/ccb_implicit_and_explicit_interactions.inv
# Test 277: test -q :: with explicit interactions and ignore
{VW} -d train-sets/ccb_lots_of_interactions_mini.dat --ignore C --ccb_explore_adf -q :: -q AB --interactions AAA --interactions ::: --invert_hash ccb_implicit_explicit_ignore_interactions.inv
train-sets/ref/ccb_implicit_explicit_ignore_interactions.stderr
pred-sets/ref/ccb_implicit_explicit_ignore_interactions.inv
# Do not delete this line or the empty line above it
Loading

0 comments on commit f47ac31

Please sign in to comment.