Class LocalFileModelSaver
- java.lang.Object
-
- org.deeplearning4j.earlystopping.saver.LocalFileModelSaver
-
- All Implemented Interfaces:
Serializable
,EarlyStoppingModelSaver<MultiLayerNetwork>
public class LocalFileModelSaver extends Object implements EarlyStoppingModelSaver<MultiLayerNetwork>
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description LocalFileModelSaver(File directory)
LocalFileModelSaver(String directory)
Constructor that uses default character set for configuration (json) encodingLocalFileModelSaver(String directory, Charset encoding)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MultiLayerNetwork
getBestModel()
Retrieve the best model that was previously savedMultiLayerNetwork
getLatestModel()
Retrieve the most recent model that was previously savedvoid
saveBestModel(MultiLayerNetwork net, double score)
Save the best model (so far) learned during early stopping trainingvoid
saveLatestModel(MultiLayerNetwork net, double score)
Save the latest (most recent) model learned during early stoppingString
toString()
-
-
-
Method Detail
-
saveBestModel
public void saveBestModel(MultiLayerNetwork net, double score) throws IOException
Description copied from interface:EarlyStoppingModelSaver
Save the best model (so far) learned during early stopping training- Specified by:
saveBestModel
in interfaceEarlyStoppingModelSaver<MultiLayerNetwork>
- Throws:
IOException
-
saveLatestModel
public void saveLatestModel(MultiLayerNetwork net, double score) throws IOException
Description copied from interface:EarlyStoppingModelSaver
Save the latest (most recent) model learned during early stopping- Specified by:
saveLatestModel
in interfaceEarlyStoppingModelSaver<MultiLayerNetwork>
- Throws:
IOException
-
getBestModel
public MultiLayerNetwork getBestModel() throws IOException
Description copied from interface:EarlyStoppingModelSaver
Retrieve the best model that was previously saved- Specified by:
getBestModel
in interfaceEarlyStoppingModelSaver<MultiLayerNetwork>
- Throws:
IOException
-
getLatestModel
public MultiLayerNetwork getLatestModel() throws IOException
Description copied from interface:EarlyStoppingModelSaver
Retrieve the most recent model that was previously saved- Specified by:
getLatestModel
in interfaceEarlyStoppingModelSaver<MultiLayerNetwork>
- Throws:
IOException
-
-