public class LocalFileGraphSaver extends java.lang.Object implements EarlyStoppingModelSaver<ComputationGraph>
ComputationGraphs learned during early stopping training to the local file system.| Constructor and Description |
|---|
LocalFileGraphSaver(java.lang.String directory)
Constructor that uses default character set for configuration (json) encoding
|
LocalFileGraphSaver(java.lang.String directory,
java.nio.charset.Charset encoding) |
| Modifier and Type | Method and Description |
|---|---|
ComputationGraph |
getBestModel()
Retrieve the best model that was previously saved
|
ComputationGraph |
getLatestModel()
Retrieve the most recent model that was previously saved
|
void |
saveBestModel(ComputationGraph net,
double score)
Save the best model (so far) learned during early stopping training
|
void |
saveLatestModel(ComputationGraph net,
double score)
Save the latest (most recent) model learned during early stopping
|
java.lang.String |
toString() |
public LocalFileGraphSaver(java.lang.String directory)
directory - Directory to save networkspublic LocalFileGraphSaver(java.lang.String directory,
java.nio.charset.Charset encoding)
directory - Directory to save networksencoding - Character encoding for configuration (json)public void saveBestModel(ComputationGraph net, double score) throws java.io.IOException
EarlyStoppingModelSaversaveBestModel in interface EarlyStoppingModelSaver<ComputationGraph>java.io.IOExceptionpublic void saveLatestModel(ComputationGraph net, double score) throws java.io.IOException
EarlyStoppingModelSaversaveLatestModel in interface EarlyStoppingModelSaver<ComputationGraph>java.io.IOExceptionpublic ComputationGraph getBestModel() throws java.io.IOException
EarlyStoppingModelSavergetBestModel in interface EarlyStoppingModelSaver<ComputationGraph>java.io.IOExceptionpublic ComputationGraph getLatestModel() throws java.io.IOException
EarlyStoppingModelSavergetLatestModel in interface EarlyStoppingModelSaver<ComputationGraph>java.io.IOExceptionpublic java.lang.String toString()
toString in class java.lang.Object