Package org.deeplearning4j.nn.api
Interface ParamInitializer
-
- All Known Implementing Classes:
BatchNormalizationParamInitializer
,BidirectionalParamInitializer
,CenterLossParamInitializer
,Convolution3DParamInitializer
,ConvolutionParamInitializer
,Deconvolution3DParamInitializer
,DeconvolutionParamInitializer
,DefaultParamInitializer
,DepthwiseConvolutionParamInitializer
,ElementWiseParamInitializer
,EmbeddingLayerParamInitializer
,EmptyParamInitializer
,FrozenLayerParamInitializer
,FrozenLayerWithBackpropParamInitializer
,GravesBidirectionalLSTMParamInitializer
,GravesLSTMParamInitializer
,LSTMParamInitializer
,OCNNParamInitializer
,PReLUParamInitializer
,PretrainParamInitializer
,SameDiffParamInitializer
,SeparableConvolutionParamInitializer
,SimpleRnnParamInitializer
,VariationalAutoencoderParamInitializer
,WrapperLayerParamInitializer
public interface ParamInitializer
Param initializer for a layer- Author:
- Adam Gibson
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description List<String>
biasKeys(Layer layer)
Bias parameter keys given the layer configurationMap<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.Map<String,INDArray>
init(NeuralNetConfiguration conf, INDArray paramsView, boolean initializeParams)
Initialize the parametersboolean
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 configurationList<String>
weightKeys(Layer layer)
Weight parameter keys given the layer configuration
-
-
-
Method Detail
-
numParams
long numParams(NeuralNetConfiguration conf)
-
numParams
long numParams(Layer layer)
-
paramKeys
List<String> paramKeys(Layer layer)
Get a list of all parameter keys given the layer configuration- Parameters:
layer
- Layer- Returns:
- All parameter keys
-
weightKeys
List<String> weightKeys(Layer layer)
Weight parameter keys given the layer configuration- Parameters:
layer
- Layer- Returns:
- Weight parameter keys
-
biasKeys
List<String> biasKeys(Layer layer)
Bias parameter keys given the layer configuration- Parameters:
layer
- Layer- Returns:
- Bias parameter keys
-
isWeightParam
boolean isWeightParam(Layer layer, String key)
Is the specified parameter a weight?- Parameters:
layer
- Layerkey
- Key to check- Returns:
- True if parameter is a weight
-
isBiasParam
boolean isBiasParam(Layer layer, String key)
Is the specified parameter a bias?- Parameters:
layer
- Layerkey
- Key to check- Returns:
- True if parameter is a bias
-
init
Map<String,INDArray> init(NeuralNetConfiguration conf, INDArray paramsView, boolean initializeParams)
Initialize the parameters- Parameters:
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)- Returns:
- Map of parameters keyed by type (view of the 'paramsView' array)
-
getGradientsFromFlattened
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. The idea is that operates in exactly the same way as the paramsView does in#init(Map, NeuralNetConfiguration, INDArray)
; thus the position in the view (and, the array orders) must match those of the parameters- Parameters:
conf
- ConfigurationgradientView
- The flattened gradients array, as a view of the larger array- Returns:
- A map containing an array by parameter type, that is a view of the full network gradients array
-
-