A project for the COMP 472 course at Concordia University
Member | GitHub |
---|---|
Thanh Ta | mth-1012 |
Madline Nessim | madeleine341 |
Lam Tran | linchen2508 |
Hung Cai | Pro-vo-ker |
(soon)
main.py is where we load the dataset, transform it, and then feed it to our model to train
CNN.py is the convolutional neural network model that studies and analyzes the dataset
evaluator.py is where the evaluator functions are stored, including train/test split, k-fold cross-validation and single evaluation (to be added); bias evaluation is in the code but commented out
Create an Anaconda environment with Python 3.9.
Using Anaconda, install the following before running.
conda install pytorch torchvision torchaudio -c pytorch
If you want to utilize cuda, install cudatoolkit.
conda install cudatoolkit=11.0
Continue to install matplotlib for graph plotting and scikit-learn wrapper.
pip install matplotlib skorch
Make sure jupyter notebook is installed before running the notebook file.
The folder "old" contains the old version of main and evaluator, where we didn't utilize scikit-learn
There are two ways to test run, pure Python or Jupyter Notebook environment
Run the main.py with the IDE or in the console, enter
python main.py
After the training finishes, a train/test split (75-25) evaluation is automatically called and the result will be shown. It should be similar to this
Model saved
==== Predict ====
Accuracy for Test (25%) Dataset: 80.55%
For further evaluation, run the evaluator.py with the IDE or in the console, enter
python evaluator.py
(to be updated, you know what to do anyway)
If the error
OMP: Error #15: Initializing libiomp5md.dll, but found mk2iomp5md.dll already initialized.
is shown when running the evaluator.py, add
import os
os.environ['KMP_DUPLICATE_LIB_OK']='True'
to the appropriate position in main.py.
SliceDataset is not working in the notebook. K-fold cross-validation is not usable.