Class LocalFileGraphSaver
- java.lang.Object
-
- org.deeplearning4j.earlystopping.saver.LocalFileGraphSaver
-
- All Implemented Interfaces:
Serializable,EarlyStoppingModelSaver<ComputationGraph>
public class LocalFileGraphSaver extends Object implements EarlyStoppingModelSaver<ComputationGraph>
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description LocalFileGraphSaver(String directory)Constructor that uses default character set for configuration (json) encodingLocalFileGraphSaver(String directory, Charset encoding)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ComputationGraphgetBestModel()Retrieve the best model that was previously savedComputationGraphgetLatestModel()Retrieve the most recent model that was previously savedvoidsaveBestModel(ComputationGraph net, double score)Save the best model (so far) learned during early stopping trainingvoidsaveLatestModel(ComputationGraph net, double score)Save the latest (most recent) model learned during early stoppingStringtoString()
-
-
-
Constructor Detail
-
LocalFileGraphSaver
public LocalFileGraphSaver(String directory)
Constructor that uses default character set for configuration (json) encoding- Parameters:
directory- Directory to save networks
-
-
Method Detail
-
saveBestModel
public void saveBestModel(ComputationGraph net, double score) throws IOException
Description copied from interface:EarlyStoppingModelSaverSave the best model (so far) learned during early stopping training- Specified by:
saveBestModelin interfaceEarlyStoppingModelSaver<ComputationGraph>- Throws:
IOException
-
saveLatestModel
public void saveLatestModel(ComputationGraph net, double score) throws IOException
Description copied from interface:EarlyStoppingModelSaverSave the latest (most recent) model learned during early stopping- Specified by:
saveLatestModelin interfaceEarlyStoppingModelSaver<ComputationGraph>- Throws:
IOException
-
getBestModel
public ComputationGraph getBestModel() throws IOException
Description copied from interface:EarlyStoppingModelSaverRetrieve the best model that was previously saved- Specified by:
getBestModelin interfaceEarlyStoppingModelSaver<ComputationGraph>- Throws:
IOException
-
getLatestModel
public ComputationGraph getLatestModel() throws IOException
Description copied from interface:EarlyStoppingModelSaverRetrieve the most recent model that was previously saved- Specified by:
getLatestModelin interfaceEarlyStoppingModelSaver<ComputationGraph>- Throws:
IOException
-
-