Machine and Deep learning using PyTorch : Accurately predicts the digits in our images


Learn Machine Learning, Deep Learning, and Artificial Intelligence

We started to implement algorithms using an end-to-end machine learning framework: PyTorch [1]

We followed the free course named ‘Secure and Private AI’ given by Udacity [2]

And, we started writing a new section of our about-to-be “software engineering” book [3]: Secure and Private Artificial Intelligence [4]

Come back to reality, study your mathematical courses

It is time to remember your first-grade courses in mathematics and statistics:

  • vectors, matrix (1-dimension, 2-D, and 3D), matrix multiplication
  • random normal variables, loss function (cost)

and then you can start applying the theory :

  1. Build neural networks
  2. Train the neural network in four steps:
    1. Forward Propagation
    2. Loss computation
    3. Backpropagation
    4. Updating the parameters
  3. Finally, when these steps are executed for a number of epochs[6] with a large number of training examples, the loss is reduced to a minimum value [5]
  4. The final weight and bias values are obtained which can then be used to make predictions on the unseen data. [5]

Roll your sleeves up and code!

After a few lines of code, the download of samples you find out that a model without training is useless.

The figure indicates that they are as many chances that the figure on the left (number 6) is a 0, 1, 2… or 9!

Machine learning: probability distribution that the number is 6 without training the model

Machine learning: probability distribution that the number is 6 without training the model

Several hours later, a few lines of code and training of the model using already-trained data and the prediction on unseen data indicates with a very high level of confidence which number is drawn.

Machine learning accurately predicts the number 6

Machine learning accurately predicts the number 6 using PyTorch

 

Links

[1] PyTorch : https://pytorch.org

[2] Udacity: Secure and Private AI: https://classroom.udacity.com/courses/ud185

[3] Software engineering at ALT-F1: https://alt-f1-software-architecture.readthedocs.io

[4] HR curriculum: Secure and Private Artificial Intelligence: https://alt-f1-software-architecture.readthedocs.io/en/latest/02-03.HR_management.html#secure-and-private-artificial-intelligence

[5] Get Started with PyTorch – Learn How to Build Quick & Accurate Neural Networks (with 4 Case Studies!) : https://www.analyticsvidhya.com/blog/2019/01/guide-pytorch-neural-networks-case-studies

[6] Epoch: https://alt-f1-software-architecture.readthedocs.io/en/latest/glossary.html?highlight=epoch#term-epoch

 

One comment

  1. […] [1] Machine and Deep learning using PyTorch : Accurately predicts the digits in our images […]

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: