def LeNet5():
    """
    Original LeNet5 model for MNIST with sigmoid activations.
    """
    return nn.Sequential(
        OrderedDict(
            [
                ("conv1", nn.Conv2d(1, 6, 5, 1, 2)),
                ("sigmoid1", nn.Sigmoid()),
                ("pool1", nn.AvgPool2d(2, 2)),
                ("conv2", nn.Conv2d(6, 16, 5, 1, 0)),
                ("sigmoid2", nn.Sigmoid()),
                ("pool2", nn.AvgPool2d(2, 2)),
                ("flatten", nn.Flatten()),
                ("dense1", nn.Linear(5 * 5 * 16, 120)),
                ("sigmoid3", nn.Sigmoid()),
                ("dense2", nn.Linear(120, 84)),
                ("sigmoid4", nn.Sigmoid()),
                ("dense3", nn.Linear(84, num_classes)),
                ("softmax", nn.LogSoftmax(dim=1)),
            ]
        )
    )

    Original LeNet5 model for MNIST with sigmoid activations.
    
coremltools/test/optimize/torch/models/mnist.py