public class VariationalAutoencoderParamInitializer extends DefaultParamInitializer
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
BIAS_KEY_SUFFIX |
static java.lang.String |
PXZ_B
Key for bias parameters connecting the last decoder layer and p(data|z) (according to whatever
ReconstructionDistribution is set for the VAE) |
static java.lang.String |
PXZ_PREFIX |
static java.lang.String |
PXZ_W
Key for weight parameters connecting the last decoder layer and p(data|z) (according to whatever
ReconstructionDistribution is set for the VAE) |
static java.lang.String |
PZX_LOGSTD2_B
Key for bias parameters for log(sigma^2) in p(z|data)
|
static java.lang.String |
PZX_LOGSTD2_PREFIX |
static java.lang.String |
PZX_LOGSTD2_W
Key for weight parameters connecting the last encoder layer and the log(sigma^2) values for p(z|data)
|
static java.lang.String |
PZX_MEAN_B
Key for bias parameters for the mean values for p(z|data)
|
static java.lang.String |
PZX_MEAN_PREFIX |
static java.lang.String |
PZX_MEAN_W
Key for weight parameters connecting the last encoder layer and the mean values for p(z|data)
|
static java.lang.String |
PZX_PREFIX |
static java.lang.String |
WEIGHT_KEY_SUFFIX |
BIAS_KEY, WEIGHT_KEY
Constructor and Description |
---|
VariationalAutoencoderParamInitializer() |
Modifier and Type | Method and Description |
---|---|
java.util.Map<java.lang.String,org.nd4j.linalg.api.ndarray.INDArray> |
getGradientsFromFlattened(NeuralNetConfiguration conf,
org.nd4j.linalg.api.ndarray.INDArray gradientView)
Return a map of gradients (in their standard non-flattened representation), taken from the flattened (row vector) gradientView array.
|
static VariationalAutoencoderParamInitializer |
getInstance() |
java.util.Map<java.lang.String,org.nd4j.linalg.api.ndarray.INDArray> |
init(NeuralNetConfiguration conf,
org.nd4j.linalg.api.ndarray.INDArray paramsView,
boolean initializeParams)
Initialize the parameters
|
int |
numParams(NeuralNetConfiguration conf) |
createBias, createBias, createWeightMatrix, createWeightMatrix
public static final java.lang.String WEIGHT_KEY_SUFFIX
public static final java.lang.String BIAS_KEY_SUFFIX
public static final java.lang.String PZX_PREFIX
public static final java.lang.String PZX_MEAN_PREFIX
public static final java.lang.String PZX_LOGSTD2_PREFIX
public static final java.lang.String PZX_MEAN_W
public static final java.lang.String PZX_MEAN_B
public static final java.lang.String PZX_LOGSTD2_W
public static final java.lang.String PZX_LOGSTD2_B
public static final java.lang.String PXZ_PREFIX
public static final java.lang.String PXZ_W
ReconstructionDistribution
is set for the VAE)public static final java.lang.String PXZ_B
ReconstructionDistribution
is set for the VAE)public VariationalAutoencoderParamInitializer()
public static VariationalAutoencoderParamInitializer getInstance()
public int numParams(NeuralNetConfiguration conf)
numParams
in interface ParamInitializer
numParams
in class DefaultParamInitializer
public java.util.Map<java.lang.String,org.nd4j.linalg.api.ndarray.INDArray> init(NeuralNetConfiguration conf, org.nd4j.linalg.api.ndarray.INDArray paramsView, boolean initializeParams)
ParamInitializer
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 java.util.Map<java.lang.String,org.nd4j.linalg.api.ndarray.INDArray> getGradientsFromFlattened(NeuralNetConfiguration conf, org.nd4j.linalg.api.ndarray.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
getGradientsFromFlattened
in class DefaultParamInitializer
conf
- ConfigurationgradientView
- The flattened gradients array, as a view of the larger array