Skip to content

Commit

Permalink
Merge 37f3077 into 3ca448c
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnLangford committed Jun 5, 2019
2 parents 3ca448c + 37f3077 commit fbbaa41
Show file tree
Hide file tree
Showing 9 changed files with 168 additions and 185 deletions.
4 changes: 2 additions & 2 deletions test/RunTests
Original file line number Diff line number Diff line change
Expand Up @@ -1732,11 +1732,11 @@ printf '3 |f a b c |e x y z\n2 |f a y c |e x\n' | {VW} --oaa 3 -q ef --audit
train-sets/ref/malformed.stderr
# Test 196: online contextual memory tree
{VW} -d train-sets/rcv1_smaller.dat --memory_tree 10 --learn_at_leaf 1 --max_number_of_labels 2 --dream_at_update 0 --dream_repeats 3 --oas 0 --online 1 --leaf_example_multiplier 10 --alpha 0.1 -l 0.001 -b 15 --passes 1 --loss_function squared --holdout_off
{VW} -d train-sets/rcv1_smaller.dat --memory_tree 10 --learn_at_leaf --max_number_of_labels 2 --dream_at_update 0 --dream_repeats 3 --online --leaf_example_multiplier 10 --alpha 0.1 -l 0.001 -b 15 --passes 1 --loss_function squared --holdout_off
train-sets/ref/cmt_rcv1_smaller_online.stderr
# Test 197: offline contextual memory tree
{VW} -d train-sets/rcv1_smaller.dat --memory_tree 10 --learn_at_leaf 1 --max_number_of_labels 2 --dream_at_update 0 --dream_repeats 3 --oas 0 --online 0 --leaf_example_multiplier 10 --alpha 0.1 -l 0.001 -b 15 -c --passes 2 --loss_function squared --holdout_off
{VW} -d train-sets/rcv1_smaller.dat --memory_tree 10 --learn_at_leaf --max_number_of_labels 2 --dream_at_update 0 --dream_repeats 3 --leaf_example_multiplier 10 --alpha 0.1 -l 0.001 -b 15 -c --passes 2 --loss_function squared --holdout_off
train-sets/ref/cmt_rcv1_smaller_offline.stderr
# Do not delete this line or the empty line above it
6 changes: 3 additions & 3 deletions test/train-sets/ref/dictionary_test.stderr
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
ignoring namespaces beginning with: w
scanned dictionary 'dictionary_test.dict' from 'train-sets/dictionary_test.dict', hash=3226e82e3d58b6b2
dictionary dictionary_test.dict contains 4 items
scanned dictionary 'dictionary_test.dict.gz' from 'train-sets/dictionary_test.dict.gz', hash=3226e82e3d58b6b2
Num weight bits = 18
learning rate = 0.5
initial_t = 0
Expand All @@ -10,6 +7,9 @@ decay_learning_rate = 1
creating cache_file = train-sets/dictionary_test.dat.cache
Reading datafile = train-sets/dictionary_test.dat
num sources = 1
scanned dictionary 'dictionary_test.dict' from 'train-sets/dictionary_test.dict', hash=3226e82e3d58b6b2
dictionary dictionary_test.dict contains 4 items
scanned dictionary 'dictionary_test.dict.gz' from 'train-sets/dictionary_test.dict.gz', hash=3226e82e3d58b6b2
average since example example current current current
loss last counter weight label predict features
1.000000 1.000000 1 1.0 1.0000 -1.0000 3
Expand Down
2 changes: 1 addition & 1 deletion vowpalwabbit/accumulate.cc
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,6 @@ void accumulate_weighted_avg(vw& all, parameters& weights)
if (weights.sparse)
cout << "sparse parameters not supported with parallel computation!" << endl;
else
all_reduce<float, add_float>(all, weights.dense_weights.first(), ((size_t)length) * (1 << weights.stride_shift()));
all_reduce<float, add_float>(all, weights.dense_weights.first(), ((size_t)length) * (1ull << weights.stride_shift()));
delete[] local_weights;
}
6 changes: 3 additions & 3 deletions vowpalwabbit/cb_adf.cc
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ struct cb_adf
action_scores a_s; // temporary storage for mtr and sm
action_scores prob_s; // temporary storage for sm; stores softmax values
v_array<uint32_t> backup_nf; // temporary storage for sm; backup for numFeatures in examples
v_array<uint32_t> backup_weights; // temporary storage for sm; backup for weights in examples
v_array<float> backup_weights; // temporary storage for sm; backup for weights in examples

uint64_t offset;
bool no_predict;
Expand Down Expand Up @@ -149,10 +149,10 @@ void learn_SM(cb_adf& mydata, multi_learner& base, multi_ex& examples) {
{
uint32_t current_action = mydata.prob_s[i].action;
mydata.backup_weights.push_back(examples[current_action]->weight);
mydata.backup_nf.push_back(examples[current_action]->num_features);
mydata.backup_nf.push_back((uint32_t)examples[current_action]->num_features);

if (current_action == chosen_action)
examples[current_action]->weight = example_weight * (1.0 - mydata.prob_s[i].score);
examples[current_action]->weight = example_weight * (1.0f - mydata.prob_s[i].score);
else
examples[current_action]->weight = example_weight * mydata.prob_s[i].score;

Expand Down
2 changes: 1 addition & 1 deletion vowpalwabbit/io_buf.h
Original file line number Diff line number Diff line change
Expand Up @@ -379,4 +379,4 @@ inline size_t bin_text_read_write_fixed_validated(
msg, \
text); \
} \
while (0);
while (0);

0 comments on commit fbbaa41

Please sign in to comment.