← all repositories
aaron-xichen/pytorch-playground

A PyTorch beginner kit that doubles as a quantization torture test

It hands PyTorch beginners pretrained models and datasets, then lets them experiment with aggressive quantization to see exactly where accuracy collapses.

pytorch-playground
Not currently ranked — collecting fresh signals.
star history

What it does The repo bundles pretrained CNNs—AlexNet through ResNet and Inception—and dataset loaders for MNIST, CIFAR, STL10, and ImageNet into a single importable playground. It also ships a quantization demo that squeezes weights, activations, and batch-norm statistics down to arbitrary bit widths using linear, minmax, log, or tanh methods. A published accuracy table shows the carnage in detail: under linear quantization, 8-bit ResNet50 holds 72.54% top-1 on ImageNet, but crank it to 6-bit and it craters to 2.43%.

The interesting bit What sets it apart from a typical tutorial repo is a full benchmark matrix for linear quantization across fifteen architecture-dataset pairs, effectively documenting exactly how low you can push bit width before accuracy collapses. The ImageNet validation set is also provided as a pre-cropped, compressed pickle so preprocessing is frozen—though converting it requires 48 GB of RAM.

Key highlights

  • One-liner model selection via utee.selector that auto-downloads both the dataset and pretrained weights.
  • Quantization CLI supports independent bit-width controls for parameters, activations, and batch-norm running statistics.
  • Published accuracy table for linear quantization from 32-bit float down to 6-bit across fifteen model and dataset combinations.
  • ImageNet validation data shipped as a pre-cropped, compressed pickle to eliminate preprocessing variance.
  • ImageNet baselines are pulled directly from torchvision, so the 32-bit results are comparable to standard references.

Caveats

  • Decompressing the provided ImageNet validation pickle requires 48 GB of memory, a steep ask for a repo aimed at beginners.
  • The quantize.py argument table lists resent18 and resent34, suggesting the docs have not been closely maintained.
  • Only linear quantization accuracy is tabulated; the other supported methods—minmax, log, and tanh—are mentioned but not benchmarked in the README.

Verdict Worth a look if you want pretrained PyTorch baselines you can immediately stress-test with low-bit quantization. If you need a maintained production toolkit or modern architectures, this is a sandbox, not a framework.

Frequently asked

What is aaron-xichen/pytorch-playground?
It hands PyTorch beginners pretrained models and datasets, then lets them experiment with aggressive quantization to see exactly where accuracy collapses.
Is pytorch-playground open source?
Yes — aaron-xichen/pytorch-playground is open source, released under the MIT license.
What language is pytorch-playground written in?
aaron-xichen/pytorch-playground is primarily written in Python.
How popular is pytorch-playground?
aaron-xichen/pytorch-playground has 2.7k stars on GitHub.
Where can I find pytorch-playground?
aaron-xichen/pytorch-playground is on GitHub at https://github.com/aaron-xichen/pytorch-playground.

heatdrop uses Google Analytics to see which pages get read — nothing else. Your call. How we handle data.