Base class for writing recurrent / stateful operations.
One needs to implement 3 methods: _apply, prepare_input and get_state_names.
As a result base class will provice apply_over_sequence method, which
allows you to apply recurrent operations over a sequence of any length.
Definition at line 20 of file rnn_cell.py.
def rnn_cell.RNNCell.prepare_input |
( |
|
self, |
|
|
|
model, |
|
|
|
input_blob |
|
) |
| |
If some operations in _apply method depend only on the input,
not on recurrent states, they could be computed in advance.
model: CNNModelHelper object new operators would be added to
input_blob: either the whole input sequence with shape
(sequence_length, batch_size, input_dim) or a single input with shape
(1, batch_size, input_dim).
Definition at line 98 of file rnn_cell.py.