public class ModelSerializer
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
NORMALIZER_BIN |
static java.lang.String |
OLD_UPDATER_BIN |
static java.lang.String |
UPDATER_BIN |
Modifier and Type | Method and Description |
---|---|
static void |
addNormalizerToModel(java.io.File f,
org.nd4j.linalg.dataset.api.preprocessor.Normalizer<?> normalizer)
This method appends normalizer to a given persisted model.
|
static ComputationGraph |
restoreComputationGraph(java.io.File file)
Load a computation graph from a file
|
static ComputationGraph |
restoreComputationGraph(java.io.File file,
boolean loadUpdater)
Load a computation graph from a file
|
static ComputationGraph |
restoreComputationGraph(java.io.InputStream is)
Load a computation graph from a InputStream
|
static ComputationGraph |
restoreComputationGraph(java.io.InputStream is,
boolean loadUpdater)
Load a computation graph from a InputStream
|
static ComputationGraph |
restoreComputationGraph(java.lang.String path)
Load a computation graph from a file
|
static ComputationGraph |
restoreComputationGraph(java.lang.String path,
boolean loadUpdater)
Load a computation graph from a file
|
static MultiLayerNetwork |
restoreMultiLayerNetwork(java.io.File file)
Load a multi layer network from a file
|
static MultiLayerNetwork |
restoreMultiLayerNetwork(java.io.File file,
boolean loadUpdater)
Load a multi layer network from a file
|
static MultiLayerNetwork |
restoreMultiLayerNetwork(java.io.InputStream is) |
static MultiLayerNetwork |
restoreMultiLayerNetwork(java.io.InputStream is,
boolean loadUpdater)
Load a MultiLayerNetwork from InputStream from a file
|
static MultiLayerNetwork |
restoreMultiLayerNetwork(java.lang.String path)
Load a MultilayerNetwork model from a file
|
static MultiLayerNetwork |
restoreMultiLayerNetwork(java.lang.String path,
boolean loadUpdater)
Load a MultilayerNetwork model from a file
|
static <T extends org.nd4j.linalg.dataset.api.preprocessor.Normalizer> |
restoreNormalizerFromFile(java.io.File file)
This method restores normalizer from a given persisted model file
PLEASE NOTE: File should be model file saved earlier with ModelSerializer with addNormalizerToModel being called
|
static org.nd4j.linalg.heartbeat.reports.Task |
taskByModel(Model model) |
static void |
writeModel(Model model,
java.io.File file,
boolean saveUpdater)
Write a model to a file
|
static void |
writeModel(Model model,
java.io.OutputStream stream,
boolean saveUpdater)
Write a model to an output stream
|
static void |
writeModel(Model model,
java.lang.String path,
boolean saveUpdater)
Write a model to a file path
|
public static final java.lang.String OLD_UPDATER_BIN
public static final java.lang.String UPDATER_BIN
public static final java.lang.String NORMALIZER_BIN
public static void writeModel(@NonNull Model model, @NonNull java.io.File file, boolean saveUpdater) throws java.io.IOException
model
- the model to writefile
- the file to write tosaveUpdater
- whether to save the updater or notjava.io.IOException
public static void writeModel(@NonNull Model model, @NonNull java.lang.String path, boolean saveUpdater) throws java.io.IOException
model
- the model to writepath
- the path to write tosaveUpdater
- whether to save the updater
or notjava.io.IOException
public static void writeModel(@NonNull Model model, @NonNull java.io.OutputStream stream, boolean saveUpdater) throws java.io.IOException
model
- the model to savestream
- the output stream to write tosaveUpdater
- whether to save the updater for the model or notjava.io.IOException
public static MultiLayerNetwork restoreMultiLayerNetwork(@NonNull java.io.File file) throws java.io.IOException
file
- the file to load fromjava.io.IOException
public static MultiLayerNetwork restoreMultiLayerNetwork(@NonNull java.io.File file, boolean loadUpdater) throws java.io.IOException
file
- the file to load fromjava.io.IOException
public static MultiLayerNetwork restoreMultiLayerNetwork(@NonNull java.io.InputStream is, boolean loadUpdater) throws java.io.IOException
is
- the inputstream to load fromjava.io.IOException
public static MultiLayerNetwork restoreMultiLayerNetwork(@NonNull java.io.InputStream is) throws java.io.IOException
java.io.IOException
public static MultiLayerNetwork restoreMultiLayerNetwork(@NonNull java.lang.String path) throws java.io.IOException
path
- path to the model file, to get the computation graph fromjava.io.IOException
public static MultiLayerNetwork restoreMultiLayerNetwork(@NonNull java.lang.String path, boolean loadUpdater) throws java.io.IOException
path
- path to the model file, to get the computation graph fromjava.io.IOException
public static ComputationGraph restoreComputationGraph(@NonNull java.lang.String path) throws java.io.IOException
path
- path to the model file, to get the computation graph fromjava.io.IOException
public static ComputationGraph restoreComputationGraph(@NonNull java.lang.String path, boolean loadUpdater) throws java.io.IOException
path
- path to the model file, to get the computation graph fromjava.io.IOException
public static ComputationGraph restoreComputationGraph(@NonNull java.io.InputStream is, boolean loadUpdater) throws java.io.IOException
is
- the inputstream to get the computation graph fromjava.io.IOException
public static ComputationGraph restoreComputationGraph(@NonNull java.io.InputStream is) throws java.io.IOException
is
- the inputstream to get the computation graph fromjava.io.IOException
public static ComputationGraph restoreComputationGraph(@NonNull java.io.File file) throws java.io.IOException
file
- the file to get the computation graph fromjava.io.IOException
public static ComputationGraph restoreComputationGraph(@NonNull java.io.File file, boolean loadUpdater) throws java.io.IOException
file
- the file to get the computation graph fromjava.io.IOException
public static org.nd4j.linalg.heartbeat.reports.Task taskByModel(Model model)
model
- public static void addNormalizerToModel(java.io.File f, org.nd4j.linalg.dataset.api.preprocessor.Normalizer<?> normalizer)
f
- normalizer
- public static <T extends org.nd4j.linalg.dataset.api.preprocessor.Normalizer> T restoreNormalizerFromFile(java.io.File file)
file
-