public class LocalFileGraphSaver extends Object implements EarlyStoppingModelSaver<ComputationGraph>
Constructor and Description |
---|
LocalFileGraphSaver(String directory)
Constructor that uses default character set for configuration (json) encoding
|
LocalFileGraphSaver(String directory,
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
|
String |
toString() |
public LocalFileGraphSaver(String directory)
directory
- Directory to save networkspublic void saveBestModel(ComputationGraph net, double score) throws IOException
EarlyStoppingModelSaver
saveBestModel
in interface EarlyStoppingModelSaver<ComputationGraph>
IOException
public void saveLatestModel(ComputationGraph net, double score) throws IOException
EarlyStoppingModelSaver
saveLatestModel
in interface EarlyStoppingModelSaver<ComputationGraph>
IOException
public ComputationGraph getBestModel() throws IOException
EarlyStoppingModelSaver
getBestModel
in interface EarlyStoppingModelSaver<ComputationGraph>
IOException
public ComputationGraph getLatestModel() throws IOException
EarlyStoppingModelSaver
getLatestModel
in interface EarlyStoppingModelSaver<ComputationGraph>
IOException
Copyright © 2022. All rights reserved.