🔁

Bidirectional LSTM (biLSTM)

Bidirectional LSTM (biLSTM) is a type of recurrent neural network that uses two LSTM layers: one processes the sequence forward, the other backward. This allows the model to capture information from both past and future time steps, making it powerful for sequence modeling and time series forecasting.

Key Features

Architecture

biLSTM: Forward & Backward Illustrative Architecture (SVG)

Python Example (Keras)

from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Bidirectional, LSTM, Dense

model = Sequential([
    Bidirectional(LSTM(64, return_sequences=True), input_shape=(timesteps, features)),
    Bidirectional(LSTM(32)),
    Dense(1)
])
model.compile(optimizer='adam', loss='mse')
model.summary()

Use Cases

References