MyFW MNIST

3-NeuralNetworksartificial-intelligencernnganmicrosoft-for-beginnerslessonsAImicrosoft-AI-For-Beginnersmachine-learningdeep-learninglabcomputer-vision04-OwnFrameworkcnnNLP

MNIST Digit Classification with our own Framework

Lab Assignment from AI for Beginners Curriculum.

Reading the Dataset

This code download the dataset from the repository on the internet. You can also manually copy the dataset from /data directory of AI Curriculum repo.

[4]
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100  9.9M  100  9.9M    0     0   9.9M      0  0:00:01 --:--:--  0:00:01 15.8M
[3]
[4]

Let's see what is the shape of data that we have:

[5]
(42000, 784)

Splitting the Data

We will use Scikit Learn to split the data between training and test dataset:

[6]
Train samples: 33600, test samples: 8400

Instructions

  1. Take the framework code from the lesson and paste it into this notebook, or (even better) into a separate Python module
  2. Define and train one-layered perceptron, observing training and validation accuracy during training
  3. Try to understand if overfitting took place, and adjust layer parameters to improve accuracy
  4. Repeat previous steps for 2- and 3-layered perceptrons. Try to experiment with different activation functions between layers.
  5. Try to answer the following questions:
    • Does the inter-layer activation function affect network performance?
    • Do we need 2- or 3-layered network for this task?
    • Did you experience any problems training the network? Especially as the number of layers increased.
    • How do weights of the network behave during training? You may plot max abs value of weights vs. epoch to understand the relation.
[ ]