🔁
Bidirectional GRU (biGRU)
Bidirectional GRU (biGRU) is a type of recurrent neural network that processes data in both forward and backward directions, capturing context from both past and future time steps. It is especially useful for time series forecasting and sequence modeling tasks where context from both directions improves performance.
Key Features
- Captures dependencies in both directions (past and future).
- Efficient and less complex than LSTM.
- Handles long-term dependencies better than vanilla RNNs.
- Widely used in time series, NLP, and speech recognition.
Architecture
Illustrative Architecture (SVG)
Python Example (Keras)
from tensorflow.keras.models import Sequential from tensorflow.keras.layers import Bidirectional, GRU, Dense model = Sequential([ Bidirectional(GRU(64, return_sequences=True), input_shape=(timesteps, features)), Bidirectional(GRU(32)), Dense(1) ]) model.compile(optimizer='adam', loss='mse') model.summary()
Use Cases
- Time series forecasting (stock prices, weather, etc.)
- Natural language processing (NLP)
- Speech recognition
- Anomaly detection in sequences