public class OCNNParamInitializer extends DefaultParamInitializer
OCNNOutputLayer
Modifier and Type | Field and Description |
---|---|
static String |
K_KEY |
static String |
NU_KEY |
static String |
R_KEY |
static String |
V_KEY |
static String |
W_KEY |
BIAS_KEY, WEIGHT_KEY
Constructor and Description |
---|
OCNNParamInitializer() |
Modifier and Type | Method and Description |
---|---|
List<String> |
biasKeys(Layer layer)
Bias parameter keys given the layer configuration
|
protected org.nd4j.linalg.api.ndarray.INDArray |
createWeightMatrix(NeuralNetConfiguration configuration,
org.nd4j.linalg.api.ndarray.INDArray weightParamView,
boolean initializeParameters) |
Map<String,org.nd4j.linalg.api.ndarray.INDArray> |
getGradientsFromFlattened(NeuralNetConfiguration conf,
org.nd4j.linalg.api.ndarray.INDArray gradientView)
Return a map of gradients (in their standard non-flattened representation), taken from the flattened (row vector) gradientView array.
|
static OCNNParamInitializer |
getInstance() |
Map<String,org.nd4j.linalg.api.ndarray.INDArray> |
init(NeuralNetConfiguration conf,
org.nd4j.linalg.api.ndarray.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?
|
int |
numParams(Layer layer) |
int |
numParams(NeuralNetConfiguration conf) |
List<String> |
paramKeys(Layer layer)
Get a list of all parameter keys given the layer configuration
|
List<String> |
weightKeys(Layer layer)
Weight parameter keys given the layer configuration
|
createBias, createBias, createWeightMatrix, hasBias
public static final String NU_KEY
public static final String K_KEY
public static final String V_KEY
public static final String W_KEY
public static final String R_KEY
public static OCNNParamInitializer getInstance()
public int numParams(NeuralNetConfiguration conf)
numParams
in interface ParamInitializer
numParams
in class DefaultParamInitializer
public int numParams(Layer layer)
numParams
in interface ParamInitializer
numParams
in class DefaultParamInitializer
public List<String> paramKeys(Layer layer)
ParamInitializer
paramKeys
in interface ParamInitializer
paramKeys
in class DefaultParamInitializer
layer
- Layerpublic List<String> weightKeys(Layer layer)
ParamInitializer
weightKeys
in interface ParamInitializer
weightKeys
in class DefaultParamInitializer
layer
- Layerpublic List<String> biasKeys(Layer layer)
ParamInitializer
biasKeys
in interface ParamInitializer
biasKeys
in class DefaultParamInitializer
layer
- Layerpublic boolean isWeightParam(Layer layer, String key)
ParamInitializer
isWeightParam
in interface ParamInitializer
isWeightParam
in class DefaultParamInitializer
layer
- Layerkey
- Key to checkpublic boolean isBiasParam(Layer layer, String key)
ParamInitializer
isBiasParam
in interface ParamInitializer
isBiasParam
in class DefaultParamInitializer
layer
- Layerkey
- Key to checkpublic Map<String,org.nd4j.linalg.api.ndarray.INDArray> init(NeuralNetConfiguration conf, org.nd4j.linalg.api.ndarray.INDArray paramsView, boolean initializeParams)
ParamInitializer
init
in interface ParamInitializer
init
in class DefaultParamInitializer
conf
- 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,org.nd4j.linalg.api.ndarray.INDArray> getGradientsFromFlattened(NeuralNetConfiguration conf, org.nd4j.linalg.api.ndarray.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 ParamInitializer
getGradientsFromFlattened
in class DefaultParamInitializer
conf
- ConfigurationgradientView
- The flattened gradients array, as a view of the larger arrayprotected org.nd4j.linalg.api.ndarray.INDArray createWeightMatrix(NeuralNetConfiguration configuration, org.nd4j.linalg.api.ndarray.INDArray weightParamView, boolean initializeParameters)
createWeightMatrix
in class DefaultParamInitializer
Copyright © 2018. All rights reserved.