Permalink
Browse files

Merge pull request #50 from hal3/master

Recent csoaa changes broke some things with my fork, this repairs them.
  • Loading branch information...
2 parents 47a2d72 + 398f562 commit 8ccc208fd950453275699d9b33efc89c5f3b53ce @JohnLangford JohnLangford committed Aug 24, 2012

Large diffs are not rendered by default.

Oops, something went wrong.
View

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -11,7 +11,7 @@ Allocated 72M for weights and mem
creating cache_file = train-sets/zero.dat.cache
Reading from train-sets/zero.dat
num sources = 1
- 1 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.136
+ 1 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.121
finished run
number of examples = 25
View
@@ -364,12 +364,13 @@ namespace CSOAA {
}
*(all.p->lp) = cs_label_parser;
- all.sd->k = nb_actions;
+ if (!all.is_noop)
+ all.driver = drive_csoaa;
+ all.sd->k = nb_actions;
all.base_learner_nb_w *= nb_actions;
increment = (all.length()/ all.base_learner_nb_w ) * all.stride;
- all.driver = drive_csoaa;
base_learner = all.learn;
all.base_learn = all.learn;
all.learn = learn;
@@ -990,7 +991,8 @@ namespace CSOAA_AND_WAP_LDF {
all.add_constant = false;
}
- all.driver = drive_ldf;
+ if (!all.is_noop)
+ all.driver = drive_ldf;
base_learner = all.learn;
all.base_learn = all.learn;
all.learn = learn;
@@ -203,6 +203,7 @@ struct vw {
size_t unique_id; //unique id for each node in the network, id == 0 means extra io.
size_t total; //total number of nodes
size_t node; //node id number
+ bool is_noop; // are we a noop learner?
void (*print)(int,float,float,v_array<char>);
void (*print_text)(int, string, v_array<char>);
View
@@ -16,3 +16,5 @@ void drive_noop(void* in)
}
}
+void learn_noop(void*in, example*ec) {}
+
View
@@ -1 +1,2 @@
void drive_noop(void*);
+void learn_noop(void*, example*);
@@ -416,8 +416,12 @@ vw parse_args(int argc, char *argv[])
if(vm.count("quantile_tau"))
loss_parameter = vm["quantile_tau"].as<float>();
- if (vm.count("noop"))
+ all.is_noop = false;
+ if (vm.count("noop")) {
all.driver = drive_noop;
+ all.learn = learn_noop;
+ all.is_noop = true;
+ }
if (all.rank != 0) {
all.driver = drive_gd_mf;

0 comments on commit 8ccc208

Please sign in to comment.