Package org.deeplearning4j.nn.params
Class SeparableConvolutionParamInitializer
- java.lang.Object
-
- org.deeplearning4j.nn.params.SeparableConvolutionParamInitializer
-
- All Implemented Interfaces:
ParamInitializer
public class SeparableConvolutionParamInitializer extends Object implements ParamInitializer
-
-
Field Summary
Fields Modifier and Type Field Description static String
BIAS_KEY
static String
DEPTH_WISE_WEIGHT_KEY
static String
POINT_WISE_WEIGHT_KEY
-
Constructor Summary
Constructors Constructor Description SeparableConvolutionParamInitializer()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description List<String>
biasKeys(Layer layer)
Bias parameter keys given the layer configurationprotected INDArray
createBias(NeuralNetConfiguration conf, INDArray biasView, boolean initializeParams)
protected INDArray
createDepthWiseWeightMatrix(NeuralNetConfiguration conf, INDArray weightView, boolean initializeParams)
protected INDArray
createPointWiseWeightMatrix(NeuralNetConfiguration conf, INDArray weightView, boolean initializeParams)
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 SeparableConvolutionParamInitializer
getInstance()
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 l)
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
-
-
-
Field Detail
-
DEPTH_WISE_WEIGHT_KEY
public static final String DEPTH_WISE_WEIGHT_KEY
- See Also:
- Constant Field Values
-
POINT_WISE_WEIGHT_KEY
public static final String POINT_WISE_WEIGHT_KEY
- See Also:
- Constant Field Values
-
BIAS_KEY
public static final String BIAS_KEY
- See Also:
- Constant Field Values
-
-
Method Detail
-
getInstance
public static SeparableConvolutionParamInitializer getInstance()
-
numParams
public long numParams(NeuralNetConfiguration conf)
- Specified by:
numParams
in interfaceParamInitializer
-
numParams
public long numParams(Layer l)
- Specified by:
numParams
in interfaceParamInitializer
-
paramKeys
public List<String> paramKeys(Layer layer)
Description copied from interface:ParamInitializer
Get a list of all parameter keys given the layer configuration- Specified by:
paramKeys
in interfaceParamInitializer
- Parameters:
layer
- Layer- Returns:
- All parameter keys
-
weightKeys
public List<String> weightKeys(Layer layer)
Description copied from interface:ParamInitializer
Weight parameter keys given the layer configuration- Specified by:
weightKeys
in interfaceParamInitializer
- Parameters:
layer
- Layer- Returns:
- Weight parameter keys
-
biasKeys
public List<String> biasKeys(Layer layer)
Description copied from interface:ParamInitializer
Bias parameter keys given the layer configuration- Specified by:
biasKeys
in interfaceParamInitializer
- Parameters:
layer
- Layer- Returns:
- Bias parameter keys
-
isWeightParam
public boolean isWeightParam(Layer layer, String key)
Description copied from interface:ParamInitializer
Is the specified parameter a weight?- Specified by:
isWeightParam
in interfaceParamInitializer
- Parameters:
layer
- Layerkey
- Key to check- Returns:
- True if parameter is a weight
-
isBiasParam
public boolean isBiasParam(Layer layer, String key)
Description copied from interface:ParamInitializer
Is the specified parameter a bias?- Specified by:
isBiasParam
in interfaceParamInitializer
- Parameters:
layer
- Layerkey
- Key to check- Returns:
- True if parameter is a bias
-
init
public Map<String,INDArray> init(NeuralNetConfiguration conf, INDArray paramsView, boolean initializeParams)
Description copied from interface:ParamInitializer
Initialize the parameters- Specified by:
init
in interfaceParamInitializer
- 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
public Map<String,INDArray> getGradientsFromFlattened(NeuralNetConfiguration conf, INDArray gradientView)
Description copied from interface:ParamInitializer
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- Specified by:
getGradientsFromFlattened
in interfaceParamInitializer
- 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
-
createBias
protected INDArray createBias(NeuralNetConfiguration conf, INDArray biasView, boolean initializeParams)
-
createDepthWiseWeightMatrix
protected INDArray createDepthWiseWeightMatrix(NeuralNetConfiguration conf, INDArray weightView, boolean initializeParams)
-
createPointWiseWeightMatrix
protected INDArray createPointWiseWeightMatrix(NeuralNetConfiguration conf, INDArray weightView, boolean initializeParams)
-
-