Skip to content

FraLuca/TF4AML

Repository files navigation

This is the official repository for the AML 2022/23 class at Sapienza University of Rome

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.

Deadline and Submission

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

Assignment Evaluation

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.

Files structure

  • 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.

How to run

Select hardware

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:

  1. Open a new colab notebook (this will be needed only for the setup and then can be removed).

  2. Clone the repo running command in the first cell:

!git clone https://github.com/FraLuca/TF4AML.git

  1. 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)

  1. Move folder to main drive folder (copy this line in the third cell):

!mv /content/TF4AML /content/drive/MyDrive/

  1. Open Google Drive.

  2. Now you should find the folder TF4AML in the drive and start opening the theory notebook with colab.

  3. After you open the notebook, activate the GPU (Runtime > Change runtime type > GPU > Save) and start following instructions!

  4. Once you are done with the theory part do the same with practice notebook.

b. Run from Local:

  1. Open terminal and run:

git clone https://github.com/FraLuca/TF4AML.git

  1. Install the environment with

conda env create -f environment.yml

  1. Open new terminal and activate new environment with:

conda activate aml

  1. From the same terminal (and environment) run jupyter notebook with:

jupyter notebook

  1. Start opening the theory notebook and complete it following the instruction.

  2. Once you are done with the theory part do the same with practice notebook.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published