Train and evaluate a simple CNN on CIFAR-10 using PyTorch.
-
Clone the repository:
git clone <repo-url> cd inmindCNN
-
Install the uv Python package manager (faster than pip):
pip install uv
-
Install all dependencies defined in
pyproject.toml:uv sync
-
Edit
config.yamlfor hyperparameters and paths if needed.val_splitcontrols the fraction of training data used for validation (default: 0.1).
-
Run training: Run inside uv venv:
uv run train.py
- Uses GPU if available
- CIFAR-10 is auto-downloaded to
data/cifar10/ - Model weights saved to
weights/checkpoint.pthby default. - After each epoch, validation loss and accuracy are reported.
- A portion of the training set is used for validation (see
val_splitin config). - After each epoch, validation loss and accuracy are printed.
- Final test loss and accuracy are printed after training.