Views
No views yet
| File | Description |
|---|---|
b23cs1061_ass_4_tuned_en_to_hi.ipynb | Main notebook — baseline + Ray Tune + Optuna + final comparison |
b23cs1061_ass_4_best_model.pth | Saved weights of the best-performing model from the tuning sweep |
b23cs1061_ass_4_report.pdf | 1–2 page report with baseline metrics, hyperparameter ranges, best config, and final results |
English-Hindi.tsv | Dataset — 13,186 English-Hindi sentence pairs |
| Metric | Value |
|---|---|
| Total Training Time | 02h 13m 50s (8030.2s) |
| Epochs | 100 |
| Final Training Loss | 0.0988 |
| BLEU Score (NLTK) | 69.39% |
| English | Hindi (Predicted) |
|---|---|
| I love you. | मुझे तुमसे प्यार है। |
| What is your name? | आपका नाम क्या है? |
| How are you? | आप कैसे हो? |
| The weather is nice today. | आज मौसम अच्छा सा है। |
| Hyperparameter | Search Range | API Used |
|---|---|---|
Learning Rate (lr) | 1e-5 to 1e-3 (log scale) | tune.loguniform() |
Batch Size (batch_size) | [16, 32, 64] | tune.choice() |
Attention Heads (num_heads) | [4, 8] | tune.choice() |
Feedforward Dim (d_ff) | [1024, 2048] | tune.choice() |
Dropout Rate (dropout) | 0.1 to 0.4 | tune.uniform() |
d_model=512, num_layers=6OptunaSearch (metric=loss, mode=min)ASHAScheduler (max_t=25, grace_period=5, reduction_factor=2) — early terminates underperforming trials1{
2 'lr': 0.00011477645445159093, # ~1.15e-4
3 'batch_size': 32,
4 'num_heads': 4,
5 'd_ff': 2048,
6 'dropout': 0.11420284465820767,
7 'd_model': 512,
8 'num_layers': 6,
9 'num_epochs': 25
10}| Metric | Baseline | Best Config (Ray Tune) |
|---|---|---|
| Training Time | 02h 13m 50s | 63.0 min |
| Epochs | 100 | 50 |
| Final Training Loss | 0.0988 | 0.1564 |
| BLEU Score (NLTK) | 69.39% | 73.70% |
73.70% BLEU in 50 epochs (63 min) vs 69.39% BLEU in 100 epochs (2h 13m)
lr≈1.15e-4 with batch=32 and low dropout (0.114) as a significantly better starting point than the hardcoded defaults; the model converges faster without sacrificing qualitynn.CrossEntropyLoss with <pad> ignored)b23cs1061_ass_4_tuned_en_to_hi.ipynb in Google ColabEnglish-Hindi.tsv in My Drive/