This project implements several sequence prediction models with PyTorch. The task is to predict formaldehyde concentration based on time.
-
Clone the repository:
git clone https://github.com/donglinkang2021/simple-sequence-prediction.git cd simple-sequence-prediction -
Install the required dependencies:
python3 -m venv venv source venv/bin/activate pip install -r requirements.txt
To train the model, run the following command:
# recommend to remove all logs before running
# rm -rf logs # remove all logs
# also recommend use tmux to run the following scripts
bash scripts/run_lstm.sh # simple baseline
bash scripts/run_att.sh # attention mechanism
bash scripts/run_att_mh.sh # multi-head attention mechanism
bash scripts/run_vq.sh # vector quantization mlp
bash scripts/run_vq_mh.sh # vector quantization multi-head mlp
tensorboard --logdir=logs --bind_all # start tensorboard
python scripts/search_tb_event.py # search the best result from tensorboard event filesIf you want to train on multi-windows using tmux(multi GPU) once, you can refer to the following command:
bash scripts/run_tmux.shYou can copy the best model name to scripts/predict.sh, run the following command:
bash scripts/predict.sh
# or just run the following command
python predict.py --model_name att_mh_y_w_ts112_lr0.0003/2025-01-10-23-15-54This project is licensed under the MIT License.
