Closed
Description
As it was discussed in #16, RETURNN layers with (hidden) state (e.g. RecLayer
with unit="lstm"
) should make the state explicit in the API. E.g. the Rec
module should get two arguments input
and prev_state
and return output
and state
. So the usage would look like this in a loop:
lstm = Lstm(...)
with Loop() as loop:
...
out, loop.state.lstm = lstm(x, loop.state.lstm)
Or like this outside a loop (using default initial state, ignoring last state):
lstm = Lstm(...)
out, _ = lstm(x)
This applies for all RETURNN layers with rec hidden state, and further modules like Lstm
.
See RETURNN layers with rec hidden state.
Relevant modules here:
_Rec
based, e.g.Lstm
(only one so far)window
cumsum
ken_lm_state
edit_distance_table
unmask
_TwoDLSTM
cum_concat
Metadata
Metadata
Assignees
Labels
No labels