Model Pipeline - Sequence-to-sequence architecture
This pipeline uses a sequence-to-sequence model to convert one sequence of words into another. It is often used for tasks like language translation or text summarization.
Jump into concepts and practice - no test required
This pipeline uses a sequence-to-sequence model to convert one sequence of words into another. It is often used for tasks like language translation or text summarization.
Loss
2.5 |****
2.0 |***
1.5 |**
1.0 |*
0.5 |
+------------
1 2 3 4 5 Epochs
| Epoch | Loss ↓ | Accuracy ↑ | Observation |
|---|---|---|---|
| 1 | 2.3 | 0.30 | Model starts learning, loss high, accuracy low |
| 2 | 1.8 | 0.45 | Loss decreases, accuracy improves |
| 3 | 1.4 | 0.58 | Model learns better sequence patterns |
| 4 | 1.1 | 0.68 | Loss continues to decrease steadily |
| 5 | 0.9 | 0.75 | Good convergence, accuracy improving |
encoded = encoder(input_sequence) output = decoder(encoded) print(len(output))If the input sequence length is 5 and the model is trained to translate to a sequence of length 7, what will
len(output) print?for input_seq, target_seq in dataset:
encoded = encoder(input_seq)
output = decoder(encoded)
loss = loss_function(output, target_seq)
loss.backward()
optimizer.step()
optimizer.zero_grad()
What is the likely error in this code?