public class KerasBidirectional extends KerasLayer
KerasLayer.DimOrder
className, conf, dimOrder, dropout, inboundLayerNames, inputShape, kerasMajorVersion, layer, layerName, vertex, weightL1Regularization, weightL2Regularization, weights
Constructor and Description |
---|
KerasBidirectional(java.lang.Integer kerasVersion)
Pass-through constructor from KerasLayer
|
KerasBidirectional(java.util.Map<java.lang.String,java.lang.Object> layerConfig)
Constructor from parsed Keras layer configuration dictionary.
|
KerasBidirectional(java.util.Map<java.lang.String,java.lang.Object> layerConfig,
boolean enforceTrainingConfig)
Constructor from parsed Keras layer configuration dictionary.
|
Modifier and Type | Method and Description |
---|---|
Bidirectional |
getBidirectionalLayer()
Get DL4J Bidirectional layer.
|
InputPreProcessor |
getInputPreprocessor(InputType... inputType)
Gets appropriate DL4J InputPreProcessor for given InputTypes.
|
int |
getNumParams()
Returns number of trainable parameters in layer.
|
InputType |
getOutputType(InputType... inputType)
Get layer output type.
|
Layer |
getUnderlyingRecurrentLayer()
Return the underlying recurrent layer of this bidirectional layer
|
void |
setWeights(java.util.Map<java.lang.String,INDArray> weights)
Set weights for Bidirectional layer.
|
clearCustomLayers, clearLambdaLayers, copyWeightsToLayer, getClassName, getDimOrder, getInboundLayerNames, getInputShape, getKerasMajorVersion, getLayer, getLayerName, getNInFromConfig, getVertex, getWeights, isInputPreProcessor, isLayer, isValidInboundLayer, isVertex, registerCustomLayer, registerLambdaLayer, setInboundLayerNames, usesRegularization
public KerasBidirectional(java.lang.Integer kerasVersion) throws UnsupportedKerasConfigurationException
kerasVersion
- major keras versionUnsupportedKerasConfigurationException
- Unsupported Keras configpublic KerasBidirectional(java.util.Map<java.lang.String,java.lang.Object> layerConfig) throws InvalidKerasConfigurationException, UnsupportedKerasConfigurationException
layerConfig
- dictionary containing Keras layer configurationInvalidKerasConfigurationException
- Invalid Keras configUnsupportedKerasConfigurationException
- Unsupported Keras configpublic KerasBidirectional(java.util.Map<java.lang.String,java.lang.Object> layerConfig, boolean enforceTrainingConfig) throws InvalidKerasConfigurationException, UnsupportedKerasConfigurationException
layerConfig
- dictionary containing Keras layer configurationenforceTrainingConfig
- whether to enforce training-related configuration optionsInvalidKerasConfigurationException
- Invalid Keras configUnsupportedKerasConfigurationException
- Unsupported Keras configpublic Layer getUnderlyingRecurrentLayer()
public Bidirectional getBidirectionalLayer()
public InputType getOutputType(InputType... inputType) throws InvalidKerasConfigurationException
getOutputType
in class KerasLayer
inputType
- Array of InputTypesInvalidKerasConfigurationException
- Invalid Keras configpublic int getNumParams()
getNumParams
in class KerasLayer
public InputPreProcessor getInputPreprocessor(InputType... inputType) throws InvalidKerasConfigurationException
getInputPreprocessor
in class KerasLayer
inputType
- Array of InputTypesInvalidKerasConfigurationException
- Invalid Keras configuration exceptionInputPreProcessor
public void setWeights(java.util.Map<java.lang.String,INDArray> weights) throws InvalidKerasConfigurationException
setWeights
in class KerasLayer
weights
- Map of weightsInvalidKerasConfigurationException