public class EarlyStopping
extends java.lang.Object
implements weka.core.OptionHandler, java.io.Serializable
Constructor and Description |
---|
EarlyStopping() |
EarlyStopping(int maxEpochsNoImprovement,
double validationSetPercentage)
Constructor setting maxEpochsNoImprovement and validation split
|
Modifier and Type | Method and Description |
---|---|
boolean |
evaluate(org.deeplearning4j.nn.graph.ComputationGraph model)
Evaluate a model and check if the training should continue.
|
int |
getMaxEpochsNoImprovement() |
java.lang.String[] |
getOptions()
Gets the current settings of the Classifier.
|
org.nd4j.linalg.dataset.api.iterator.DataSetIterator |
getValDataSetIterator()
Get the validation dataset iterator
|
double |
getValidationSetPercentage() |
java.lang.String |
globalInfo()
Returns a string describing this search method
|
void |
init(org.nd4j.linalg.dataset.api.iterator.DataSetIterator dsIt)
Initialize the underlying dl4j EarlyStopping object
|
java.util.Enumeration<weka.core.Option> |
listOptions()
Returns an enumeration describing the available options.
|
void |
setMaxEpochsNoImprovement(int maxEpochsNoIMprovement) |
void |
setOptions(java.lang.String[] options)
Parses a given list of options.
|
void |
setValidationSetPercentage(double p) |
public EarlyStopping()
public EarlyStopping(int maxEpochsNoImprovement, double validationSetPercentage)
maxEpochsNoImprovement
- Maximum numer of epochs with no improvementvalidationSetPercentage
- Validation split percentagepublic void init(org.nd4j.linalg.dataset.api.iterator.DataSetIterator dsIt)
dsIt
- DataSet trainIterator of the validation setpublic boolean evaluate(org.deeplearning4j.nn.graph.ComputationGraph model)
model
- Model to be evaluated against the validation setpublic int getMaxEpochsNoImprovement()
@OptionMetadata(displayName="max epochs with no improvement", description="Terminate after N epochs in which the model has shown no improvement (default = 0).", commandLineParamName="maxEpochsNoImprovement", commandLineParamSynopsis="-maxEpochsNoImprovement <int>", displayOrder=0) public void setMaxEpochsNoImprovement(int maxEpochsNoIMprovement)
public double getValidationSetPercentage()
@OptionMetadata(displayName="validation set percentage", description="Percentage of training set to use for validation (default = 0).", commandLineParamName="valPercentage", commandLineParamSynopsis="-valPercentage <float>", displayOrder=1) public void setValidationSetPercentage(double p)
public org.nd4j.linalg.dataset.api.iterator.DataSetIterator getValDataSetIterator()
public java.util.Enumeration<weka.core.Option> listOptions()
listOptions
in interface weka.core.OptionHandler
public java.lang.String[] getOptions()
getOptions
in interface weka.core.OptionHandler
public void setOptions(java.lang.String[] options) throws java.lang.Exception
setOptions
in interface weka.core.OptionHandler
options
- the list of options as an array of stringsjava.lang.Exception
- if an option is not supportedpublic java.lang.String globalInfo()