Keras layers


KerasConvolution2D

[source]

Imports a 2D Convolution layer from Keras.

KerasConvolution2D
  1. public KerasConvolution2D(Integer kerasVersion) throws UnsupportedKerasConfigurationException

Pass-through constructor from KerasLayer

  • param kerasVersion major keras version
  • throws UnsupportedKerasConfigurationException Unsupported Keras config
getConvolution2DLayer
  1. public ConvolutionLayer getConvolution2DLayer()

Constructor from parsed Keras layer configuration dictionary.

  • param layerConfig dictionary containing Keras layer configuration
  • throws InvalidKerasConfigurationException Invalid Keras config
  • throws UnsupportedKerasConfigurationException Unsupported Keras config
getOutputType
  1. public InputType getOutputType(InputType... inputType) throws InvalidKerasConfigurationException

Get layer output type.

  • param inputType Array of InputTypes
  • return output type as InputType
  • throws InvalidKerasConfigurationException Invalid Keras config

KerasCropping2D

[source]

Imports a Keras Cropping 2D layer.

KerasCropping2D
  1. public KerasCropping2D(Map<String, Object> layerConfig)
  2. throws InvalidKerasConfigurationException, UnsupportedKerasConfigurationException

Constructor from parsed Keras layer configuration dictionary.

  • param layerConfig dictionary containing Keras layer configuration.
  • throws InvalidKerasConfigurationException Invalid Keras config
  • throws UnsupportedKerasConfigurationException Unsupported Keras config
getCropping2DLayer
  1. public Cropping2D getCropping2DLayer()

Constructor from parsed Keras layer configuration dictionary.

  • param layerConfig dictionary containing Keras layer configuration
  • param enforceTrainingConfig whether to enforce training-related configuration options
  • throws InvalidKerasConfigurationException Invalid Keras config
  • throws UnsupportedKerasConfigurationException Unsupported Keras config
getOutputType
  1. public InputType getOutputType(InputType... inputType) throws InvalidKerasConfigurationException

Get layer output type.

  • param inputType Array of InputTypes
  • return output type as InputType
  • throws InvalidKerasConfigurationException Invalid Keras config

KerasUpsampling3D

[source]

Keras Upsampling3D layer support

KerasUpsampling3D
  1. public KerasUpsampling3D(Map<String, Object> layerConfig)
  2. throws InvalidKerasConfigurationException, UnsupportedKerasConfigurationException

Constructor from parsed Keras layer configuration dictionary.

  • param layerConfig dictionary containing Keras layer configuration.
  • throws InvalidKerasConfigurationException Invalid Keras configuration exception
  • throws UnsupportedKerasConfigurationException Unsupported Keras configuration exception
getUpsampling3DLayer
  1. public Upsampling3D getUpsampling3DLayer()

Constructor from parsed Keras layer configuration dictionary.

  • param layerConfig dictionary containing Keras layer configuration
  • param enforceTrainingConfig whether to enforce training-related configuration options
  • throws InvalidKerasConfigurationException Invalid Keras configuration exception
  • throws UnsupportedKerasConfigurationException Invalid Keras configuration exception
getOutputType
  1. public InputType getOutputType(InputType... inputType) throws InvalidKerasConfigurationException

Get layer output type.

  • param inputType Array of InputTypes
  • return output type as InputType
  • throws InvalidKerasConfigurationException Invalid Keras config

KerasConvolution1D

[source]

Imports a 1D Convolution layer from Keras.

KerasConvolution1D
  1. public KerasConvolution1D(Integer kerasVersion) throws UnsupportedKerasConfigurationException

Pass-through constructor from KerasLayer

  • param kerasVersion major keras version
  • throws UnsupportedKerasConfigurationException
getConvolution1DLayer
  1. public Convolution1DLayer getConvolution1DLayer()

Constructor from parsed Keras layer configuration dictionary.

  • param layerConfig dictionary containing Keras layer configuration
  • throws InvalidKerasConfigurationException
  • throws UnsupportedKerasConfigurationException
getOutputType
  1. public InputType getOutputType(InputType... inputType) throws InvalidKerasConfigurationException

Get layer output type.

  • param inputType Array of InputTypes
  • return output type as InputType
  • throws InvalidKerasConfigurationException
getInputPreprocessor
  1. public InputPreProcessor getInputPreprocessor(InputType... inputType) throws InvalidKerasConfigurationException

Gets appropriate DL4J InputPreProcessor for given InputTypes.

  • param inputType Array of InputTypes
  • return DL4J InputPreProcessor
  • throws InvalidKerasConfigurationException Invalid Keras configuration exception
  • see org.deeplearning4j.nn.conf.InputPreProcessor
setWeights
  1. public void setWeights(Map<String, INDArray> weights) throws InvalidKerasConfigurationException

Set weights for layer.

  • param weights Map from parameter name to INDArray.

KerasUpsampling1D

[source]

Keras Upsampling1D layer support

KerasUpsampling1D
  1. public KerasUpsampling1D(Map<String, Object> layerConfig)
  2. throws InvalidKerasConfigurationException, UnsupportedKerasConfigurationException

Constructor from parsed Keras layer configuration dictionary.

  • param layerConfig dictionary containing Keras layer configuration.
  • throws InvalidKerasConfigurationException Invalid Keras configuration exception
  • throws UnsupportedKerasConfigurationException Unsupported Keras configuration exception
getUpsampling1DLayer
  1. public Upsampling1D getUpsampling1DLayer()

Constructor from parsed Keras layer configuration dictionary.

  • param layerConfig dictionary containing Keras layer configuration
  • param enforceTrainingConfig whether to enforce training-related configuration options
  • throws InvalidKerasConfigurationException Invalid Keras configuration exception
  • throws UnsupportedKerasConfigurationException Invalid Keras configuration exception
getOutputType
  1. public InputType getOutputType(InputType... inputType) throws InvalidKerasConfigurationException

Get layer output type.

  • param inputType Array of InputTypes
  • return output type as InputType
  • throws InvalidKerasConfigurationException Invalid Keras config

KerasAtrousConvolution2D

[source]

Keras 1D atrous / dilated convolution layer. Note that in keras 2 this layer has beenremoved and dilations are now available through the “dilated” argument in regular Conv1D layers

author: Max Pumperla

KerasAtrousConvolution2D
  1. public KerasAtrousConvolution2D(Integer kerasVersion) throws UnsupportedKerasConfigurationException

Pass-through constructor from KerasLayer

  • param kerasVersion major keras version
  • throws UnsupportedKerasConfigurationException Unsupported Keras config
getAtrousConvolution2D
  1. public ConvolutionLayer getAtrousConvolution2D()

Constructor from parsed Keras layer configuration dictionary.

  • param layerConfig dictionary containing Keras layer configuration
  • throws InvalidKerasConfigurationException Invalid Keras config
  • throws UnsupportedKerasConfigurationException Unsupported Keras config
getOutputType
  1. public InputType getOutputType(InputType... inputType) throws InvalidKerasConfigurationException

Get layer output type.

  • param inputType Array of InputTypes
  • return output type as InputType
  • throws InvalidKerasConfigurationException Invalid Keras config

KerasAtrousConvolution1D

[source]

Keras 1D atrous / dilated convolution layer. Note that in keras 2 this layer has beenremoved and dilations are now available through the “dilated” argument in regular Conv1D layers

author: Max Pumperla

KerasAtrousConvolution1D
  1. public KerasAtrousConvolution1D(Integer kerasVersion) throws UnsupportedKerasConfigurationException

Pass-through constructor from KerasLayer

  • param kerasVersion major keras version
  • throws UnsupportedKerasConfigurationException Unsupported Keras config
getAtrousConvolution1D
  1. public Convolution1DLayer getAtrousConvolution1D()

Constructor from parsed Keras layer configuration dictionary.

  • param layerConfig dictionary containing Keras layer configuration
  • throws InvalidKerasConfigurationException Invalid Keras config
  • throws UnsupportedKerasConfigurationException Unsupported Keras config
getOutputType
  1. public InputType getOutputType(InputType... inputType) throws InvalidKerasConfigurationException

Get layer output type.

  • param inputType Array of InputTypes
  • return output type as InputType
  • throws InvalidKerasConfigurationException Invalid Keras config

KerasCropping3D

[source]

Imports a Keras Cropping 3D layer.

KerasCropping3D
  1. public KerasCropping3D(Map<String, Object> layerConfig)
  2. throws InvalidKerasConfigurationException, UnsupportedKerasConfigurationException

Constructor from parsed Keras layer configuration dictionary.

  • param layerConfig dictionary containing Keras layer configuration.
  • throws InvalidKerasConfigurationException Invalid Keras config
  • throws UnsupportedKerasConfigurationException Unsupported Keras config
getCropping3DLayer
  1. public Cropping3D getCropping3DLayer()

Constructor from parsed Keras layer configuration dictionary.

  • param layerConfig dictionary containing Keras layer configuration
  • param enforceTrainingConfig whether to enforce training-related configuration options
  • throws InvalidKerasConfigurationException Invalid Keras config
  • throws UnsupportedKerasConfigurationException Unsupported Keras config
getOutputType
  1. public InputType getOutputType(InputType... inputType) throws InvalidKerasConfigurationException

Get layer output type.

  • param inputType Array of InputTypes
  • return output type as InputType
  • throws InvalidKerasConfigurationException Invalid Keras config

KerasZeroPadding2D

[source]

Imports a Keras ZeroPadding 2D layer.

KerasZeroPadding2D
  1. public KerasZeroPadding2D(Map<String, Object> layerConfig)
  2. throws InvalidKerasConfigurationException, UnsupportedKerasConfigurationException

Constructor from parsed Keras layer configuration dictionary.

  • param layerConfig dictionary containing Keras layer configuration.

  • throws InvalidKerasConfigurationException Invalid Keras config

  • throws UnsupportedKerasConfigurationException Unsupported Keras config
getZeroPadding2DLayer
  1. public ZeroPaddingLayer getZeroPadding2DLayer()

Constructor from parsed Keras layer configuration dictionary.

  • param layerConfig dictionary containing Keras layer configuration
  • param enforceTrainingConfig whether to enforce training-related configuration options
  • throws InvalidKerasConfigurationException Invalid Keras config
  • throws UnsupportedKerasConfigurationException Unsupported Keras config
getOutputType
  1. public InputType getOutputType(InputType... inputType) throws InvalidKerasConfigurationException

Get layer output type.

  • param inputType Array of InputTypes
  • return output type as InputType
  • throws InvalidKerasConfigurationException Invalid Keras config

KerasConvolution3D

[source]

Imports a 3D Convolution layer from Keras.

KerasConvolution3D
  1. public KerasConvolution3D(Integer kerasVersion) throws UnsupportedKerasConfigurationException

Pass-through constructor from KerasLayer

  • param kerasVersion major keras version
  • throws UnsupportedKerasConfigurationException Unsupported Keras config
getConvolution3DLayer
  1. public ConvolutionLayer getConvolution3DLayer()

Constructor from parsed Keras layer configuration dictionary.

  • param layerConfig dictionary containing Keras layer configuration
  • throws InvalidKerasConfigurationException Invalid Keras config
  • throws UnsupportedKerasConfigurationException Unsupported Keras config
getOutputType
  1. public InputType getOutputType(InputType... inputType) throws InvalidKerasConfigurationException

Get layer output type.

  • param inputType Array of InputTypes
  • return output type as InputType
  • throws InvalidKerasConfigurationException Invalid Keras config

KerasDeconvolution2D

[source]

Imports a 2D Deconvolution layer from Keras.

KerasDeconvolution2D
  1. public KerasDeconvolution2D(Integer kerasVersion) throws UnsupportedKerasConfigurationException

Pass-through constructor from KerasLayer

  • param kerasVersion major keras version
  • throws UnsupportedKerasConfigurationException Unsupported Keras config
getDeconvolution2DLayer
  1. public Deconvolution2D getDeconvolution2DLayer()

Constructor from parsed Keras layer configuration dictionary.

  • param layerConfig dictionary containing Keras layer configuration
  • throws InvalidKerasConfigurationException Invalid Keras config
  • throws UnsupportedKerasConfigurationException Unsupported Keras config
getOutputType
  1. public InputType getOutputType(InputType... inputType) throws InvalidKerasConfigurationException

Get layer output type.

  • param inputType Array of InputTypes
  • return output type as InputType
  • throws InvalidKerasConfigurationException Invalid Keras config

KerasZeroPadding3D

[source]

Imports a Keras ZeroPadding 3D layer.

KerasZeroPadding3D
  1. public KerasZeroPadding3D(Map<String, Object> layerConfig)
  2. throws InvalidKerasConfigurationException, UnsupportedKerasConfigurationException

Constructor from parsed Keras layer configuration dictionary.

  • param layerConfig dictionary containing Keras layer configuration.

  • throws InvalidKerasConfigurationException Invalid Keras config

  • throws UnsupportedKerasConfigurationException Unsupported Keras config
getZeroPadding3DLayer
  1. public ZeroPadding3DLayer getZeroPadding3DLayer()

Constructor from parsed Keras layer configuration dictionary.

  • param layerConfig dictionary containing Keras layer configuration
  • param enforceTrainingConfig whether to enforce training-related configuration options
  • throws InvalidKerasConfigurationException Invalid Keras config
  • throws UnsupportedKerasConfigurationException Unsupported Keras config
getOutputType
  1. public InputType getOutputType(InputType... inputType) throws InvalidKerasConfigurationException

Get layer output type.

  • param inputType Array of InputTypes
  • return output type as InputType
  • throws InvalidKerasConfigurationException Invalid Keras config

KerasConvolutionUtils

[source]

Utility functionality for Keras convolution layers.

getConvolutionModeFromConfig
  1. public static ConvolutionMode getConvolutionModeFromConfig(Map<String, Object> layerConfig,
  2. KerasLayerConfiguration conf)
  3. throws InvalidKerasConfigurationException, UnsupportedKerasConfigurationException

Get (convolution) stride from Keras layer configuration.

  • param layerConfig dictionary containing Keras layer configuration
  • return Strides array from Keras configuration
  • throws InvalidKerasConfigurationException Invalid Keras config

KerasZeroPadding1D

[source]

Imports a Keras ZeroPadding 1D layer.

KerasZeroPadding1D
  1. public KerasZeroPadding1D(Map<String, Object> layerConfig)
  2. throws InvalidKerasConfigurationException, UnsupportedKerasConfigurationException

Constructor from parsed Keras layer configuration dictionary.

  • param layerConfig dictionary containing Keras layer configuration.
  • throws InvalidKerasConfigurationException Invalid Keras config
  • throws UnsupportedKerasConfigurationException Unsupported Keras config
getZeroPadding1DLayer
  1. public ZeroPadding1DLayer getZeroPadding1DLayer()

Constructor from parsed Keras layer configuration dictionary.

  • param layerConfig dictionary containing Keras layer configuration
  • param enforceTrainingConfig whether to enforce training-related configuration options
  • throws InvalidKerasConfigurationException Invalid Keras config
  • throws UnsupportedKerasConfigurationException Unsupported Keras config
getOutputType
  1. public InputType getOutputType(InputType... inputType) throws InvalidKerasConfigurationException

Get layer output type.

  • param inputType Array of InputTypes
  • return output type as InputType
  • throws InvalidKerasConfigurationException Invalid Keras config

KerasCropping1D

[source]

Imports a Keras Cropping 1D layer.

KerasCropping1D
  1. public KerasCropping1D(Map<String, Object> layerConfig)
  2. throws InvalidKerasConfigurationException, UnsupportedKerasConfigurationException

Constructor from parsed Keras layer configuration dictionary.

  • param layerConfig dictionary containing Keras layer configuration.
  • throws InvalidKerasConfigurationException Invalid Keras config
  • throws UnsupportedKerasConfigurationException Unsupported Keras config
getCropping1DLayer
  1. public Cropping1D getCropping1DLayer()

Constructor from parsed Keras layer configuration dictionary.

  • param layerConfig dictionary containing Keras layer configuration
  • param enforceTrainingConfig whether to enforce training-related configuration options
  • throws InvalidKerasConfigurationException Invalid Keras config
  • throws UnsupportedKerasConfigurationException Unsupported Keras config
getOutputType
  1. public InputType getOutputType(InputType... inputType) throws InvalidKerasConfigurationException

Get layer output type.

  • param inputType Array of InputTypes
  • return output type as InputType
  • throws InvalidKerasConfigurationException Invalid Keras config

KerasSpaceToDepth

[source]

Constructor from parsed Keras layer configuration dictionary.

KerasSpaceToDepth
  1. public KerasSpaceToDepth(Map<String, Object> layerConfig, boolean enforceTrainingConfig)
  2. throws InvalidKerasConfigurationException, UnsupportedKerasConfigurationException

Constructor from parsed Keras layer configuration dictionary.

  • param layerConfig dictionary containing Keras layer configuration
  • param enforceTrainingConfig whether to enforce training-related configuration options
  • throws InvalidKerasConfigurationException Invalid Keras configuration exception
  • throws UnsupportedKerasConfigurationException Unsupported Keras configuration exception
getSpaceToDepthLayer
  1. public SpaceToDepthLayer getSpaceToDepthLayer()

Get DL4J SpaceToDepth layer.

  • return SpaceToDepth layer
getOutputType
  1. public InputType getOutputType(InputType... inputType) throws InvalidKerasConfigurationException

Get layer output type.

  • param inputType Array of InputTypes
  • return output type as InputType
  • throws InvalidKerasConfigurationException Invalid Keras config

KerasUpsampling2D

[source]

Keras Upsampling2D layer support

KerasUpsampling2D
  1. public KerasUpsampling2D(Map<String, Object> layerConfig)
  2. throws InvalidKerasConfigurationException, UnsupportedKerasConfigurationException

Constructor from parsed Keras layer configuration dictionary.

  • param layerConfig dictionary containing Keras layer configuration.
  • throws InvalidKerasConfigurationException Invalid Keras configuration exception
  • throws UnsupportedKerasConfigurationException Unsupported Keras configuration exception
getUpsampling2DLayer
  1. public Upsampling2D getUpsampling2DLayer()

Constructor from parsed Keras layer configuration dictionary.

  • param layerConfig dictionary containing Keras layer configuration
  • param enforceTrainingConfig whether to enforce training-related configuration options
  • throws InvalidKerasConfigurationException Invalid Keras configuration exception
  • throws UnsupportedKerasConfigurationException Invalid Keras configuration exception
getOutputType
  1. public InputType getOutputType(InputType... inputType) throws InvalidKerasConfigurationException

Get layer output type.

  • param inputType Array of InputTypes
  • return output type as InputType
  • throws InvalidKerasConfigurationException Invalid Keras config

KerasSeparableConvolution2D

[source]

Keras separable convolution 2D layer support

KerasSeparableConvolution2D
  1. public KerasSeparableConvolution2D(Integer kerasVersion) throws UnsupportedKerasConfigurationException

Pass-through constructor from KerasLayer

  • param kerasVersion major keras version
  • throws UnsupportedKerasConfigurationException Unsupported Keras configuration
setWeights
  1. public void setWeights(Map<String, INDArray> weights) throws InvalidKerasConfigurationException

Constructor from parsed Keras layer configuration dictionary.

  • param layerConfig dictionary containing Keras layer configuration
  • throws InvalidKerasConfigurationException Invalid Keras configuration
  • throws UnsupportedKerasConfigurationException Unsupported Keras configuration
getSeparableConvolution2DLayer
  1. public SeparableConvolution2D getSeparableConvolution2DLayer()

Get DL4J SeparableConvolution2D.

  • return SeparableConvolution2D
getOutputType
  1. public InputType getOutputType(InputType... inputType) throws InvalidKerasConfigurationException

Get layer output type.

  • param inputType Array of InputTypes
  • return output type as InputType
  • throws InvalidKerasConfigurationException Invalid Keras config

KerasDepthwiseConvolution2D

[source]

Keras depth-wise convolution 2D layer support

KerasDepthwiseConvolution2D
  1. public KerasDepthwiseConvolution2D(Integer kerasVersion) throws UnsupportedKerasConfigurationException

Pass-through constructor from KerasLayer

  • param kerasVersion major keras version
  • throws UnsupportedKerasConfigurationException Unsupported Keras configuration
setWeights
  1. public void setWeights(Map<String, INDArray> weights) throws InvalidKerasConfigurationException

Constructor from parsed Keras layer configuration dictionary.

  • param layerConfig dictionary containing Keras layer configuration
  • throws InvalidKerasConfigurationException Invalid Keras configuration
  • throws UnsupportedKerasConfigurationException Unsupported Keras configuration
getDepthwiseConvolution2DLayer
  1. public DepthwiseConvolution2D getDepthwiseConvolution2DLayer()

Get DL4J DepthwiseConvolution2D.

  • return DepthwiseConvolution2D
getOutputType
  1. public InputType getOutputType(InputType... inputType) throws InvalidKerasConfigurationException

Get layer output type.

  • param inputType Array of InputTypes
  • return output type as InputType
  • throws InvalidKerasConfigurationException Invalid Keras config