In this coding assignment, we need to implement the deep neural network by any deep learning framework, e.g., Pytorch, TensorFlow, or Keras, then train the DNN model by the Cifar-10 dataset and try to beat the baseline performance.
This repository use CaiT model of PyTorch Image Models (timm) and SGD optimizer.
Ubuntu 18.04.5 LTS
Intel® Core™ i7-3770 CPU @ 3.40GHz × 8
GeForce GTX 1080/PCIe/SSE2
You can just use this command:
conda env create -f environment.yml
or the following commands:
conda create -n PRenv
conda activate PRenv
conda install pytorch=1.10.0 torchvision=0.11.1 -c pytorch
conda install matplotlib
conda install tqdm
pip install sklearn
pip install timm
The repository structure is:
Deep-Neural-Network(root)
+-- x_test.npy # testing data
+-- x_train.npy # training data
+-- y_test.npy # testing label
+-- x_test.npy # training label
+-- HW5.pdf
+-- HW5.py
+-- best.pt # model weight
+-- environment.yml
To train the model, you need modify the 'TRAIN' parameter to True of HW5.py, and then run this command:
python HW5.py
Need your best.pt (model weight) and the four npy files of the dataset, and just run this command:
python HW5.py
Our model achieves 0.9734
[1] PyTorch Image Models (timm)
[2] PyTorch Tutorial