This repository contains the code and scripts required to train a simple MNist model for hand writing character recognition.
- Getting Started
- Repository Structure
- Training Script Details
- Usage
- Monitoring Training
- Output
- Authors
tf.keras.datasets.mnist
: dataset of labeled hand writing characters.mnist-job.sh
: Slurm script for training the BERT model to be run on the Yens.mnist-train.py
: Python script to train the model on Yen's GPU node.
The training script train-finbert.py
performs the following:
- Defines a custom dataset to read in financial news texts and their labels.
- Utilizes the BERT model from the
transformers
library for sentiment analysis. - Trains the model using PyTorch Lightning's Trainer on Yen's GPU.
Modify the Slurm script to include your email address. Slurm will report useful metrics via email such as queue time, runtime, CPU and RAM utilization and will alert you if the job has failed.
Submit the Slurm script to initiate the model training on gpu
partition on the Yens:
$ sbatch mnist-job.sh
Monitor the training progress by checking the Slurm queue for your username:
$ squeue -u $USER
$ sacct -j 3
Instructions for monitoring GPU utilization and other training metrics.
login to compute nodes
$ nvtop
After the training is complete, check the output file finBERT-train.out
for training and evaluation metrics:
$ cat mnist-train.output