public class KerasBatchNormalization extends KerasLayer
KerasLayer.DimOrder
Modifier and Type | Field and Description |
---|---|
static int |
LAYER_BATCHNORM_MODE_1 |
static int |
LAYER_BATCHNORM_MODE_2 |
static java.lang.String |
LAYER_FIELD_AXIS |
static java.lang.String |
LAYER_FIELD_BETA_REGULARIZER |
static java.lang.String |
LAYER_FIELD_EPSILON |
static java.lang.String |
LAYER_FIELD_GAMMA_REGULARIZER |
static java.lang.String |
LAYER_FIELD_MODE |
static java.lang.String |
LAYER_FIELD_MOMENTUM |
static int |
NUM_TRAINABLE_PARAMS |
static java.lang.String |
PARAM_NAME_BETA |
static java.lang.String |
PARAM_NAME_GAMMA |
static java.lang.String |
PARAM_NAME_RUNNING_MEAN |
static java.lang.String |
PARAM_NAME_RUNNING_STD |
className, DIM_ORDERING_TENSORFLOW, DIM_ORDERING_THEANO, dimOrder, dropout, inboundLayerNames, INIT_GLOROT_NORMAL, INIT_GLOROT_UNIFORM, INIT_HE_NORMAL, INIT_HE_UNIFORM, INIT_IDENTITY, INIT_LECUN_UNIFORM, INIT_NORMAL, INIT_ORTHOGONAL, INIT_UNIFORM, INIT_ZERO, inputShape, KERAS_ACTIVATION_HARD_SIGMOID, KERAS_ACTIVATION_LINEAR, KERAS_ACTIVATION_RELU, KERAS_ACTIVATION_SIGMOID, KERAS_ACTIVATION_SOFTMAX, KERAS_ACTIVATION_SOFTPLUS, KERAS_ACTIVATION_SOFTSIGN, KERAS_ACTIVATION_TANH, KERAS_LOSS_BINARY_CROSSENTROPY, KERAS_LOSS_CATEGORICAL_CROSSENTROPY, KERAS_LOSS_COSINE_PROXIMITY, KERAS_LOSS_HINGE, KERAS_LOSS_KLD, KERAS_LOSS_KULLBACK_LEIBLER_DIVERGENCE, KERAS_LOSS_MAE, KERAS_LOSS_MAPE, KERAS_LOSS_MEAN_ABSOLUTE_ERROR, KERAS_LOSS_MEAN_ABSOLUTE_PERCENTAGE_ERROR, KERAS_LOSS_MEAN_SQUARED_ERROR, KERAS_LOSS_MEAN_SQUARED_LOGARITHMIC_ERROR, KERAS_LOSS_MSE, KERAS_LOSS_MSLE, KERAS_LOSS_POISSON, KERAS_LOSS_SPARSE_CATEGORICAL_CROSSENTROPY, KERAS_LOSS_SQUARED_HINGE, layer, LAYER_BORDER_MODE_FULL, LAYER_BORDER_MODE_SAME, LAYER_BORDER_MODE_VALID, LAYER_CLASS_NAME_ACTIVATION, LAYER_CLASS_NAME_AVERAGE_POOLING_1D, LAYER_CLASS_NAME_AVERAGE_POOLING_2D, LAYER_CLASS_NAME_BATCHNORMALIZATION, LAYER_CLASS_NAME_CONVOLUTION_1D, LAYER_CLASS_NAME_CONVOLUTION_2D, LAYER_CLASS_NAME_DENSE, LAYER_CLASS_NAME_DROPOUT, LAYER_CLASS_NAME_EMBEDDING, LAYER_CLASS_NAME_FLATTEN, LAYER_CLASS_NAME_GLOBAL_AVERAGE_POOLING_1D, LAYER_CLASS_NAME_GLOBAL_AVERAGE_POOLING_2D, LAYER_CLASS_NAME_GLOBAL_MAX_POOLING_1D, LAYER_CLASS_NAME_GLOBAL_MAX_POOLING_2D, LAYER_CLASS_NAME_INPUT, LAYER_CLASS_NAME_LSTM, LAYER_CLASS_NAME_MAX_POOLING_1D, LAYER_CLASS_NAME_MAX_POOLING_2D, LAYER_CLASS_NAME_MERGE, LAYER_CLASS_NAME_TIME_DISTRIBUTED, LAYER_CLASS_NAME_TIME_DISTRIBUTED_DENSE, LAYER_CLASS_NAME_ZERO_PADDING_1D, LAYER_CLASS_NAME_ZERO_PADDING_2D, LAYER_FIELD_ACTIVATION, LAYER_FIELD_B_REGULARIZER, LAYER_FIELD_BATCH_INPUT_SHAPE, LAYER_FIELD_BORDER_MODE, LAYER_FIELD_CLASS_NAME, LAYER_FIELD_CONFIG, LAYER_FIELD_DIM_ORDERING, LAYER_FIELD_DROPOUT, LAYER_FIELD_DROPOUT_W, LAYER_FIELD_INBOUND_NODES, LAYER_FIELD_INIT, LAYER_FIELD_LAYER, LAYER_FIELD_NAME, LAYER_FIELD_NB_COL, LAYER_FIELD_NB_FILTER, LAYER_FIELD_NB_ROW, LAYER_FIELD_OUTPUT_DIM, LAYER_FIELD_POOL_SIZE, LAYER_FIELD_STRIDES, LAYER_FIELD_SUBSAMPLE, LAYER_FIELD_W_REGULARIZER, layerName, REGULARIZATION_TYPE_L1, REGULARIZATION_TYPE_L2, vertex, weightL1Regularization, weightL2Regularization, weights
Constructor and Description |
---|
KerasBatchNormalization(java.util.Map<java.lang.String,java.lang.Object> layerConfig)
Constructor from parsed Keras layer configuration dictionary.
|
KerasBatchNormalization(java.util.Map<java.lang.String,java.lang.Object> layerConfig,
boolean enforceTrainingConfig)
Constructor from parsed Keras layer configuration dictionary.
|
Modifier and Type | Method and Description |
---|---|
BatchNormalization |
getBatchNormalizationLayer()
Get DL4J BatchNormalizationLayer.
|
protected int |
getBatchNormAxis(java.util.Map<java.lang.String,java.lang.Object> layerConfig,
boolean enforceTrainingConfig)
Get BatchNormalization axis from Keras layer configuration.
|
protected int |
getBatchNormMode(java.util.Map<java.lang.String,java.lang.Object> layerConfig,
boolean enforceTrainingConfig)
Get BatchNormalization "mode" from Keras layer configuration.
|
protected void |
getBetaRegularizerFromConfig(java.util.Map<java.lang.String,java.lang.Object> layerConfig,
boolean enforceTrainingConfig)
Get BatchNormalization beta regularizer from Keras layer configuration.
|
protected double |
getEpsFromConfig(java.util.Map<java.lang.String,java.lang.Object> layerConfig)
Get BatchNormalization epsilon parameter from Keras layer configuration.
|
protected void |
getGammaRegularizerFromConfig(java.util.Map<java.lang.String,java.lang.Object> layerConfig,
boolean enforceTrainingConfig)
Get BatchNormalization gamma regularizer from Keras layer configuration.
|
protected double |
getMomentumFromConfig(java.util.Map<java.lang.String,java.lang.Object> layerConfig)
Get BatchNormalization momentum parameter from Keras layer configuration.
|
int |
getNumParams()
Returns number of trainable parameters in layer.
|
InputType |
getOutputType(InputType... inputType)
Get layer output type.
|
void |
setWeights(java.util.Map<java.lang.String,org.nd4j.linalg.api.ndarray.INDArray> weights)
Set weights for layer.
|
checkForUnsupportedConfigurations, copyWeightsToLayer, getActivationFromConfig, getBiasL1RegularizationFromConfig, getClassName, getClassNameFromConfig, getConvolutionModeFromConfig, getDimOrder, getDropoutFromConfig, getInboundLayerNames, getInboundLayerNamesFromConfig, getInnerLayerConfigFromConfig, getInputPreprocessor, getInputShape, getKerasLayerFromConfig, getKerasLayerFromConfig, getKernelSizeFromConfig, getLayer, getLayerName, getLayerNameFromConfig, getNOutFromConfig, getPaddingFromBorderModeConfig, getStrideFromConfig, getTimeDistributedLayerConfig, getVertex, getWeightInitFromConfig, getWeightL1RegularizationFromConfig, getWeightL2RegularizationFromConfig, isInputPreProcessor, isLayer, isValidInboundLayer, isVertex, mapActivation, mapLossFunction, mapPoolingDimensions, mapPoolingType, mapWeightInitialization, setDimOrder, setInboundLayerNames, usesRegularization
public static final int LAYER_BATCHNORM_MODE_1
public static final int LAYER_BATCHNORM_MODE_2
public static final java.lang.String LAYER_FIELD_GAMMA_REGULARIZER
public static final java.lang.String LAYER_FIELD_BETA_REGULARIZER
public static final java.lang.String LAYER_FIELD_MODE
public static final java.lang.String LAYER_FIELD_AXIS
public static final java.lang.String LAYER_FIELD_MOMENTUM
public static final java.lang.String LAYER_FIELD_EPSILON
public static final int NUM_TRAINABLE_PARAMS
public static final java.lang.String PARAM_NAME_GAMMA
public static final java.lang.String PARAM_NAME_BETA
public static final java.lang.String PARAM_NAME_RUNNING_MEAN
public static final java.lang.String PARAM_NAME_RUNNING_STD
public KerasBatchNormalization(java.util.Map<java.lang.String,java.lang.Object> layerConfig) throws InvalidKerasConfigurationException, UnsupportedKerasConfigurationException
layerConfig
- dictionary containing Keras layer configurationInvalidKerasConfigurationException
UnsupportedKerasConfigurationException
public KerasBatchNormalization(java.util.Map<java.lang.String,java.lang.Object> layerConfig, boolean enforceTrainingConfig) throws InvalidKerasConfigurationException, UnsupportedKerasConfigurationException
layerConfig
- dictionary containing Keras layer configurationenforceTrainingConfig
- whether to enforce training-related configuration optionsInvalidKerasConfigurationException
UnsupportedKerasConfigurationException
public BatchNormalization getBatchNormalizationLayer()
public InputType getOutputType(InputType... inputType) throws InvalidKerasConfigurationException
getOutputType
in class KerasLayer
inputType
- Array of InputTypesInvalidKerasConfigurationException
public int getNumParams()
getNumParams
in class KerasLayer
public void setWeights(java.util.Map<java.lang.String,org.nd4j.linalg.api.ndarray.INDArray> weights) throws InvalidKerasConfigurationException
setWeights
in class KerasLayer
weights
- Map from parameter name to INDArray.InvalidKerasConfigurationException
protected double getEpsFromConfig(java.util.Map<java.lang.String,java.lang.Object> layerConfig) throws InvalidKerasConfigurationException
layerConfig
- dictionary containing Keras layer configurationInvalidKerasConfigurationException
protected double getMomentumFromConfig(java.util.Map<java.lang.String,java.lang.Object> layerConfig) throws InvalidKerasConfigurationException
layerConfig
- dictionary containing Keras layer configurationInvalidKerasConfigurationException
protected void getGammaRegularizerFromConfig(java.util.Map<java.lang.String,java.lang.Object> layerConfig, boolean enforceTrainingConfig) throws UnsupportedKerasConfigurationException, InvalidKerasConfigurationException
layerConfig
- dictionary containing Keras layer configurationInvalidKerasConfigurationException
UnsupportedKerasConfigurationException
protected void getBetaRegularizerFromConfig(java.util.Map<java.lang.String,java.lang.Object> layerConfig, boolean enforceTrainingConfig) throws UnsupportedKerasConfigurationException, InvalidKerasConfigurationException
layerConfig
- dictionary containing Keras layer configurationInvalidKerasConfigurationException
UnsupportedKerasConfigurationException
protected int getBatchNormMode(java.util.Map<java.lang.String,java.lang.Object> layerConfig, boolean enforceTrainingConfig) throws InvalidKerasConfigurationException, UnsupportedKerasConfigurationException
layerConfig
- dictionary containing Keras layer configurationInvalidKerasConfigurationException
UnsupportedKerasConfigurationException
protected int getBatchNormAxis(java.util.Map<java.lang.String,java.lang.Object> layerConfig, boolean enforceTrainingConfig) throws InvalidKerasConfigurationException
layerConfig
- dictionary containing Keras layer configurationInvalidKerasConfigurationException