diff options
author | John Langford <jl@hunch.net> | 2011-04-28 03:49:07 +0400 |
---|---|---|
committer | John Langford <jl@hunch.net> | 2011-04-28 03:49:07 +0400 |
commit | af1f3d0af310caf9aadaee0a8b10f8f35bef9c80 (patch) | |
tree | 31ebd9c9edce7569e8af837ab510b1d5a3268251 /parser.cc | |
parent | 2e3a0f4b363c1e4af9dfbbbb1d0c7904617a4f2d (diff) |
modified conjugate gradient code to exponentiate over examples using --initial_pass_length
Diffstat (limited to 'parser.cc')
-rw-r--r-- | parser.cc | 13 |
1 files changed, 9 insertions, 4 deletions
@@ -615,24 +615,29 @@ void *main_parse_loop(void *in) parser* p = (parser*) in; global.passes_complete = 0; + size_t example_number = 0; while(!done) { example* ae=get_unused_example(); - int output = parse_atomic_example(p,ae); - if (output) { + if (example_number != global.pass_length && parse_atomic_example(p,ae)) { setup_example(p,ae); - + example_number++; pthread_mutex_lock(&examples_lock); parsed_index++; pthread_cond_broadcast(&example_available); pthread_mutex_unlock(&examples_lock); - } else { reset_source(global.num_bits, p); global.passes_complete++; + if (global.passes_complete == global.numpasses && example_number == global.pass_length) + { + global.passes_complete = 0; + global.pass_length = global.pass_length*2+1; + } + example_number = 0; if (global.passes_complete >= global.numpasses) { pthread_mutex_lock(&examples_lock); |