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 MultiLayerNetworkgetBestModel()Retrieve the best model that was previously savedMultiLayerNetworkgetLatestModel()Retrieve the most recent model that was previously savedvoidsaveBestModel(MultiLayerNetwork net, double score)Save the best model (so far) learned during early stopping trainingvoidsaveLatestModel(MultiLayerNetwork net, double score)Save the latest (most recent) model learned during early stoppingStringtoString()
-
-
-
Method Detail
-
saveBestModel
public void saveBestModel(MultiLayerNetwork net, double score) throws IOException
Description copied from interface:EarlyStoppingModelSaverSave the best model (so far) learned during early stopping training- Specified by:
saveBestModelin interfaceEarlyStoppingModelSaver<MultiLayerNetwork>- Throws:
IOException
-
saveLatestModel
public void saveLatestModel(MultiLayerNetwork net, double score) throws IOException
Description copied from interface:EarlyStoppingModelSaverSave the latest (most recent) model learned during early stopping- Specified by:
saveLatestModelin interfaceEarlyStoppingModelSaver<MultiLayerNetwork>- Throws:
IOException
-
getBestModel
public MultiLayerNetwork getBestModel() throws IOException
Description copied from interface:EarlyStoppingModelSaverRetrieve the best model that was previously saved- Specified by:
getBestModelin interfaceEarlyStoppingModelSaver<MultiLayerNetwork>- Throws:
IOException
-
getLatestModel
public MultiLayerNetwork getLatestModel() throws IOException
Description copied from interface:EarlyStoppingModelSaverRetrieve the most recent model that was previously saved- Specified by:
getLatestModelin interfaceEarlyStoppingModelSaver<MultiLayerNetwork>- Throws:
IOException
-
-