This repository have the code used for ESE650 Final Project for group 19
- Run in terminal pip install -r requirements.txt∂
Before training, is needed to process the raw data:
- Raw data can be downloaded from this drive link
- Run the prepare_data script to transform and split your data.
- It will output a train and val folder used by train.py to train the model. The processed data is divided in shards to avoid memory overflow.
- Example:
python prepare_data.py --input path/to/raw_data --outdir path/to/processed_data --shard-size desired (trajs in each shard) --gamma (discount factor when calculating the returns)
Script to train the models:
- Run the train script.
- It will save the models weights to a model/(td0 or mc)/.. folder
- Example:
python train.py --shards path/to/processed_data --epochs (max number of epochs) --target (mc for montecarlo, td0 for TD(0)) --trials (numbr of trials on optuna gridsearch) --device (cpu/gpu)
Script to evaluate the model
- Python notebook that loads the model and an event and calculates the return for passes, shot and dribbles
- We provide one trained models in models_example. Also, we provide an example processed shard here which can be downloaded and put in folder data_example to be able to run the eval.ipynb out of the box without processing data or training a model.