EarlyStopping

Constructors

this
this()
Undocumented in source.
this
this(size_t patience)
Undocumented in source.

Members

Functions

shouldStop
bool shouldStop(Tensor!(T, [1]) loss)
Undocumented in source. Be warned that the author may not have intended to support it.
shouldStop
bool shouldStop(Tensor!(T, [1], UseGradient.no) loss)
Undocumented in source. Be warned that the author may not have intended to support it.
shouldStop
bool shouldStop(T loss)
Undocumented in source. Be warned that the author may not have intended to support it.

Variables

minLoss
T minLoss;
Undocumented in source.
patience
size_t patience;
Undocumented in source.
patienceStep
size_t patienceStep;
Undocumented in source.

Examples

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])));

Meta