This repository contains the implementation of our project titled 'Comparison of Attention Mechanisms in Machine Learning Models for Vehicle Routing Problems' (TensorFlow2).
This work was done as a final year project under the guidance of Dr. Georg Gutjahr".
- AM-D for VRP Report.ipynb - demo report notebook
- enviroment.py - enviroment for VRP RL Agent
- layers.py - MHA layers for encoder
- attention_graph_encoder.py - Graph Attention Encoder
- reinforce_baseline.py - class for REINFORCE baseline
- attention_dynamic_model_x-head(s).py - main model and decoder with x number of head(s)
- train.py - defines training loop which we use in train_model.ipynb
- train_model.ipynb - from this file one can start training or continue training from chechpoint
- utils.py and utils_demo.py - various auxiliary functions for data creation, saving and visualisation
- lkh3_baseline folder - everything for running LKH algorithm + logs.
- results folder: folder name is ADM_VRP_{graph_size}_{batch_size}. There are training logs, learning curves and saved models in each folder
- Open train_model.ipynb and choose training parameters and choose the required number of heads by editing the file name at 'from attention_dynamic_model' .
- All outputs would be saved in current directory.
Majority of this code has been fetched from a publicly available repository of The Dynamic Attention Model