arrow-left

All pages
gitbookPowered by GitBook
1 of 1

Loading...

Wrapper Layers

hashtag
KerasBidirectional

[source]arrow-up-right

Builds a DL4J Bidirectional layer from a Keras Bidirectional layer wrapper

KerasBidirectional

Pass-through constructor from KerasLayer

  • param kerasVersion major keras version

  • throws UnsupportedKerasConfigurationException Unsupported Keras config

getUnderlyingRecurrentLayer

Constructor from parsed Keras layer configuration dictionary.

  • param layerConfig dictionary containing Keras layer configuration

  • throws InvalidKerasConfigurationException Invalid Keras config

  • throws UnsupportedKerasConfigurationException Unsupported Keras config

getBidirectionalLayer

Get DL4J Bidirectional layer.

  • return Bidirectional Layer

getOutputType

Get layer output type.

  • param inputType Array of InputTypes

  • return output type as InputType

  • throws InvalidKerasConfigurationException Invalid Keras config

getNumParams

Returns number of trainable parameters in layer.

  • return number of trainable parameters

getInputPreprocessor

Gets appropriate DL4J InputPreProcessor for given InputTypes.

  • param inputType Array of InputTypes

  • return DL4J InputPreProcessor

  • throws InvalidKerasConfigurationException Invalid Keras configuration exception

setWeights

Set weights for Bidirectional layer.

  • param weights Map of weights

see org.deeplearning4j.nn.conf.InputPreProcessor
public KerasBidirectional(Integer kerasVersion) throws UnsupportedKerasConfigurationException 
public Layer getUnderlyingRecurrentLayer() 
public Bidirectional getBidirectionalLayer() 
public InputType getOutputType(InputType... inputType) throws InvalidKerasConfigurationException 
public int getNumParams() 
public InputPreProcessor getInputPreprocessor(InputType... inputType) throws InvalidKerasConfigurationException 
public void setWeights(Map<String, INDArray> weights) throws InvalidKerasConfigurationException