public class ElementWiseParamInitializer extends DefaultParamInitializer
BIAS_KEY, GAIN_KEY, WEIGHT_KEY
Constructor and Description |
---|
ElementWiseParamInitializer() |
Modifier and Type | Method and Description |
---|---|
protected INDArray |
createWeightMatrix(long nIn,
long nOut,
IWeightInit weightInit,
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 ElementWiseParamInitializer |
getInstance() |
Map<String,INDArray> |
init(NeuralNetConfiguration conf,
INDArray paramsView,
boolean initializeParams)
Initialize the parameters
|
long |
numParams(Layer layer) |
biasKeys, createBias, createBias, createGain, createGain, createWeightMatrix, hasBias, hasLayerNorm, isBiasParam, isWeightParam, numParams, paramKeys, weightKeys
public static ElementWiseParamInitializer getInstance()
public long numParams(Layer layer)
numParams
in interface ParamInitializer
numParams
in class DefaultParamInitializer
public Map<String,INDArray> init(NeuralNetConfiguration conf, INDArray paramsView, boolean initializeParams)
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,INDArray> getGradientsFromFlattened(NeuralNetConfiguration conf, INDArray gradientView)
getGradientsFromFlattened
in interface ParamInitializer
getGradientsFromFlattened
in class DefaultParamInitializer
conf
- ConfigurationgradientView
- The flattened gradients array, as a view of the larger arrayprotected INDArray createWeightMatrix(long nIn, long nOut, IWeightInit weightInit, INDArray weightParamView, boolean initializeParameters)
createWeightMatrix
in class DefaultParamInitializer
Copyright © 2021. All rights reserved.