All models

mnist_cntk_convnet

The ONNX zoo's MNIST digit classifier: two 5x5 convolutions with max pooling from the CNTK 103D tutorial.

Image classification · 8 operations Checked

100%

Showing the top corner; full diagram not loaded yetShowing a small copy; full diagram not loaded yetLarge diagram, not loaded yet

Open SVG

Loading diagram (11 KB)

Open in a new tab

Click or tap a spot to read it up close. Scroll or drag inside the diagram to move through it. Zoom with + and − or Ctrl and scroll. Press 0 for the whole graph. Swipe inside the diagram to move through it. Use + and − to zoom.

At a glance

Parameters
6K
Operations
8
Framework
PyTorch
Recurrent
No
Published
2015
License
MIT
Checked
Passed: the trace was replayed operation by operation and matched the model's own output for this input.

Files

The diagram is a drawing of a TorchLens trace of the source code. It contains no code or weights.

Details
Stable ID
m7307
Graph hash
6a4a3129c6bf1085cc45b6a5de0fd788618050b27e121d92c9370561901c9c57
Skeleton hash
6008d8d1e86170251ab9fdab584e7f10aadd6ec5f86e3dc9d3f6114e7303d0b2
Architecture hash
686880f7bc6d46588422738e6d05999fe557273ae6a17e0de7a2415de9f079ad
Diagram SHA-256
2abbb635f676a7ed0ed4027e3a0431f29f3dab1350ffaefd14af62ca3c0107a4
TorchLens version
2.36.0
Renderer
graphviz 2.43.0+pyvips 3.2.0+libvips 8.18.7+render-opts@06c1f0d3
Check
Forward pass replayed in PyTorch

What it is

This is the little MNIST digit classifier from the ONNX model zoo, which predicts handwritten digits using a convolutional neural network. It was trained in CNTK following the tutorial CNTK 103D: Convolutional Neural Network with MNIST, and the specific architecture is the model with alternating convolution and max pooling layers found under the Solution section at the end of the tutorial. The tutorial's goal is to train a classifier that will identify the digits in the MNIST dataset, which has 60,000 training images and 10,000 test images with each image being 28 x 28 pixels.

The Solution model stacks a 5x5 convolution with 8 filters, 2x2 max pooling, a 5x5 convolution with 16 filters, 3x3 max pooling, and a dense layer of 10 outputs with no activation. The tutorial explains that a typical CNN contains a set of alternating convolution and pooling layers followed by a dense output layer for classification, and that pooling makes the model more tolerant to changes in object location in the image. Weights use Glorot uniform initialisation with relu activations, and because the softmax is combined with the cross entropy loss during training, the final dense layer has no activation function. The ONNX zoo accordingly describes the output as the likelihood of each number before softmax, with shape (1x10), and notes that the model takes one image at a time and doesn't support mini-batch.

Input is a (1x1x28x28) float32 tensor of a grayscale digit with a black background and a white foreground, scaled to [0.0, 1.0]. In the notebook, training runs 10 sweeps of SGD at learning rate 0.2 with minibatch size 64, and the pooled model reaches an average test error of 1.05%, against 1.57% for the convolution-only model earlier in the tutorial. The ONNX zoo lists mnist-1, mnist-7, mnist-8 and mnist-12 exports of this network, each with a 1.1% top-1 error.

Key idea. A two-stage convolution and max-pooling network from the CNTK 103D tutorial's Solution cell, exported to ONNX as the model zoo's MNIST digit classifier.

  • CNTK MNIST ConvNet
  • CNTK 103D
  • mnist_cntk_convnet
  • onnx mnist-8
  • mnist-8
  • mnist-1
  • mnist-7
  • mnist-12
  • MNIST
  • handwritten digit recognition
  • ONNX model zoo
  • CNTK tutorial convolutional neural network
  • digit classifier

AI-written summary, based on the paper and checked automatically against it; not reviewed by a person. Corrections welcome.