File size: 612 Bytes
9a41f63
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import torch

class Config:
    # Data
    data_path = "data/hindi_english_parallel.csv"
    train_ratio = 0.8
    
    # Preprocessing
    max_length = 20
    min_word_count = 3
    
    # Model
    embedding_dim = 256
    hidden_size = 512
    num_layers = 2
    dropout = 0.5
    
    # Training
    batch_size = 64
    learning_rate = 0.001
    epochs = 20
    teacher_forcing_ratio = 0.5

    max_vocab_english = 5000
    max_vocab_hindi = 10000
    max_length = 20  # Maximum sentence length
    
    # Device
    device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
    
config = Config()