Model Pipeline - GRU for text
This pipeline uses a GRU (Gated Recurrent Unit) model to understand and predict text sequences. It processes text data step-by-step, learns patterns, and improves predictions over time.
Jump into concepts and practice - no test required
This pipeline uses a GRU (Gated Recurrent Unit) model to understand and predict text sequences. It processes text data step-by-step, learns patterns, and improves predictions over time.
2.3 |*
2.0 | *
1.7 | *
1.4 | *
1.1 | *
0.8 | *
+----------
1 2 3 4 5
Epochs
| Epoch | Loss ↓ | Accuracy ↑ | Observation |
|---|---|---|---|
| 1 | 2.30 | 0.15 | Model starts learning, loss high, accuracy low |
| 2 | 1.85 | 0.30 | Loss decreases, accuracy improves |
| 3 | 1.50 | 0.45 | Model captures more patterns |
| 4 | 1.20 | 0.58 | Steady improvement in predictions |
| 5 | 1.00 | 0.65 | Model converging well |
import torch import torch.nn as nn gru = nn.GRU(input_size=10, hidden_size=20, batch_first=True) input = torch.randn(5, 7, 10) # batch=5, seq_len=7, input_size=10 output, hidden = gru(input) print(output.shape)
gru = nn.GRU(input_size=50, hidden_size=100) input = torch.randn(32, 10, 100) # batch=32, seq_len=10, input_size=100 output, hidden = gru(input)What is the likely cause of the error?