public class KerasLayer
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
KerasLayer.DimOrder |
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
className |
static java.lang.String |
DIM_ORDERING_TENSORFLOW |
static java.lang.String |
DIM_ORDERING_THEANO |
protected KerasLayer.DimOrder |
dimOrder |
protected double |
dropout |
protected java.util.List<java.lang.String> |
inboundLayerNames |
static java.lang.String |
INIT_GLOROT_NORMAL |
static java.lang.String |
INIT_GLOROT_UNIFORM |
static java.lang.String |
INIT_HE_NORMAL |
static java.lang.String |
INIT_HE_UNIFORM |
static java.lang.String |
INIT_IDENTITY |
static java.lang.String |
INIT_LECUN_UNIFORM |
static java.lang.String |
INIT_NORMAL |
static java.lang.String |
INIT_ORTHOGONAL |
static java.lang.String |
INIT_UNIFORM |
static java.lang.String |
INIT_ZERO |
protected int[] |
inputShape |
static java.lang.String |
KERAS_ACTIVATION_HARD_SIGMOID |
static java.lang.String |
KERAS_ACTIVATION_LINEAR |
static java.lang.String |
KERAS_ACTIVATION_RELU |
static java.lang.String |
KERAS_ACTIVATION_SIGMOID |
static java.lang.String |
KERAS_ACTIVATION_SOFTMAX |
static java.lang.String |
KERAS_ACTIVATION_SOFTPLUS |
static java.lang.String |
KERAS_ACTIVATION_SOFTSIGN |
static java.lang.String |
KERAS_ACTIVATION_TANH |
static java.lang.String |
KERAS_LOSS_BINARY_CROSSENTROPY |
static java.lang.String |
KERAS_LOSS_CATEGORICAL_CROSSENTROPY |
static java.lang.String |
KERAS_LOSS_COSINE_PROXIMITY |
static java.lang.String |
KERAS_LOSS_HINGE |
static java.lang.String |
KERAS_LOSS_KLD |
static java.lang.String |
KERAS_LOSS_KULLBACK_LEIBLER_DIVERGENCE |
static java.lang.String |
KERAS_LOSS_MAE |
static java.lang.String |
KERAS_LOSS_MAPE |
static java.lang.String |
KERAS_LOSS_MEAN_ABSOLUTE_ERROR |
static java.lang.String |
KERAS_LOSS_MEAN_ABSOLUTE_PERCENTAGE_ERROR |
static java.lang.String |
KERAS_LOSS_MEAN_SQUARED_ERROR |
static java.lang.String |
KERAS_LOSS_MEAN_SQUARED_LOGARITHMIC_ERROR |
static java.lang.String |
KERAS_LOSS_MSE |
static java.lang.String |
KERAS_LOSS_MSLE |
static java.lang.String |
KERAS_LOSS_POISSON |
static java.lang.String |
KERAS_LOSS_SPARSE_CATEGORICAL_CROSSENTROPY |
static java.lang.String |
KERAS_LOSS_SQUARED_HINGE |
protected Layer |
layer |
static java.lang.String |
LAYER_BORDER_MODE_FULL |
static java.lang.String |
LAYER_BORDER_MODE_SAME |
static java.lang.String |
LAYER_BORDER_MODE_VALID |
static java.lang.String |
LAYER_CLASS_NAME_ACTIVATION |
static java.lang.String |
LAYER_CLASS_NAME_AVERAGE_POOLING_1D |
static java.lang.String |
LAYER_CLASS_NAME_AVERAGE_POOLING_2D |
static java.lang.String |
LAYER_CLASS_NAME_BATCHNORMALIZATION |
static java.lang.String |
LAYER_CLASS_NAME_CONVOLUTION_1D |
static java.lang.String |
LAYER_CLASS_NAME_CONVOLUTION_2D |
static java.lang.String |
LAYER_CLASS_NAME_DENSE |
static java.lang.String |
LAYER_CLASS_NAME_DROPOUT |
static java.lang.String |
LAYER_CLASS_NAME_EMBEDDING |
static java.lang.String |
LAYER_CLASS_NAME_FLATTEN |
static java.lang.String |
LAYER_CLASS_NAME_GLOBAL_AVERAGE_POOLING_1D |
static java.lang.String |
LAYER_CLASS_NAME_GLOBAL_AVERAGE_POOLING_2D |
static java.lang.String |
LAYER_CLASS_NAME_GLOBAL_MAX_POOLING_1D |
static java.lang.String |
LAYER_CLASS_NAME_GLOBAL_MAX_POOLING_2D |
static java.lang.String |
LAYER_CLASS_NAME_INPUT |
static java.lang.String |
LAYER_CLASS_NAME_LSTM |
static java.lang.String |
LAYER_CLASS_NAME_MAX_POOLING_1D |
static java.lang.String |
LAYER_CLASS_NAME_MAX_POOLING_2D |
static java.lang.String |
LAYER_CLASS_NAME_MERGE |
static java.lang.String |
LAYER_CLASS_NAME_TIME_DISTRIBUTED |
static java.lang.String |
LAYER_CLASS_NAME_TIME_DISTRIBUTED_DENSE |
static java.lang.String |
LAYER_CLASS_NAME_ZERO_PADDING_1D |
static java.lang.String |
LAYER_CLASS_NAME_ZERO_PADDING_2D |
static java.lang.String |
LAYER_FIELD_ACTIVATION |
static java.lang.String |
LAYER_FIELD_B_REGULARIZER |
static java.lang.String |
LAYER_FIELD_BATCH_INPUT_SHAPE |
static java.lang.String |
LAYER_FIELD_BORDER_MODE |
static java.lang.String |
LAYER_FIELD_CLASS_NAME |
static java.lang.String |
LAYER_FIELD_CONFIG |
static java.lang.String |
LAYER_FIELD_DIM_ORDERING |
static java.lang.String |
LAYER_FIELD_DROPOUT |
static java.lang.String |
LAYER_FIELD_DROPOUT_W |
static java.lang.String |
LAYER_FIELD_INBOUND_NODES |
static java.lang.String |
LAYER_FIELD_INIT |
static java.lang.String |
LAYER_FIELD_LAYER |
static java.lang.String |
LAYER_FIELD_NAME |
static java.lang.String |
LAYER_FIELD_NB_COL |
static java.lang.String |
LAYER_FIELD_NB_FILTER |
static java.lang.String |
LAYER_FIELD_NB_ROW |
static java.lang.String |
LAYER_FIELD_OUTPUT_DIM |
static java.lang.String |
LAYER_FIELD_POOL_SIZE |
static java.lang.String |
LAYER_FIELD_STRIDES |
static java.lang.String |
LAYER_FIELD_SUBSAMPLE |
static java.lang.String |
LAYER_FIELD_W_REGULARIZER |
protected java.lang.String |
layerName |
static java.lang.String |
REGULARIZATION_TYPE_L1 |
static java.lang.String |
REGULARIZATION_TYPE_L2 |
protected GraphVertex |
vertex |
protected double |
weightL1Regularization |
protected double |
weightL2Regularization |
protected java.util.Map<java.lang.String,org.nd4j.linalg.api.ndarray.INDArray> |
weights |
Modifier | Constructor and Description |
---|---|
protected |
KerasLayer() |
protected |
KerasLayer(java.util.Map<java.lang.String,java.lang.Object> layerConfig)
Constructor.
|
protected |
KerasLayer(java.util.Map<java.lang.String,java.lang.Object> layerConfig,
boolean enforceTrainingConfig)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
static void |
checkForUnsupportedConfigurations(java.util.Map<java.lang.String,java.lang.Object> layerConfig,
boolean enforceTrainingConfig)
Checks whether layer config contains unsupported options.
|
void |
copyWeightsToLayer(Layer layer)
Copy Keras layer weights to DL4J Layer.
|
protected org.nd4j.linalg.activations.IActivation |
getActivationFromConfig(java.util.Map<java.lang.String,java.lang.Object> layerConfig)
Get activation function from Keras layer configuration.
|
static double |
getBiasL1RegularizationFromConfig(java.util.Map<java.lang.String,java.lang.Object> layerConfig,
boolean willBeTrained)
Get L1 bias regularization (if any) from Keras bias regularization configuration.
|
java.lang.String |
getClassName()
Get Keras layer class name.
|
static java.lang.String |
getClassNameFromConfig(java.util.Map<java.lang.String,java.lang.Object> layerConfig)
Get Keras layer class name from Keras layer configuration.
|
static ConvolutionMode |
getConvolutionModeFromConfig(java.util.Map<java.lang.String,java.lang.Object> layerConfig)
Get convolution border mode from Keras layer configuration.
|
KerasLayer.DimOrder |
getDimOrder()
Get Keras layer backend dimension order.
|
protected double |
getDropoutFromConfig(java.util.Map<java.lang.String,java.lang.Object> layerConfig)
Get dropout from Keras layer configuration.
|
java.util.List<java.lang.String> |
getInboundLayerNames()
Get list of inbound layers.
|
static java.util.List<java.lang.String> |
getInboundLayerNamesFromConfig(java.util.Map<java.lang.String,java.lang.Object> layerConfig)
Get list of inbound layers from Keras layer configuration.
|
static java.util.Map<java.lang.String,java.lang.Object> |
getInnerLayerConfigFromConfig(java.util.Map<java.lang.String,java.lang.Object> layerConfig)
Get inner layer config from Keras layer configuration.
|
InputPreProcessor |
getInputPreprocessor(InputType... inputType)
Gets appropriate DL4J InputPreProcessor for given InputTypes.
|
int[] |
getInputShape()
Get layer input shape.
|
static KerasLayer |
getKerasLayerFromConfig(java.util.Map<java.lang.String,java.lang.Object> layerConfig)
Build KerasLayer from a Keras layer configuration.
|
static KerasLayer |
getKerasLayerFromConfig(java.util.Map<java.lang.String,java.lang.Object> layerConfig,
boolean enforceTrainingConfig)
Build KerasLayer from a Keras layer configuration.
|
static int[] |
getKernelSizeFromConfig(java.util.Map<java.lang.String,java.lang.Object> layerConfig)
Get (convolution) kernel size from Keras layer configuration.
|
Layer |
getLayer()
Gets corresponding DL4J Layer, if any.
|
java.lang.String |
getLayerName()
Get Keras layer name.
|
protected java.lang.String |
getLayerNameFromConfig(java.util.Map<java.lang.String,java.lang.Object> layerConfig)
Get layer name from Keras layer configuration.
|
static int |
getNOutFromConfig(java.util.Map<java.lang.String,java.lang.Object> layerConfig)
Get number of outputs from Keras layer configuration.
|
int |
getNumParams()
Returns number of trainable parameters in layer.
|
InputType |
getOutputType(InputType... inputType)
Get layer output type.
|
int[] |
getPaddingFromBorderModeConfig(java.util.Map<java.lang.String,java.lang.Object> layerConfig)
Get (convolution) padding from Keras layer configuration.
|
static int[] |
getStrideFromConfig(java.util.Map<java.lang.String,java.lang.Object> layerConfig)
Get (convolution) stride from Keras layer configuration.
|
static java.util.Map<java.lang.String,java.lang.Object> |
getTimeDistributedLayerConfig(java.util.Map<java.lang.String,java.lang.Object> layerConfig)
Extract inner layer config from TimeDistributed configuration and merge
it into the outer config.
|
GraphVertex |
getVertex()
Gets corresponding DL4J Vertex, if any.
|
protected WeightInit |
getWeightInitFromConfig(java.util.Map<java.lang.String,java.lang.Object> layerConfig,
boolean enforceTrainingConfig)
Get weight initialization from Keras layer configuration.
|
static double |
getWeightL1RegularizationFromConfig(java.util.Map<java.lang.String,java.lang.Object> layerConfig,
boolean willBeTrained)
Get L1 weight regularization (if any) from Keras weight regularization configuration.
|
static double |
getWeightL2RegularizationFromConfig(java.util.Map<java.lang.String,java.lang.Object> layerConfig,
boolean willBeTrained)
Get L2 weight regularization (if any) from Keras weight regularization configuration.
|
boolean |
isInputPreProcessor()
Whether this Keras layer maps to a DL4J InputPreProcessor.
|
boolean |
isLayer()
Whether this Keras layer maps to a DL4J Layer.
|
boolean |
isValidInboundLayer()
Indicates whether this layer a valid inbound layer.
|
boolean |
isVertex()
Whether this Keras layer maps to a DL4J Vertex.
|
static org.nd4j.linalg.activations.IActivation |
mapActivation(java.lang.String kerasActivation)
Map Keras to DL4J activation functions.
|
static org.nd4j.linalg.lossfunctions.LossFunctions.LossFunction |
mapLossFunction(java.lang.String kerasLoss)
Map Keras to DL4J loss functions.
|
static int[] |
mapPoolingDimensions(java.lang.String className)
Map Keras pooling layers to DL4J pooling dimensions.
|
static PoolingType |
mapPoolingType(java.lang.String className)
Map Keras pooling layers to DL4J pooling types.
|
static WeightInit |
mapWeightInitialization(java.lang.String kerasInit)
Map Keras to DL4J weight initialization functions.
|
void |
setDimOrder(KerasLayer.DimOrder dimOrder)
Set Keras layer backend dimension order.
|
void |
setInboundLayerNames(java.util.List<java.lang.String> inboundLayerNames)
Set list of inbound layers.
|
void |
setWeights(java.util.Map<java.lang.String,org.nd4j.linalg.api.ndarray.INDArray> weights)
Set weights for Keras layer.
|
boolean |
usesRegularization()
Indicates whether layer uses regularization.
|
public static final java.lang.String LAYER_FIELD_CLASS_NAME
public static final java.lang.String LAYER_CLASS_NAME_ACTIVATION
public static final java.lang.String LAYER_CLASS_NAME_INPUT
public static final java.lang.String LAYER_CLASS_NAME_DROPOUT
public static final java.lang.String LAYER_CLASS_NAME_DENSE
public static final java.lang.String LAYER_CLASS_NAME_TIME_DISTRIBUTED_DENSE
public static final java.lang.String LAYER_CLASS_NAME_LSTM
public static final java.lang.String LAYER_CLASS_NAME_CONVOLUTION_1D
public static final java.lang.String LAYER_CLASS_NAME_CONVOLUTION_2D
public static final java.lang.String LAYER_CLASS_NAME_MAX_POOLING_1D
public static final java.lang.String LAYER_CLASS_NAME_MAX_POOLING_2D
public static final java.lang.String LAYER_CLASS_NAME_AVERAGE_POOLING_1D
public static final java.lang.String LAYER_CLASS_NAME_AVERAGE_POOLING_2D
public static final java.lang.String LAYER_CLASS_NAME_ZERO_PADDING_1D
public static final java.lang.String LAYER_CLASS_NAME_ZERO_PADDING_2D
public static final java.lang.String LAYER_CLASS_NAME_FLATTEN
public static final java.lang.String LAYER_CLASS_NAME_MERGE
public static final java.lang.String LAYER_CLASS_NAME_BATCHNORMALIZATION
public static final java.lang.String LAYER_CLASS_NAME_TIME_DISTRIBUTED
public static final java.lang.String LAYER_CLASS_NAME_EMBEDDING
public static final java.lang.String LAYER_CLASS_NAME_GLOBAL_MAX_POOLING_1D
public static final java.lang.String LAYER_CLASS_NAME_GLOBAL_MAX_POOLING_2D
public static final java.lang.String LAYER_CLASS_NAME_GLOBAL_AVERAGE_POOLING_1D
public static final java.lang.String LAYER_CLASS_NAME_GLOBAL_AVERAGE_POOLING_2D
public static final java.lang.String LAYER_FIELD_CONFIG
public static final java.lang.String LAYER_FIELD_NAME
public static final java.lang.String LAYER_FIELD_BATCH_INPUT_SHAPE
public static final java.lang.String LAYER_FIELD_INBOUND_NODES
public static final java.lang.String LAYER_FIELD_DROPOUT
public static final java.lang.String LAYER_FIELD_DROPOUT_W
public static final java.lang.String LAYER_FIELD_OUTPUT_DIM
public static final java.lang.String LAYER_FIELD_NB_FILTER
public static final java.lang.String LAYER_FIELD_NB_ROW
public static final java.lang.String LAYER_FIELD_NB_COL
public static final java.lang.String LAYER_FIELD_POOL_SIZE
public static final java.lang.String LAYER_FIELD_SUBSAMPLE
public static final java.lang.String LAYER_FIELD_STRIDES
public static final java.lang.String LAYER_FIELD_BORDER_MODE
public static final java.lang.String LAYER_BORDER_MODE_SAME
public static final java.lang.String LAYER_BORDER_MODE_VALID
public static final java.lang.String LAYER_BORDER_MODE_FULL
public static final java.lang.String LAYER_FIELD_W_REGULARIZER
public static final java.lang.String LAYER_FIELD_B_REGULARIZER
public static final java.lang.String REGULARIZATION_TYPE_L1
public static final java.lang.String REGULARIZATION_TYPE_L2
public static final java.lang.String LAYER_FIELD_INIT
public static final java.lang.String INIT_UNIFORM
public static final java.lang.String INIT_ZERO
public static final java.lang.String INIT_GLOROT_NORMAL
public static final java.lang.String INIT_GLOROT_UNIFORM
public static final java.lang.String INIT_HE_NORMAL
public static final java.lang.String INIT_HE_UNIFORM
public static final java.lang.String INIT_LECUN_UNIFORM
public static final java.lang.String INIT_NORMAL
public static final java.lang.String INIT_ORTHOGONAL
public static final java.lang.String INIT_IDENTITY
public static final java.lang.String LAYER_FIELD_ACTIVATION
public static final java.lang.String KERAS_ACTIVATION_SOFTMAX
public static final java.lang.String KERAS_ACTIVATION_SOFTPLUS
public static final java.lang.String KERAS_ACTIVATION_SOFTSIGN
public static final java.lang.String KERAS_ACTIVATION_RELU
public static final java.lang.String KERAS_ACTIVATION_TANH
public static final java.lang.String KERAS_ACTIVATION_SIGMOID
public static final java.lang.String KERAS_ACTIVATION_HARD_SIGMOID
public static final java.lang.String KERAS_ACTIVATION_LINEAR
public static final java.lang.String LAYER_FIELD_DIM_ORDERING
public static final java.lang.String DIM_ORDERING_THEANO
public static final java.lang.String DIM_ORDERING_TENSORFLOW
public static final java.lang.String KERAS_LOSS_MEAN_SQUARED_ERROR
public static final java.lang.String KERAS_LOSS_MSE
public static final java.lang.String KERAS_LOSS_MEAN_ABSOLUTE_ERROR
public static final java.lang.String KERAS_LOSS_MAE
public static final java.lang.String KERAS_LOSS_MEAN_ABSOLUTE_PERCENTAGE_ERROR
public static final java.lang.String KERAS_LOSS_MAPE
public static final java.lang.String KERAS_LOSS_MEAN_SQUARED_LOGARITHMIC_ERROR
public static final java.lang.String KERAS_LOSS_MSLE
public static final java.lang.String KERAS_LOSS_SQUARED_HINGE
public static final java.lang.String KERAS_LOSS_HINGE
public static final java.lang.String KERAS_LOSS_BINARY_CROSSENTROPY
public static final java.lang.String KERAS_LOSS_CATEGORICAL_CROSSENTROPY
public static final java.lang.String KERAS_LOSS_SPARSE_CATEGORICAL_CROSSENTROPY
public static final java.lang.String KERAS_LOSS_KULLBACK_LEIBLER_DIVERGENCE
public static final java.lang.String KERAS_LOSS_KLD
public static final java.lang.String KERAS_LOSS_POISSON
public static final java.lang.String KERAS_LOSS_COSINE_PROXIMITY
public static final java.lang.String LAYER_FIELD_LAYER
protected java.lang.String className
protected java.lang.String layerName
protected int[] inputShape
protected KerasLayer.DimOrder dimOrder
protected java.util.List<java.lang.String> inboundLayerNames
protected Layer layer
protected GraphVertex vertex
protected java.util.Map<java.lang.String,org.nd4j.linalg.api.ndarray.INDArray> weights
protected double weightL1Regularization
protected double weightL2Regularization
protected double dropout
protected KerasLayer()
protected KerasLayer(java.util.Map<java.lang.String,java.lang.Object> layerConfig) throws InvalidKerasConfigurationException, UnsupportedKerasConfigurationException
layerConfig
- dictionary containing Keras layer configurationInvalidKerasConfigurationException
UnsupportedKerasConfigurationException
protected KerasLayer(java.util.Map<java.lang.String,java.lang.Object> layerConfig, boolean enforceTrainingConfig) throws InvalidKerasConfigurationException, UnsupportedKerasConfigurationException
layerConfig
- dictionary containing Keras layer configurationenforceTrainingConfig
- whether layer should be built for training (controls certain exceptions)InvalidKerasConfigurationException
UnsupportedKerasConfigurationException
public static KerasLayer getKerasLayerFromConfig(java.util.Map<java.lang.String,java.lang.Object> layerConfig) throws InvalidKerasConfigurationException, UnsupportedKerasConfigurationException
layerConfig
- dictionary containing Keras layer configuration map containing Keras layer propertiesInvalidKerasConfigurationException
UnsupportedKerasConfigurationException
Layer
public static KerasLayer getKerasLayerFromConfig(java.util.Map<java.lang.String,java.lang.Object> layerConfig, boolean enforceTrainingConfig) throws InvalidKerasConfigurationException, UnsupportedKerasConfigurationException
layerConfig
- dictionary containing Keras layer configuration map containing Keras layer propertiesenforceTrainingConfig
- whether to enforce training-only configurationsInvalidKerasConfigurationException
UnsupportedKerasConfigurationException
Layer
public static void checkForUnsupportedConfigurations(java.util.Map<java.lang.String,java.lang.Object> layerConfig, boolean enforceTrainingConfig) throws UnsupportedKerasConfigurationException, InvalidKerasConfigurationException
layerConfig
- dictionary containing Keras layer configurationenforceTrainingConfig
- UnsupportedKerasConfigurationException
InvalidKerasConfigurationException
public java.lang.String getClassName()
public java.lang.String getLayerName()
public int[] getInputShape()
public KerasLayer.DimOrder getDimOrder()
public void setDimOrder(KerasLayer.DimOrder dimOrder)
public java.util.List<java.lang.String> getInboundLayerNames()
public void setInboundLayerNames(java.util.List<java.lang.String> inboundLayerNames)
inboundLayerNames
- list of inbound layer naemspublic int getNumParams()
public boolean usesRegularization()
public void setWeights(java.util.Map<java.lang.String,org.nd4j.linalg.api.ndarray.INDArray> weights) throws InvalidKerasConfigurationException
weights
- InvalidKerasConfigurationException
public void copyWeightsToLayer(Layer layer) throws InvalidKerasConfigurationException
layer
- InvalidKerasConfigurationException
public boolean isLayer()
public Layer getLayer()
Layer
public boolean isVertex()
public GraphVertex getVertex()
GraphVertex
public boolean isInputPreProcessor()
public InputPreProcessor getInputPreprocessor(InputType... inputType) throws InvalidKerasConfigurationException
inputType
- Array of InputTypesInvalidKerasConfigurationException
InputPreProcessor
public InputType getOutputType(InputType... inputType) throws InvalidKerasConfigurationException, UnsupportedKerasConfigurationException
inputType
- Array of InputTypesInvalidKerasConfigurationException
UnsupportedKerasConfigurationException
public boolean isValidInboundLayer() throws InvalidKerasConfigurationException
InvalidKerasConfigurationException
Layer
public static org.nd4j.linalg.activations.IActivation mapActivation(java.lang.String kerasActivation) throws UnsupportedKerasConfigurationException
kerasActivation
- String containing Keras activation function nameUnsupportedKerasConfigurationException
public static WeightInit mapWeightInitialization(java.lang.String kerasInit) throws UnsupportedKerasConfigurationException
kerasInit
- String containing Keras initialization function nameUnsupportedKerasConfigurationException
WeightInit
public static org.nd4j.linalg.lossfunctions.LossFunctions.LossFunction mapLossFunction(java.lang.String kerasLoss) throws UnsupportedKerasConfigurationException
kerasLoss
- String containing Keras loss function nameUnsupportedKerasConfigurationException
public static PoolingType mapPoolingType(java.lang.String className) throws UnsupportedKerasConfigurationException
className
- UnsupportedKerasConfigurationException
public static int[] mapPoolingDimensions(java.lang.String className) throws UnsupportedKerasConfigurationException
className
- UnsupportedKerasConfigurationException
public static java.lang.String getClassNameFromConfig(java.util.Map<java.lang.String,java.lang.Object> layerConfig) throws InvalidKerasConfigurationException
layerConfig
- dictionary containing Keras layer configurationInvalidKerasConfigurationException
public static java.util.Map<java.lang.String,java.lang.Object> getTimeDistributedLayerConfig(java.util.Map<java.lang.String,java.lang.Object> layerConfig) throws InvalidKerasConfigurationException
layerConfig
- dictionary containing Keras TimeDistributed configurationInvalidKerasConfigurationException
public static java.util.Map<java.lang.String,java.lang.Object> getInnerLayerConfigFromConfig(java.util.Map<java.lang.String,java.lang.Object> layerConfig) throws InvalidKerasConfigurationException
layerConfig
- dictionary containing Keras layer configurationInvalidKerasConfigurationException
protected java.lang.String getLayerNameFromConfig(java.util.Map<java.lang.String,java.lang.Object> layerConfig) throws InvalidKerasConfigurationException
layerConfig
- dictionary containing Keras layer configurationInvalidKerasConfigurationException
public static java.util.List<java.lang.String> getInboundLayerNamesFromConfig(java.util.Map<java.lang.String,java.lang.Object> layerConfig)
layerConfig
- dictionary containing Keras layer configurationpublic static int getNOutFromConfig(java.util.Map<java.lang.String,java.lang.Object> layerConfig) throws InvalidKerasConfigurationException
layerConfig
- dictionary containing Keras layer configurationInvalidKerasConfigurationException
protected double getDropoutFromConfig(java.util.Map<java.lang.String,java.lang.Object> layerConfig) throws InvalidKerasConfigurationException
layerConfig
- dictionary containing Keras layer configurationInvalidKerasConfigurationException
protected org.nd4j.linalg.activations.IActivation getActivationFromConfig(java.util.Map<java.lang.String,java.lang.Object> layerConfig) throws InvalidKerasConfigurationException, UnsupportedKerasConfigurationException
layerConfig
- dictionary containing Keras layer configurationInvalidKerasConfigurationException
UnsupportedKerasConfigurationException
protected WeightInit getWeightInitFromConfig(java.util.Map<java.lang.String,java.lang.Object> layerConfig, boolean enforceTrainingConfig) throws InvalidKerasConfigurationException, UnsupportedKerasConfigurationException
layerConfig
- dictionary containing Keras layer configurationenforceTrainingConfig
- InvalidKerasConfigurationException
UnsupportedKerasConfigurationException
public static double getWeightL1RegularizationFromConfig(java.util.Map<java.lang.String,java.lang.Object> layerConfig, boolean willBeTrained) throws UnsupportedKerasConfigurationException, InvalidKerasConfigurationException
layerConfig
- dictionary containing Keras layer configuration Map containing Keras weight reguarlization configurationUnsupportedKerasConfigurationException
InvalidKerasConfigurationException
public static double getWeightL2RegularizationFromConfig(java.util.Map<java.lang.String,java.lang.Object> layerConfig, boolean willBeTrained) throws UnsupportedKerasConfigurationException, InvalidKerasConfigurationException
layerConfig
- dictionary containing Keras layer configuration Map containing Keras weight reguarlization configurationUnsupportedKerasConfigurationException
InvalidKerasConfigurationException
public static double getBiasL1RegularizationFromConfig(java.util.Map<java.lang.String,java.lang.Object> layerConfig, boolean willBeTrained) throws UnsupportedKerasConfigurationException, InvalidKerasConfigurationException
layerConfig
- dictionary containing Keras layer configuration Map containing Keras bias reguarlization configurationUnsupportedKerasConfigurationException
InvalidKerasConfigurationException
public static int[] getStrideFromConfig(java.util.Map<java.lang.String,java.lang.Object> layerConfig) throws InvalidKerasConfigurationException
layerConfig
- dictionary containing Keras layer configurationInvalidKerasConfigurationException
public static int[] getKernelSizeFromConfig(java.util.Map<java.lang.String,java.lang.Object> layerConfig) throws InvalidKerasConfigurationException
layerConfig
- dictionary containing Keras layer configurationInvalidKerasConfigurationException
public static ConvolutionMode getConvolutionModeFromConfig(java.util.Map<java.lang.String,java.lang.Object> layerConfig) throws InvalidKerasConfigurationException, UnsupportedKerasConfigurationException
layerConfig
- dictionary containing Keras layer configurationInvalidKerasConfigurationException
UnsupportedKerasConfigurationException
public int[] getPaddingFromBorderModeConfig(java.util.Map<java.lang.String,java.lang.Object> layerConfig) throws InvalidKerasConfigurationException, UnsupportedKerasConfigurationException
layerConfig
- dictionary containing Keras layer configurationInvalidKerasConfigurationException
UnsupportedKerasConfigurationException