Skip to content

Commit

Permalink
Merge 9cb0a78 into 3ca448c
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnLangford committed Jun 5, 2019
2 parents 3ca448c + 9cb0a78 commit 02a9851
Show file tree
Hide file tree
Showing 7 changed files with 123 additions and 140 deletions.
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
4 changes: 2 additions & 2 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 @@ -152,7 +152,7 @@ void learn_SM(cb_adf& mydata, multi_learner& base, multi_ex& examples) {
mydata.backup_nf.push_back(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);
Loading

0 comments on commit 02a9851

Please sign in to comment.