ditto
auto es = new EarlyStopping!float; assert(!es.shouldStop(1.0f)); assert(!es.shouldStop(0.9f)); assert(!es.shouldStop(0.6f)); assert(!es.shouldStop(0.7f)); assert(!es.shouldStop(0.7f)); assert(es.shouldStop(0.7f));
ditto
auto es = new EarlyStopping!float(2); assert(!es.shouldStop(tensor!([1])([1.0f]))); assert(!es.shouldStop(tensor!([1])([0.8f]))); assert(!es.shouldStop(tensor!([1])([1.0f]))); assert(es.shouldStop(tensor!([1])([1.0f])));