The notebook provides an introduction to Transformer Network (TF).
The aim of this homework is to guide students through an implementation of the architecture studied in class.
It is also interesting to see the versatility of the Transformer on a practical Computer Vision case as an alternative to the original NLP field.
The deadline for the homework is at 23:59 of 17/11/22 (GMT+2)
The students can organize and submit the work in group of 2-4 people.
Before the deadline you can submit the code at: [email protected]
⚠️ Note: for each day of delay a penalization of 2 points on the grade will be applied
The point assigned for each exercise is specified in the headers. The total for the theory part is 12 points and for the practice 18 + 5 bonus.
The 5 bonus points will be considered only if you'll achieve at least 25 points out of the other 30 available.
-
TF4AML_theory.ipynb
notebook contains exercises to guide the students through the implementation of TF fundamental blocks; -
TF4AML_practice.ipynb
notebook contains exercises for a Computer Vision research application. See paper (Under the Hood of Transformer Networks for Trajectory Forecasting)[https://arxiv.org/abs/2203.11878]; -
dataset
folder has all the ETH/UCY data used as trajectory forecasting benchmark; -
transformer
folder includes all the necessary file to build TF and experiment with the benchmark. The code is inspired by the original Hugging code of 2018.
We recommend to use GPU acceleration.
Then Google colab is a good solution to use free one or alternatively use your own hardware.
In this case we suppose you already have Anaconda installed for the environment.
a. Run from Google Colab
:
-
Open a new colab notebook (this will be needed only for the setup and then can be removed).
-
Clone the repo running command in the first cell:
!git clone https://github.com/FraLuca/TF4AML.git
- Synchronize with google drive to save all the changes and model checkpoints/outputs (copy those 2 lines in the second cell):
from google.colab import drive
drive.mount('/content/drive', force_remount=True)
- Move folder to main drive folder (copy this line in the third cell):
!mv /content/TF4AML /content/drive/MyDrive/
-
Open Google Drive.
-
Now you should find the folder TF4AML in the drive and start opening the theory notebook with colab.
-
After you open the notebook, activate the GPU (Runtime > Change runtime type > GPU > Save) and start following instructions!
-
Once you are done with the theory part do the same with practice notebook.
b. Run from Local
:
- Open terminal and run:
git clone https://github.com/FraLuca/TF4AML.git
- Install the environment with
conda env create -f environment.yml
- Open new terminal and activate new environment with:
conda activate aml
- From the same terminal (and environment) run jupyter notebook with:
jupyter notebook
-
Start opening the theory notebook and complete it following the instruction.
-
Once you are done with the theory part do the same with practice notebook.