Skip to content
awais546 edited this page Oct 31, 2020 · 1 revision

Python and Deep Learning

Introduction

In this ICP we studied the basics concepts of deep learning E.g. how to make a neural network, types of layers, loss and cost functions and the python libraries to implement deep learning.

Tasks

The tasks performed in this ICP are as follows.

  • Plot the graph of accuracy and loss, also plot the graph of accuracy and loss for validation set.
  • Plot one image and do an inference on it
  • Change the layers and activation functions
  • Run the code without scaling

Task-1

Task one can be performed using the following code. The history object as multiple keys. Using these keys you can plot the accuracy and loss.

The graph shows the accuracy of training and testing data set.

The graph shows the loss of training and testing data set.

Task-2

In the second task we had to predict on the test data and display the prediction of one image by displaying the result with the image.

Taks-3

In third task we had to add another dense layer and change the activation function. The results are shown in the following screenshots. The first screenshot shows the accuracy of the previous model with two layers. By adding the third layer with the change of activation function we can see that the accuracy has been decreased and the loss has increased.

Accuracy and loss of model with two layers.

Accuracy and loss of model with three layers and sigmoid activation function.

Task-4

In the fourth task we had to remove the scaling of images and run the model on simple images. The result are shown in the following screenshot. The accuracy has been decreased and the loss has increased as compared to the basic model we built with two layers.

Clone this wiki locally