Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

added ring size check to csoaa and wap

  • Loading branch information...
commit 767a0564f4317573775228da8ec47271cb7a7306 1 parent 0519e75
@hal3 hal3 authored
Showing with 12 additions and 2 deletions.
  1. +6 −1 vowpalwabbit/csoaa.cc
  2. +6 −1 vowpalwabbit/wap.cc
View
7 vowpalwabbit/csoaa.cc
@@ -389,7 +389,12 @@ namespace CSOAA_LDF {
}
void learn(example *ec) {
- // TODO: break long examples
+ if (ec_seq.index() >= global.ring_size - 2) { // give some wiggle room
+ cerr << "warning: length of sequence at " << ec->example_counter << " exceeds ring size; breaking apart" << endl;
+ do_actual_learning();
+ clear_seq(true);
+ }
+
if (example_is_newline(ec)) {
do_actual_learning();
clear_seq(true);
View
7 vowpalwabbit/wap.cc
@@ -440,7 +440,12 @@ namespace WAP_LDF {
}
void learn(example *ec) {
- // TODO: break long examples
+ if (ec_seq.index() >= global.ring_size - 2) { // give some wiggle room
+ cerr << "warning: length of sequence at " << ec->example_counter << " exceeds ring size; breaking apart" << endl;
+ do_actual_learning();
+ clear_seq(true);
+ }
+
if (CSOAA_LDF::example_is_newline(ec)) {
do_actual_learning();
clear_seq(true);
Please sign in to comment.
Something went wrong with that request. Please try again.