public class NetSaverLoaderUtils extends Object
Modifier and Type | Method and Description |
---|---|
static String |
defineOutputDir(String networkType)
Define output directory based on network type
|
static Map<Integer,String> |
getIdParamPaths(String basePath,
int[] layerIds)
Create map of *int* layerIds to path
|
static Map<String,String> |
getStringParamPaths(String basePath,
String[] layerIds)
Create map of *string* layerIds to path
|
static Layer |
loadLayerParameters(Layer layer,
String paramPath)
Load existing parameters to the layer
|
static MultiLayerNetwork |
loadNetworkAndParameters(String confPath,
String paramPath)
Load existing model configuration and parameters
|
static MultiLayerNetwork |
loadParameters(MultiLayerNetwork net,
int[] layerIds,
Map<Integer,String> paramPaths)
Load existing parameters for the network
|
static MultiLayerNetwork |
loadParameters(MultiLayerNetwork net,
String[] layerIds,
Map<String,String> paramPaths)
Load existing parameters for the network
|
static Updater |
loadUpdators(String updatorPath)
Load model updators
|
static void |
saveLayerParameters(org.nd4j.linalg.api.ndarray.INDArray param,
String paramPath)
Save existing parameters for the layer
|
static void |
saveNetworkAndParameters(MultiLayerNetwork net,
String basePath)
Save model configuration and parameters
|
static void |
saveParameters(MultiLayerNetwork net,
int[] layerIds,
Map<Integer,String> paramPaths)
Save existing parameters for the network
|
static void |
saveParameters(MultiLayerNetwork net,
String[] layerIds,
Map<String,String> paramPaths)
Save existing parameters for the network
|
static void |
saveUpdators(MultiLayerNetwork net,
String basePath)
Save model updators
|
public static void saveNetworkAndParameters(MultiLayerNetwork net, String basePath)
net
- trained network | modelbasePath
- path to store configurationpublic static MultiLayerNetwork loadNetworkAndParameters(String confPath, String paramPath)
confPath
- string path where model configuration is storedparamPath
- string path where parameters are storedpublic static void saveUpdators(MultiLayerNetwork net, String basePath)
net
- trained network | modelbasePath
- path to store configurationpublic static Updater loadUpdators(String updatorPath)
updatorPath
- path of the updators
Returns saved updaterspublic static void saveLayerParameters(org.nd4j.linalg.api.ndarray.INDArray param, String paramPath)
param
- layer parameters in INDArray formatparamPath
- string path where parameters are storedpublic static Layer loadLayerParameters(Layer layer, String paramPath)
layer
- to load the parameters intoparamPath
- string path where parameters are storedpublic static void saveParameters(MultiLayerNetwork net, int[] layerIds, Map<Integer,String> paramPaths)
net
- trained network | modellayerIds
- list of *int* layer idsparamPaths
- map of layer ids and string paths to store parameterspublic static void saveParameters(MultiLayerNetwork net, String[] layerIds, Map<String,String> paramPaths)
net
- trained network | modellayerIds
- list of *string* layer idsparamPaths
- map of layer ids and string paths to store parameterspublic static MultiLayerNetwork loadParameters(MultiLayerNetwork net, int[] layerIds, Map<Integer,String> paramPaths)
net
- trained network | modellayerIds
- list of *int* layer idsparamPaths
- map of layer ids and string paths to find parameterspublic static MultiLayerNetwork loadParameters(MultiLayerNetwork net, String[] layerIds, Map<String,String> paramPaths)
net
- trained network | modellayerIds
- list of *string* layer idsparamPaths
- map of layer ids and string paths to find parameterspublic static Map<Integer,String> getIdParamPaths(String basePath, int[] layerIds)
layerIds
- list of *string* layer idsbasePath
- string path to find parameterspublic static Map<String,String> getStringParamPaths(String basePath, String[] layerIds)
layerIds
- list of *string* layer idsbasePath
- string path to find parametersCopyright © 2016. All Rights Reserved.