{"id":22051611,"url":"https://github.com/parlaynu/cifar-10-100","last_synced_at":"2026-04-30T18:32:00.765Z","repository":{"id":155555093,"uuid":"591179118","full_name":"parlaynu/cifar-10-100","owner":"parlaynu","description":"Pytorch based tools for experimenting with the cifar-10 and cifar-100 datasets","archived":false,"fork":false,"pushed_at":"2023-07-19T22:38:34.000Z","size":447,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-23T15:34:16.563Z","etag":null,"topics":["cifar-10","cifar-100","generators","python","pytorch"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/parlaynu.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-01-20T05:15:11.000Z","updated_at":"2023-05-01T22:55:37.000Z","dependencies_parsed_at":null,"dependency_job_id":"2e7646c6-d7fc-4b2d-aa44-7180a48ebfa1","html_url":"https://github.com/parlaynu/cifar-10-100","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/parlaynu/cifar-10-100","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parlaynu%2Fcifar-10-100","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parlaynu%2Fcifar-10-100/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parlaynu%2Fcifar-10-100/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parlaynu%2Fcifar-10-100/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/parlaynu","download_url":"https://codeload.github.com/parlaynu/cifar-10-100/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parlaynu%2Fcifar-10-100/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32473804,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-30T13:12:12.517Z","status":"ssl_error","status_checked_at":"2026-04-30T13:12:06.837Z","response_time":57,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cifar-10","cifar-100","generators","python","pytorch"],"created_at":"2024-11-30T15:09:56.203Z","updated_at":"2026-04-30T18:32:00.751Z","avatar_url":"https://github.com/parlaynu.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CIFAR 10/100 Experiments\n\nA simple setup using [pytorch](https://pytorch.org/) to experiment with the CIFAR 10/100 datasets.\n\n* https://www.cs.toronto.edu/~kriz/cifar.html\n\n\n## Quick Start\n\nDownload the datesets and expand:\n\n    mkdir -p ~/Projects/datasets\n    cd ~/Projects/datasets\n\n    wget https://www.cs.toronto.edu/~kriz/cifar-10-python.tar.gz\n    tar xzf cifar-10-python.tar.gz\n    mv cifar-10-batches-py cifar-10\n\n    wget https://www.cs.toronto.edu/~kriz/cifar-100-python.tar.gz\n    tar xzf cifar-100-python.tar.gz\n    mv cifar-100-python cifar-100\n\nClone this repository:\n\n    cd ~/Projects\n    git clone https://github.com/parlaynu/cifar-10-100\n    cd cifar-10-100\n\nCreate python virtual environment and install required packages:\n\n    python3 -m venv pyenv\n    source pyenv/bin/activate\n\n    pip install -r requirements.txt\n\nYou can now run some tools:\n\n    ./find-lr.py -w 2 -e 4 -b 64 -f 0.01 mobilenet_v3_large ~/Projects/datasets/cifar-100\n    ./train.py -w 2 -e 75 -b 64 --lr 0.0001 mobilenet_v3_large ~/Projects/datasets/cifar-100\n\nTo view the logs:\n\n    tensorboard --bind_all --logdir snapshots\n\n\n## Tools\n\nThe tools are based around building a pipeline of generators chained together with each node performing\na well defined function. To see it in action, see the functions `build_train_pipeline` and `build_vdate_pipeline`\nin the file `train.py`. It's all pretty easy to follow and understand... at least I think it is.\n\n### Training\n\nThe tool for training is `train.py`.\n\n    $ ./train.py -h\n    usage: train.py [-h] [-c] [-w NUM_WORKERS] [-e NUM_EPOCHS] [-b BATCH_SIZE] [--mx MX] [--ls LS] [--gcv GCV]\n                    [--gmn GMN] [--lr LR] [--wd WD] [--grad-stats]\n                    model dsroot\n                    \n    positional arguments:\n      model                 the model type to use\n      dsroot                path to the cifar-10 or cifar-100 dataset\n      \n    options:\n      -h, --help            show this help message and exit\n      -c, --use-cpu         use the CPU even if there is a GPU\n      -w NUM_WORKERS, --num-workers NUM_WORKERS\n                            number of workers to use\n      -e NUM_EPOCHS, --num-epochs NUM_EPOCHS\n                            number of epochs\n      -b BATCH_SIZE, --batch-size BATCH_SIZE\n                            batch size\n      --mx MX               mixup augmentation probability\n      --ls LS               label smoothing for loss function\n      --gcv GCV, --grad-clip-value GCV\n                            gradient value clipping\n      --gmn GMN, --grad-max-norm GMN\n                            gradient norm clipping\n      --lr LR               learning rate for the optimizer\n      --wd WD               weight decay for the optimizer\n      --grad-stats          collect and report gradient stats\n\nThe model types supported can be seen in the file `lib/models/utils.py`.\n\nThe training output is written to tensorboard files in a subdirectory of `snapshots`. The files written \nthere are:\n\n* the full command line used to invoke train.py - command.txt\n* the tensorboard log file\n* a checkpoint of the model weights at the end of training\n\nThe checkpoint file contains enough information to run the report generator. \n\n### Find Learning Rate\n\nThe tool `find-lr.py` implements an algorithm based on the \"LR Range Test\" from the paper\n[Cyclical Learning Rates for Training Neural Networks](https://arxiv.org/abs/1506.01186) written by Leslie N. Smith \n\n\n    $ ./find-lr.py -h\n    usage: find-lr.py [-h] [-c] [-w NUM_WORKERS] [-e NUM_EPOCHS] [-b BATCH_SIZE] [-i INITIAL_LR] [-f FINAL_LR]\n                      model dsroot\n                      \n    positional arguments:\n      model                 the model type to use\n      dsroot                path to the cifar-10 or cifar-100 dataset\n      \n    options:\n      -h, --help            show this help message and exit\n      -c, --use-cpu         use the CPU even if there is a GPU\n      -w NUM_WORKERS, --num-workers NUM_WORKERS\n                            number of workers to use\n      -e NUM_EPOCHS, --num-epochs NUM_EPOCHS\n                            number of epochs\n      -b BATCH_SIZE, --batch-size BATCH_SIZE\n                            batch size\n      -i INITIAL_LR, --initial-lr INITIAL_LR\n                            initial learning rate\n      -f FINAL_LR, --final-lr FINAL_LR\n                            final learning rate\n\n\n### Reporting\n\nThe tool `report.py` proceses the training checkpoing data and generates a csv with the details results\nof using the model on the test data.\n\n    $ ./report.py  -h\n    usage: report.py [-h] [-c] [-w NUM_WORKERS] [-b BATCH_SIZE] state_file dsroot\n    \n    positional arguments:\n      state_file            the model state to load\n      dsroot                path to the cifar-10 or cifar-100 dataset\n      \n    options:\n      -h, --help            show this help message and exit\n      -c, --use-cpu         use the CPU even if there is a GPU\n      -w NUM_WORKERS, --num-workers NUM_WORKERS\n                            number of workers to use\n      -b BATCH_SIZE, --batch-size BATCH_SIZE\n                            batch size\n\n### Data Statistics\n\nThe script `dset-info.py` was used to get the mean and std of the datasets which is used for normalizing the\ndata in the data training pipeline.\n\n    $ ./dset-info.py  -h\n    usage: dset-info.py [-h] dsroot\n    \n    positional arguments:\n      dsroot      path to the cifar-10 or cifar-100 dataset\n      \n    options:\n      -h, --help  show this help message and exit\n\nThe results from this have been incorporated into the dataset classes for each dataset and are automatically\nused by the trainer.\n\n\n## Logging\n\nLogging of results is done using tensorboard. Typical usage is like this:\n\n    tensorboard --bind_all --logdir snapshots\n\nThe `snapshots` directory will be created in the directory where you run the tools.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparlaynu%2Fcifar-10-100","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fparlaynu%2Fcifar-10-100","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparlaynu%2Fcifar-10-100/lists"}