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