How ahmadrezafarvardin/resnet18-cifar10 works
This repository trains a CIFAR-10 image classifier and supports checkpoint resume, standalone evaluation with per-class accuracy, and plotting saved training history. The main workflow is CLI → Trainer: load augmented data, run training and test evaluation through the CIFAR-adapted ResNet-18, then save model state and metrics. Standalone evaluation loads the best model and reports class-level results. Relationships reflect the sampled Python entry points; the README describes an interactive notebook, but its implementation was not sampled.
Main entry points: train.py Trainer · evaluate.py Evaluation CLI · main.py Training CLI · model.py ResNet-18
Components 17
Training workflow
- Training CLI
main.py - Trainer
train.py - Epoch training
train.py - Epoch validation
train.py - CIFAR loaders
data.py
Model architecture
- ResNet factory
model.py - ResNet-18
model.py - Residual blocks
model.py
Evaluation and plots
- Evaluation CLI
evaluate.py - Class analysis
evaluate.py - Result plots
utils.py
Configuration and state
- Hyperparameters
config.py - Training utilities
utils.py - Checkpoint files
checkpoints - Training history
results
Other components
- CLI user
- CIFAR-10
Connections 27
- CLI user → Training CLI: runs
- Training CLI → Hyperparameters: reads settings
- Training CLI → Trainer: starts training
- Training CLI → Result plots: plots history
- Trainer → Hyperparameters: reads settings
- Trainer → Training utilities: seeds and checkpoints
- Trainer → CIFAR loaders: gets loaders
- CIFAR loaders → CIFAR-10: loads
- Trainer → ResNet factory: creates model
- ResNet factory → ResNet-18: constructs
- ResNet-18 → Residual blocks: builds stages
- Trainer → Epoch training: runs each epoch
- Trainer → Epoch validation: validates each epoch
- Epoch training → ResNet-18: forwards batches
- Epoch validation → ResNet-18: forwards batches
- Trainer → Checkpoint files: saves and resumes
- Training utilities → Checkpoint files: reads and writes
- Trainer → Training history: writes metrics
- Training CLI → Training history: loads history
- CLI user → Evaluation CLI: runs
- Evaluation CLI → Hyperparameters: reads settings
- Evaluation CLI → ResNet factory: creates model
- Evaluation CLI → Checkpoint files: loads best weights
- Evaluation CLI → CIFAR loaders: gets test loader
- Evaluation CLI → Class analysis: runs analysis
- Class analysis → ResNet-18: predicts batches
- Evaluation CLI → Result plots: plots class accuracy