public class ModelSerializer extends Object
Modifier and Type | Field and Description |
---|---|
static String |
NORMALIZER_BIN |
static String |
OLD_UPDATER_BIN |
static String |
UPDATER_BIN |
Modifier and Type | Method and Description |
---|---|
static void |
addNormalizerToModel(File f,
org.nd4j.linalg.dataset.api.preprocessor.Normalizer<?> normalizer)
This method appends normalizer to a given persisted model.
|
static ComputationGraph |
restoreComputationGraph(File file)
Load a computation graph from a file
|
static ComputationGraph |
restoreComputationGraph(File file,
boolean loadUpdater)
Load a computation graph from a file
|
static ComputationGraph |
restoreComputationGraph(InputStream is)
Load a computation graph from a InputStream
|
static ComputationGraph |
restoreComputationGraph(InputStream is,
boolean loadUpdater)
Load a computation graph from a InputStream
|
static ComputationGraph |
restoreComputationGraph(String path)
Load a computation graph from a file
|
static ComputationGraph |
restoreComputationGraph(String path,
boolean loadUpdater)
Load a computation graph from a file
|
static MultiLayerNetwork |
restoreMultiLayerNetwork(File file)
Load a multi layer network from a file
|
static MultiLayerNetwork |
restoreMultiLayerNetwork(File file,
boolean loadUpdater)
Load a multi layer network from a file
|
static MultiLayerNetwork |
restoreMultiLayerNetwork(InputStream is) |
static MultiLayerNetwork |
restoreMultiLayerNetwork(InputStream is,
boolean loadUpdater)
Load a MultiLayerNetwork from InputStream from a file
|
static MultiLayerNetwork |
restoreMultiLayerNetwork(String path)
Load a MultilayerNetwork model from a file
|
static MultiLayerNetwork |
restoreMultiLayerNetwork(String path,
boolean loadUpdater)
Load a MultilayerNetwork model from a file
|
static <T extends org.nd4j.linalg.dataset.api.preprocessor.Normalizer> |
restoreNormalizerFromFile(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 <T extends org.nd4j.linalg.dataset.api.preprocessor.Normalizer> |
restoreNormalizerFromInputStream(InputStream is)
This method restores the normalizer form a persisted model file.
|
static org.nd4j.linalg.heartbeat.reports.Task |
taskByModel(Model model) |
static void |
writeModel(Model model,
File file,
boolean saveUpdater)
Write a model to a file
|
static void |
writeModel(Model model,
OutputStream stream,
boolean saveUpdater)
Write a model to an output stream
|
static void |
writeModel(Model model,
String path,
boolean saveUpdater)
Write a model to a file path
|
public static final String OLD_UPDATER_BIN
public static final String UPDATER_BIN
public static final String NORMALIZER_BIN
public static void writeModel(@NonNull Model model, @NonNull File file, boolean saveUpdater) throws IOException
model
- the model to writefile
- the file to write tosaveUpdater
- whether to save the updater or notIOException
public static void writeModel(@NonNull Model model, @NonNull String path, boolean saveUpdater) throws IOException
model
- the model to writepath
- the path to write tosaveUpdater
- whether to save the updater
or notIOException
public static void writeModel(@NonNull Model model, @NonNull OutputStream stream, boolean saveUpdater) throws IOException
model
- the model to savestream
- the output stream to write tosaveUpdater
- whether to save the updater for the model or notIOException
public static MultiLayerNetwork restoreMultiLayerNetwork(@NonNull File file) throws IOException
file
- the file to load fromIOException
public static MultiLayerNetwork restoreMultiLayerNetwork(@NonNull File file, boolean loadUpdater) throws IOException
file
- the file to load fromIOException
public static MultiLayerNetwork restoreMultiLayerNetwork(@NonNull InputStream is, boolean loadUpdater) throws IOException
is
- the inputstream to load fromIOException
public static MultiLayerNetwork restoreMultiLayerNetwork(@NonNull InputStream is) throws IOException
IOException
public static MultiLayerNetwork restoreMultiLayerNetwork(@NonNull String path) throws IOException
path
- path to the model file, to get the computation graph fromIOException
public static MultiLayerNetwork restoreMultiLayerNetwork(@NonNull String path, boolean loadUpdater) throws IOException
path
- path to the model file, to get the computation graph fromIOException
public static ComputationGraph restoreComputationGraph(@NonNull String path) throws IOException
path
- path to the model file, to get the computation graph fromIOException
public static ComputationGraph restoreComputationGraph(@NonNull String path, boolean loadUpdater) throws IOException
path
- path to the model file, to get the computation graph fromIOException
public static ComputationGraph restoreComputationGraph(@NonNull InputStream is, boolean loadUpdater) throws IOException
is
- the inputstream to get the computation graph fromIOException
public static ComputationGraph restoreComputationGraph(@NonNull InputStream is) throws IOException
is
- the inputstream to get the computation graph fromIOException
public static ComputationGraph restoreComputationGraph(@NonNull File file) throws IOException
file
- the file to get the computation graph fromIOException
public static ComputationGraph restoreComputationGraph(@NonNull File file, boolean loadUpdater) throws IOException
file
- the file to get the computation graph fromIOException
public static org.nd4j.linalg.heartbeat.reports.Task taskByModel(Model model)
model
- public static void addNormalizerToModel(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(File file)
file
- public static <T extends org.nd4j.linalg.dataset.api.preprocessor.Normalizer> T restoreNormalizerFromInputStream(InputStream is) throws IOException
is
- A stream to load data from.IOException
Copyright © 2017. All rights reserved.