public class SameDiffParamInitializer extends Object implements ParamInitializer
| Constructor and Description |
|---|
SameDiffParamInitializer() |
| Modifier and Type | Method and Description |
|---|---|
List<String> |
biasKeys(Layer layer)
Bias parameter keys given the layer configuration
|
Map<String,INDArray> |
getGradientsFromFlattened(NeuralNetConfiguration conf,
INDArray gradientView)
Return a map of gradients (in their standard non-flattened representation), taken from the flattened (row vector) gradientView array.
|
static SameDiffParamInitializer |
getInstance() |
Map<String,INDArray> |
init(NeuralNetConfiguration conf,
INDArray paramsView,
boolean initializeParams)
Initialize the parameters
|
boolean |
isBiasParam(Layer layer,
String key)
Is the specified parameter a bias?
|
boolean |
isWeightParam(Layer layer,
String key)
Is the specified parameter a weight?
|
long |
numParams(Layer layer) |
long |
numParams(NeuralNetConfiguration conf) |
List<String> |
paramKeys(Layer layer)
Get a list of all parameter keys given the layer configuration
|
Map<String,INDArray> |
subsetAndReshape(List<String> params,
Map<String,long[]> paramShapes,
INDArray view,
AbstractSameDiffLayer sdl,
SameDiffVertex sdv) |
List<String> |
weightKeys(Layer layer)
Weight parameter keys given the layer configuration
|
public static SameDiffParamInitializer getInstance()
public long numParams(NeuralNetConfiguration conf)
numParams in interface ParamInitializerpublic long numParams(Layer layer)
numParams in interface ParamInitializerpublic List<String> paramKeys(Layer layer)
ParamInitializerparamKeys in interface ParamInitializerlayer - Layerpublic List<String> weightKeys(Layer layer)
ParamInitializerweightKeys in interface ParamInitializerlayer - Layerpublic List<String> biasKeys(Layer layer)
ParamInitializerbiasKeys in interface ParamInitializerlayer - Layerpublic boolean isWeightParam(Layer layer, String key)
ParamInitializerisWeightParam in interface ParamInitializerlayer - Layerkey - Key to checkpublic boolean isBiasParam(Layer layer, String key)
ParamInitializerisBiasParam in interface ParamInitializerlayer - Layerkey - Key to checkpublic Map<String,INDArray> init(NeuralNetConfiguration conf, INDArray paramsView, boolean initializeParams)
ParamInitializerinit in interface ParamInitializerconf - the configurationparamsView - a view of the full network (backprop) parametersinitializeParams - if true: initialize the parameters according to the configuration. If false: don't modify the
values in the paramsView array (but do select out the appropriate subset, reshape etc as required)public Map<String,INDArray> getGradientsFromFlattened(NeuralNetConfiguration conf, INDArray gradientView)
ParamInitializer#init(Map, NeuralNetConfiguration, INDArray);
thus the position in the view (and, the array orders) must match those of the parametersgetGradientsFromFlattened in interface ParamInitializerconf - ConfigurationgradientView - The flattened gradients array, as a view of the larger arraypublic Map<String,INDArray> subsetAndReshape(List<String> params, Map<String,long[]> paramShapes, INDArray view, AbstractSameDiffLayer sdl, SameDiffVertex sdv)
Copyright © 2020. All rights reserved.