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, GAIN_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 INDArray |
createWeightMatrix(NeuralNetConfiguration configuration,
INDArray weightParamView,
boolean initializeParameters) |
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 OCNNParamInitializer |
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
|
List<String> |
weightKeys(Layer layer)
Weight parameter keys given the layer configuration
|
createBias, createBias, createGain, createGain, createWeightMatrix, hasBias, hasLayerNormpublic 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 long numParams(NeuralNetConfiguration conf)
numParams in interface ParamInitializernumParams in class DefaultParamInitializerpublic long numParams(Layer layer)
numParams in interface ParamInitializernumParams in class DefaultParamInitializerpublic List<String> paramKeys(Layer layer)
ParamInitializerparamKeys in interface ParamInitializerparamKeys in class DefaultParamInitializerlayer - Layerpublic List<String> weightKeys(Layer layer)
ParamInitializerweightKeys in interface ParamInitializerweightKeys in class DefaultParamInitializerlayer - Layerpublic List<String> biasKeys(Layer layer)
ParamInitializerbiasKeys in interface ParamInitializerbiasKeys in class DefaultParamInitializerlayer - Layerpublic boolean isWeightParam(Layer layer, String key)
ParamInitializerisWeightParam in interface ParamInitializerisWeightParam in class DefaultParamInitializerlayer - Layerkey - Key to checkpublic boolean isBiasParam(Layer layer, String key)
ParamInitializerisBiasParam in interface ParamInitializerisBiasParam in class DefaultParamInitializerlayer - Layerkey - Key to checkpublic Map<String,INDArray> init(NeuralNetConfiguration conf, INDArray paramsView, boolean initializeParams)
ParamInitializerinit in interface ParamInitializerinit in class DefaultParamInitializerconf - 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 ParamInitializergetGradientsFromFlattened in class DefaultParamInitializerconf - ConfigurationgradientView - The flattened gradients array, as a view of the larger arrayprotected INDArray createWeightMatrix(NeuralNetConfiguration configuration, INDArray weightParamView, boolean initializeParameters)
createWeightMatrix in class DefaultParamInitializerCopyright © 2020. All rights reserved.