Skip to content
kyranhsiaoPublic

About

A manually implemented ResNet-18 network under the PyTorch framework for the CIFAR-10 dataset.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

7 Commits

Folders and files

Repository files navigation

ResNet-18 based on PyTorch

A manually implemented ResNet-18 network under the PyTorch framework for the CIFAR-10 dataset.

Directory Structure

├── data.py          # CIFAR-10 dataset loading and preprocessing
├── models.py        # Manual implementation of ResNet-18
├── train.py         # Training and evaluation pipeline
├── README.md        # Project documentation
├── checkpoints/     # Saved model checkpoints
└── logs/            # TensorBoard training logs

Environment Setup

The implementation does not rely on any version-specific features and should work with most recent Python and PyTorch releases. The project was developed and tested with:

  • Python 3.10.20
  • PyTorch 2.12.0 + cu126
  • Installation:
conda create -n resnet python==3.10.20
·····
conda activate resnet
pip3 install torch torchvision --index-url https://download.pytorch.org/whl/cu126

Usage

Dataset Preparation

Download CIFAR-10 dataset and extract it to:

path/to/cifar-10-batches-py

Training and Evaluation

Run the experiment script:

bash run_exp.sh

Two experiments will be executed on separate GPUs: one with residual connections and one without.

Visualization

All training logs are stored in logs/. Launch TensorBoard with:

tensorboard --logdir logs

ResNet18 Training & Validation Loss

ResNet18 Training & Validation Accuracy

Plain Network Training & Validation Loss

Plain Network Training & Validation Accuracy

About

A manually implemented ResNet-18 network under the PyTorch framework for the CIFAR-10 dataset.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Contributors

Languages