StreamingLSTMCell
PythonOne LSTM step: [x, h, c] -> [h', c'].
StreamingLSTMCell(units: int, use_bias: bool = True, unit_forget_bias: bool = True, **kwargs={})One LSTM step: [x, h, c] -> [h', c'].
The weights have the layout of keras.layers.LSTMCell: kernel (features, 4 * units),
recurrent_kernel (units, 4 * units) and bias (4 * units), with gates in the order input,
forget, cell, output. Weights of a keras.layers.LSTM or LSTMCell load unchanged.
c’ = f * c + i * tanh(z_c) and h’ = o * tanh(c’), where z = x W + h R + b and i, f, o are the sigmoid of their slices of z.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
units | int | Required | Size of the hidden and cell state. |
use_bias | bool | True | Add ``bias`` to the gates. |
unit_forget_bias | bool | True | Initialize the forget gate's bias to one and the others to zero, as ``keras.layers.LSTMCell`` does. |
units
Pythonunits = unitsuse_bias
Pythonuse_bias = use_biasunit_forget_bias
Pythonunit_forget_bias = unit_forget_biasbuild
Pythonbuild(input_shape)call
Pythoncall(inputs)compute_output_shape
Pythoncompute_output_shape(input_shape)get_config
Pythonget_config()