• Long-Short Term Memory layer - Hochreiter 1997.

    This is an RNN layer consisting of one LSTMCell. However, unlike the underlying LSTMCell, the apply method of LSTM operates on a sequence of inputs. The shape of the input (not including the first, batch dimension) needs to be at least 2-D, with the first dimension being time steps. For example:

    const lstm = tf.layers.lstm({units: 8, returnSequences: true});

    // Create an input with 10 time steps.
    const input = tf.input({shape: [10, 20]});
    const output = lstm.apply(input);

    console.log(JSON.stringify(output.shape));
    // [null, 10, 8]: 1st dimension is unknown batch size; 2nd dimension is the
    // same as the sequence length of `input`, due to `returnSequences`: `true`;
    // 3rd dimension is the `LSTMCell`'s number of units.

    @doc {heading: 'Layers', subheading: 'Recurrent', namespace: 'layers'}

    Parameters

    • args: LSTMLayerArgs

    Returns LSTM

Generated using TypeDoc