We provide the start code under ./src
folder for this homework.
You need to modify model.py
and main.py
to construct and train your model.
For model.py
, we have provided the definition of RNN encoder and decoder. You need to add your RNN and Transformer model codes.
For main.py
, we have provided the dataloader to pre-process text data into tokens. You can use the data_loader.get_batch()
to get a mini-batch of data. Before using the loader, you need to set the train
and valid
flags. Details are in data.py
.
You need to write model building code, the evaluation function and train function in main.py
.
You also need to complete mha.py
and you can check if you implement multi-head attention correctly by directly running:
python mha.py