public class LSTMParamInitializer extends java.lang.Object implements ParamInitializer
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
BIAS_KEY |
static java.lang.String |
INPUT_WEIGHT_KEY |
static java.lang.String |
RECURRENT_WEIGHT_KEY
Weights for previous time step -> current time step connections
|
Constructor and Description |
---|
LSTMParamInitializer() |
Modifier and Type | Method and Description |
---|---|
java.util.List<java.lang.String> |
biasKeys(Layer layer)
Bias parameter keys given the layer configuration
|
java.util.Map<java.lang.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 LSTMParamInitializer |
getInstance() |
java.util.Map<java.lang.String,INDArray> |
init(NeuralNetConfiguration conf,
INDArray paramsView,
boolean initializeParams)
Initialize the parameters
|
boolean |
isBiasParam(Layer layer,
java.lang.String key)
Is the specified parameter a bias?
|
boolean |
isWeightParam(Layer layer,
java.lang.String key)
Is the specified parameter a weight?
|
long |
numParams(Layer l) |
long |
numParams(NeuralNetConfiguration conf) |
java.util.List<java.lang.String> |
paramKeys(Layer layer)
Get a list of all parameter keys given the layer configuration
|
java.util.List<java.lang.String> |
weightKeys(Layer layer)
Weight parameter keys given the layer configuration
|
public static final java.lang.String RECURRENT_WEIGHT_KEY
public static final java.lang.String BIAS_KEY
public static final java.lang.String INPUT_WEIGHT_KEY
public static LSTMParamInitializer getInstance()
public long numParams(NeuralNetConfiguration conf)
numParams
in interface ParamInitializer
public long numParams(Layer l)
numParams
in interface ParamInitializer
public java.util.List<java.lang.String> paramKeys(Layer layer)
ParamInitializer
paramKeys
in interface ParamInitializer
layer
- Layerpublic java.util.List<java.lang.String> weightKeys(Layer layer)
ParamInitializer
weightKeys
in interface ParamInitializer
layer
- Layerpublic java.util.List<java.lang.String> biasKeys(Layer layer)
ParamInitializer
biasKeys
in interface ParamInitializer
layer
- Layerpublic boolean isWeightParam(Layer layer, java.lang.String key)
ParamInitializer
isWeightParam
in interface ParamInitializer
layer
- Layerkey
- Key to checkpublic boolean isBiasParam(Layer layer, java.lang.String key)
ParamInitializer
isBiasParam
in interface ParamInitializer
layer
- Layerkey
- Key to checkpublic java.util.Map<java.lang.String,INDArray> init(NeuralNetConfiguration conf, INDArray paramsView, boolean initializeParams)
ParamInitializer
init
in interface ParamInitializer
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 java.util.Map<java.lang.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 ParamInitializer
conf
- ConfigurationgradientView
- The flattened gradients array, as a view of the larger array