MnistCnn
Constructs a Convolutional Neural Network (CNN) tailored for the MNIST dataset using a DSL-based network builder.
This model consists of two convolutional blocks followed by a flattening stage and two dense (fully connected) layers. It is designed to classify handwritten digits (0–9) from grayscale 28x28 pixel images.
The architecture is as follows:
Stage: "conv1"
2D Convolution with:
16 output channels
5x5 kernel
stride of 1
padding of 2
ReLU activation
2x2 MaxPooling with stride of 2
Stage: "conv2"
2D Convolution with:
32 output channels
5x5 kernel
stride of 1
padding of 2
ReLU activation
2x2 MaxPooling with stride of 2
Stage: "flatten"
Flattens the tensor for dense layer input
Stage: "dense"
Fully connected layer with 128 units
ReLU activation
Stage: "output"
Fully connected layer with 10 output units (for 10 MNIST classes)
Softmax activation over dimension 1 to produce class probabilities
Functions
Implement this in your models. Call reportProgress whenever you want to emit a progress update.