public class KerasLSTM extends KerasLayer
KerasLayer.DimOrder| Modifier and Type | Field and Description |
|---|---|
protected boolean |
returnSequences |
protected boolean |
unroll |
className, conf, dimOrder, dropout, inboundLayerNames, inputShape, kerasMajorVersion, layer, layerName, originalLayerConfig, outboundLayerNames, vertex, weightL1Regularization, weightL2Regularization, weights| Constructor and Description |
|---|
KerasLSTM(Integer kerasVersion)
Pass-through constructor from KerasLayer
|
KerasLSTM(Map<String,Object> layerConfig)
Constructor from parsed Keras layer configuration dictionary.
|
KerasLSTM(Map<String,Object> layerConfig,
boolean enforceTrainingConfig)
Constructor from parsed Keras layer configuration dictionary.
|
KerasLSTM(Map<String,Object> layerConfig,
boolean enforceTrainingConfig,
Map<String,? extends KerasLayer> previousLayers)
Constructor from parsed Keras layer configuration dictionary.
|
KerasLSTM(Map<String,Object> layerConfig,
Map<String,? extends KerasLayer> previousLayers)
Constructor from parsed Keras layer configuration dictionary.
|
| Modifier and Type | Method and Description |
|---|---|
double |
getForgetBiasInitFromConfig(Map<String,Object> layerConfig,
boolean train)
Get LSTM forget gate bias initialization from Keras layer configuration.
|
IActivation |
getGateActivationFromConfig(Map<String,Object> layerConfig)
Get LSTM gate activation function from Keras layer configuration.
|
InputPreProcessor |
getInputPreprocessor(InputType... inputType)
Gets appropriate DL4J InputPreProcessor for given InputTypes.
|
Layer |
getLSTMLayer()
Get DL4J Layer.
|
int |
getNumParams()
Returns number of trainable parameters in layer.
|
InputType |
getOutputType(InputType... inputType)
Get layer output type.
|
boolean |
getUnroll()
Get whether LSTM layer should be unrolled (for truncated BPTT).
|
void |
setWeights(Map<String,INDArray> weights)
Set weights for layer.
|
clearCustomLayers, clearLambdaLayers, copyWeightsToLayer, getClassName, getDimOrder, getInboundLayerNames, getInputShape, getKerasMajorVersion, getLayer, getLayerName, getNInFromConfig, getVertex, getWeights, isInputPreProcessor, isLayer, isValidInboundLayer, isVertex, registerCustomLayer, registerLambdaLayer, setInboundLayerNames, setLayer, usesRegularizationpublic KerasLSTM(Integer kerasVersion) throws UnsupportedKerasConfigurationException
kerasVersion - major keras versionUnsupportedKerasConfigurationException - Unsupported Keras configpublic KerasLSTM(Map<String,Object> layerConfig) throws InvalidKerasConfigurationException, UnsupportedKerasConfigurationException
layerConfig - dictionary containing Keras layer configuration.InvalidKerasConfigurationException - Invalid Keras configUnsupportedKerasConfigurationException - Unsupported Keras configpublic KerasLSTM(Map<String,Object> layerConfig, boolean enforceTrainingConfig) throws InvalidKerasConfigurationException, UnsupportedKerasConfigurationException
layerConfig - dictionary containing Keras layer configuration.enforceTrainingConfig - whether to load Keras training configurationInvalidKerasConfigurationException - Invalid Keras configUnsupportedKerasConfigurationException - Unsupported Keras configpublic KerasLSTM(Map<String,Object> layerConfig, Map<String,? extends KerasLayer> previousLayers) throws InvalidKerasConfigurationException, UnsupportedKerasConfigurationException
layerConfig - dictionary containing Keras layer configuration.previousLayers - dictionary containing the previous layers in the topologyInvalidKerasConfigurationException - Invalid Keras configUnsupportedKerasConfigurationException - Unsupported Keras configpublic KerasLSTM(Map<String,Object> layerConfig, boolean enforceTrainingConfig, Map<String,? extends KerasLayer> previousLayers) throws InvalidKerasConfigurationException, UnsupportedKerasConfigurationException
layerConfig - dictionary containing Keras layer configurationenforceTrainingConfig - whether to enforce training-related configuration optionspreviousLayers - - dictionary containing the previous layers in the topologyInvalidKerasConfigurationException - Invalid Keras configUnsupportedKerasConfigurationException - Unsupported Keras configpublic Layer getLSTMLayer()
public InputType getOutputType(InputType... inputType) throws InvalidKerasConfigurationException
getOutputType in class KerasLayerinputType - Array of InputTypesInvalidKerasConfigurationException - Invalid Keras configpublic int getNumParams()
getNumParams in class KerasLayerpublic InputPreProcessor getInputPreprocessor(InputType... inputType) throws InvalidKerasConfigurationException
getInputPreprocessor in class KerasLayerinputType - Array of InputTypesInvalidKerasConfigurationException - Invalid Keras configuration exceptionInputPreProcessorpublic void setWeights(Map<String,INDArray> weights) throws InvalidKerasConfigurationException
setWeights in class KerasLayerweights - LSTM layer weightsInvalidKerasConfigurationExceptionpublic boolean getUnroll()
public IActivation getGateActivationFromConfig(Map<String,Object> layerConfig) throws InvalidKerasConfigurationException, UnsupportedKerasConfigurationException
layerConfig - dictionary containing Keras layer configurationInvalidKerasConfigurationException - Invalid Keras configUnsupportedKerasConfigurationExceptionpublic double getForgetBiasInitFromConfig(Map<String,Object> layerConfig, boolean train) throws InvalidKerasConfigurationException, UnsupportedKerasConfigurationException
layerConfig - dictionary containing Keras layer configurationInvalidKerasConfigurationException - Unsupported Keras configUnsupportedKerasConfigurationExceptionCopyright © 2021. All rights reserved.