Blog

Difference between Machine Learning and Deep Learning

image

Difference between Machine Learning and Deep Learning

Machine Learning models lack the mechanism to identify errors, in such cases the programmer needs to step in to tune the model for more accurate decisions, whereas deep learning models can identify the inaccurate decision and correct the model on its own without human intervention.

But for doing so, deep learning models require a huge amount of data and information, unlike Machine Learning models.

Working of Deep Neural Network

The deep neural network gets its name due to a high number of layers in the networks. Let us now understand what these layers are and how are they used in the deep neural network to give a final output by referring to the diagram given below:

Layers in Deep Neural Network

By looking at this diagram, we see that there are 4 layers present in this deep neural network namely Layer 1, Layer 2, Layer 3 and Layer 4. Every deep neural network consists of three types of layers, which are:

Input Layer (Layer 1): This layer is the first layer in a deep neural network and it provides the input parameters required to process the information. It simply passes these parameters to the further layers without any computation at this layer.

Hidden Layers (Layers 2 and 3): These layers in the deep neural network perform the necessary computations on the inputs received from the previous layers and pass on the result to the next layer. It is crucial to decide the number of layers and the number of neurons in each layer so as to increase the efficiency of the deep neural network. More the number of hidden layers, deeper is the network.

Output Layer (Layer 4): This layer in the deep neural network gives us the final output after receiving the results from the previous layers.

Now that we have understood the types of layers present in a network, let's learn how these layers actually function and give the output data.

Each neuron is connected to all the neurons in the next layer and all these connections have some weights associated with them. But what are these weights and why are they used?

Weights in Deep Neural Network

Weights, as the name suggests, are used to attach some weightage to a certain feature. Some features might be more important than other features to get the desired output.

For example, close prices and SMAs of the previous days will be considered as more important features than high or low prices while predicting the stock prices for the next day, this will affect the weights attached to these parameters.

These weights are used to calculate the weighted sum for each neuron. x1, x2, x3, x4 represent the weights associated with the corresponding connections in the deep neural network.

Along with the weights, each hidden layer has an activation function associated with it.

Activation Function in Deep Neural Network

Activation functions decide whether a neuron should be activated or not based on their weighted sum. These are also used to introduce non-linearity by using functions like sigmoid and tanh thus allowing computations for more complex tasks. Without the activation function, the deep neural network would act as a simple linear regression model.

Here are examples of a few activation functions which are used:

• Tanh: Avoids bias in gradients
• Rectified Linear Unit (ReLU): Used for Image Processing
• Softmax: To retain the relevance of outliers In addition to this, we also add a ‘bias’ neuron to each layer to enable moving the activation function along the x-axis to the left or to the right thus allowing us to fit the activation function better. The bias term which is a constant term also acts as an output whenever the input is absolute zero.

Processing of Deep Neural Network

The processing starts by calculating the weighted sums for each neuron in the first hidden layer using the inputs received from the input layer. The weighted sums are the sum of the products of the input with the corresponding weights for each connection.

The activation function corresponding to each layer then acts upon these weighted sums to give a final output. This process can also be known as forward propagation.

Once the processing is completed, the predicted output is compared with the actual output to determine the error or loss. For a deep neural network to work accurately, this loss function must be minimized so that the predicted output is as close to the actual output as possible. As we initially choose random weights for the connections in the deep neural network, they might not be the best choice.

Hence, to minimize the loss function, we need to adjust the weights and biases to get accurate results. Backpropagation is the process used to tune the weights and biases such that we get the optimal values of weights and biases thus giving us higher accuracy in our results.

Deep Learning Applications

We have to remember that Deep learning is actually a subset of Machine learning and thus there will be an overlap between the two when it comes to their applications.