← Open Source
aaron-xichen

pytorch-playground

Base pretrained models and datasets in pytorch (MNIST, SVHN, CIFAR10, CIFAR100, STL10, AlexNet, VGG16, VGG19, ResNet, Inception, SqueezeNet).

TutorialsGetting startedPython
Open on GitHub
Momentum
+0stars in 24 hours0.0%
2.72k
Stars
617
Forks
+1
This week
2
Contributors
Created 2017-04-28 · Updated 2026-10-13 · #8405 today
Top developers
aaron-xichengussmith23

aaron-xichen/pytorch-playground is ranked 8,405 with 2,723 stars.

Same-category comparison

aaron-xichen/pytorch-playground is ranked 8,405 among these 8 peers; taki0112/Tensorflow-Cookbook is ranked 8,398.

Same-category comparison
NameRankMetrics
RedstoneWill/HsuanTienLin_MachineLearning8,374
Stars:
2,780
Forks:
839
FurkanGozukara/Stable-Diffusion8,375
Language:
Jupyter Notebook
Stars:
2,779
Forks:
373
Description:
FLUX, Stable Diffusion, SDXL, SD3, LoRA, Fine Tuning, DreamBooth, Training, Automatic1111, Forge WebUI, SwarmUI, DeepFake, TTS, Animation, Text To Video, Tutorials, Guides, Lectures, Courses, ComfyUI, Google Colab, RunPod, Kaggle, NoteBooks, ControlNet, TTS, Voice Cloning, AI, AI News, ML, ML News, News, Tech, Tech News, Kohya, Midjourney, RunPod.
brennercruvinel/CCPlugins8,380
Language:
Python
Stars:
2,775
Forks:
165
Description:
Best Claude Code framework that actually save time. Built by a dev tired of typing "please act like a senior engineer" in every conversation.
taki0112/Tensorflow-Cookbook8,398
Language:
Python
Stars:
2,741
Forks:
459
Description:
Simple Tensorflow Cookbook for easy-to-use.
mfrdixon/ML_Finance_Codes8,414
Language:
Jupyter Notebook
Stars:
2,710
Forks:
649
Description:
Machine Learning in Finance: From Theory to Practice Book.
echonoshy/cgft-llm8,420
Language:
Jupyter Notebook
Stars:
2,701
Forks:
352
Description:
Practice to LLM.
michaelgutmann/ml-pen-and-paper-exercises8,428
Language:
TeX
Stars:
2,692
Forks:
236
Description:
Pen and paper exercises in machine learning.
llSourcell/Learn_Deep_Learning_in_6_Weeks8,456
Stars:
2,649
Forks:
841
Description:
This is the Curriculum for "Learn Deep Learning in 6 Weeks" by Siraj Raval on Youtube.
Key parameters and specifications
Key parameters and specifications
ParameterValue
LanguagePython
CategoryTutorials
SubcategoryGetting started
Stars2,723
Forks617
Contributors2
Created date2017-04-28
Updated date2026-10-13
Stars in 1 day0
Stars in 7 days1
Rank8,405
Previous rank8,465
Rank change60
7-day stars rank9,307
Previous 7-day stars rank9,361
7-day stars rank change54
Total stars rank4,935
Previous total stars rank4,928
Total stars rank change-7
CountryChina
README summary

This is a playground for pytorch beginners, which contains predefined models on popular dataset. Currently we support mnist, svhn cifar10, cifar100 stl10 alexnet vgg16, vgg16_bn, vgg19, vgg19_bn resnet18, resnet34, resnet50, resnet101, resnet152 squeezenet_v0, squeezenet_v1 inception_v3 Here is an example for MNIST dataset. This will download the dataset and pre-trained model automatically. Also, if want to train the MLP model on mnist, simply run Install ImageNet dataset We provide precomputed imagenet validation dataset with 224x224x3

size. We first resize the shorter size of image to 256, then we crop 224x224 image in the center. Then we encode the cropped images to jpg string and dump to pickle. Download the (Tsinghua / Google Drive) (needs 48G memory, thanks @jnorwood ) Quantization We also provide a simple demo to quantize these models to specified bit-width with several methods, including linear method, minmax method and non-linear method. Top1 Accuracy We evaluate the performance of popular dataset and models

with linear quantized method. The bit-width of running mean and running variance in BN are 10 bits for all results. 0|overflow rate threshold for linear quantization method| |n_samples|20|number of samples to make statistics for activation|

Frequently asked questions

How many stars and forks are recorded?

aaron-xichen/pytorch-playground has 2,723 stars and 617 forks.

What is the repository rank?

aaron-xichen/pytorch-playground is ranked 8,405.

What language and category are recorded?

aaron-xichen/pytorch-playground has 2,723 stars, uses Python and belongs to Tutorials.

Which repository is closest in rank?

aaron-xichen/pytorch-playground is compared with taki0112/Tensorflow-Cookbook, ranked 8,398 with 2,741 stars.

README

This is a playground for pytorch beginners, which contains predefined models on popular dataset. Currently we support

  • mnist, svhn
  • cifar10, cifar100
  • stl10
  • alexnet
  • vgg16, vgg16_bn, vgg19, vgg19_bn
  • resnet18, resnet34, resnet50, resnet101, resnet152
  • squeezenet_v0, squeezenet_v1
  • inception_v3

Here is an example for MNIST dataset. This will download the dataset and pre-trained model automatically.

import torch
from torch.autograd import Variable
from utee import selector
model_raw, ds_fetcher, is_imagenet = selector.select('mnist')
ds_val = ds_fetcher(batch_size=10, train=False, val=True)
for idx, (data, target) in enumerate(ds_val):
    data =  Variable(torch.FloatTensor(data)).cuda()
    output = model_raw(data)

Also, if want to train the MLP model on mnist, simply run python mnist/train.py

Install

python3 setup.py develop --user

ImageNet dataset

We provide precomputed imagenet validation dataset with 224x224x3 size. We first resize the shorter size of image to 256, then we crop 224x224 image in the center. Then we encode the cropped images to jpg string and dump to pickle.

Quantization

We also provide a simple demo to quantize these models to specified bit-width with several methods, including linear method, minmax method and non-linear method.

quantize --type cifar10 --quant_method linear --param_bits 8 --fwd_bits 8 --bn_bits 8 --ngpu 1

Top1 Accuracy

We evaluate the performance of popular dataset and models with linear quantized method. The bit-width of running mean and running variance in BN are 10 bits for all results. (except for 32-float)

Model 32-float 12-bit 10-bit 8-bit 6-bit
MNIST 98.42 98.43 98.44 98.44 98.32
SVHN 96.03 96.03 96.04 96.02 95.46
CIFAR10 93.78 93.79 93.80 93.58 90.86
CIFAR100 74.27 74.21 74.19 73.70 66.32
STL10 77.59 77.65 77.70 77.59 73.40
AlexNet 55.70/78.42 55.66/78.41 55.54/78.39 54.17/77.29 18.19/36.25
VGG16 70.44/89.43 70.45/89.43 70.44/89.33 69.99/89.17 53.33/76.32
VGG19 71.36/89.94 71.35/89.93 71.34/89.88 70.88/89.62 56.00/78.62
ResNet18 68.63/88.31 68.62/88.33 68.49/88.25 66.80/87.20 19.14/36.49
ResNet34 72.50/90.86 72.46/90.82 72.45/90.85 71.47/90.00 32.25/55.71
ResNet50 74.98/92.17 74.94/92.12 74.91/92.09 72.54/90.44 2.43/5.36
ResNet101 76.69/93.30 76.66/93.25 76.22/92.90 65.69/79.54 1.41/1.18
ResNet152 77.55/93.59 77.51/93.62 77.40/93.54 74.95/92.46 9.29/16.75
SqueezeNetV0 56.73/79.39 56.75/79.40 56.70/79.27 53.93/77.04 14.21/29.74
SqueezeNetV1 56.52/79.13 56.52/79.15 56.24/79.03 54.56/77.33 17.10/32.46
InceptionV3 76.41/92.78 76.43/92.71 76.44/92.73 73.67/91.34 1.50/4.82

Note: ImageNet 32-float models are directly from torchvision

Selected Arguments

Here we give an overview of selected arguments of quantize.py

Flag Default value Description & Options
type cifar10 mnist,svhn,cifar10,cifar100,stl10,alexnet,vgg16,vgg16_bn,vgg19,vgg19_bn,resent18,resent34,resnet50,resnet101,resnet152,squeezenet_v0,squeezenet_v1,inception_v3
quant_method linear quantization method:linear,minmax,log,tanh
param_bits 8 bit-width of weights and bias
fwd_bits 8 bit-width of activation
bn_bits 32 bit-width of running mean and running vairance
overflow_rate 0.0 overflow rate threshold for linear quantization method
n_samples 20 number of samples to make statistics for activation
Nearby in the ranking
Similar items