arrow-left

All pages
gitbookPowered by GitBook
1 of 1

Loading...

Embedding Layers

hashtag
KerasEmbedding

[source]arrow-up-right

Imports an Embedding layer from Keras.

KerasEmbedding

Pass through constructor for unit tests

  • throws UnsupportedKerasConfigurationException Unsupported Keras config

getEmbeddingLayer

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

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 (1)

setWeights

Set weights for layer.

  • param weights Embedding layer weights

public KerasEmbedding() throws UnsupportedKerasConfigurationException
public EmbeddingSequenceLayer getEmbeddingLayer()
public InputType getOutputType(InputType... inputType) throws InvalidKerasConfigurationException
public int getNumParams()
public void setWeights(Map<String, INDArray> weights) throws InvalidKerasConfigurationException