@Immutable @Shareable public class ErrorThresholdStoppingCondition extends java.lang.Object implements StoppingCondition, java.io.Serializable
Stop when absolute value of the error drops below a threshold.
Note: Loop controllers created by this stopping condition support waiting until the threshold has been met for multiple iterations to stop.
This stopping condition differs from ThresholdStoppingCondition
in that it thresholds the absolute error instead of the change in error from one iteration to another.
Constructor and Description |
---|
ErrorThresholdStoppingCondition(double thresh)
Create a new threshold stop with no minimum iteration count.
|
ErrorThresholdStoppingCondition(double thresh,
int minIter)
Construct a new error threshold stop.
|
Modifier and Type | Method and Description |
---|---|
int |
getMinimumIterations()
Get the minimum iteration count.
|
double |
getThreshold()
Get the stopper’s threshold.
|
TrainingLoopController |
newLoop()
Create a controller for a new training loop.
|
java.lang.String |
toString() |
@Inject public ErrorThresholdStoppingCondition(@StoppingThreshold double thresh, @MinimumIterations int minIter)
Construct a new error threshold stop.
thresh
- The threshold.minIter
- The minimum number of iterations.public ErrorThresholdStoppingCondition(double thresh)
Create a new threshold stop with no minimum iteration count.
thresh
- The threshold value.public TrainingLoopController newLoop()
StoppingCondition
Create a controller for a new training loop.
newLoop
in interface StoppingCondition
public double getThreshold()
Get the stopper’s threshold.
public int getMinimumIterations()
Get the minimum iteration count.
public java.lang.String toString()
toString
in class java.lang.Object