top of page

Deep Neural Networks and Back propagation

Nov 22, 2022
3 min read

Deep Neural Networks/Back Propagation Preview


In the last blog we discussed logistic regression. We found out that logistic regression can be handled similarly in the context of implementation to linear regression. One draw back was the power our model had. Logistic regression relies on non-linear relationships that can not be captured by strictly linear methods. In this blog we will discuss the next steps to take in order to make our models able to learn more complex relationships. This will allow us to achieve higher accuracy and overall train our models better. We will discuss Deep Neural Networks. What is a Deep Neural Network? What Machine Learning problems does it help to solve? How does it compare to the models we used previously? In DNN's, this will also lead to the introduction and discussion of activation layers and non-linearity. What is Back Propagation? Why is it useful?


What is a Deep Neural Network?


A Deep Neural Network is a term used to refer to any neural network that has more than an input and output layer. It is self explanatory, "Deep" refers to the adding of layers/ depth to our standard neural network. What Machine Learning problems does it help to solve? A general rule of thumb is when you are dealing with data that is not linear (i.e. categorical data) adding layers will be acceptable. This does not mean that you can't use Deep Neural Network's with linear regression problems. It just means that it is not necessary since our standard neural network can handle those jobs usually pretty well. To summarize, logistic regression is going to benefit from the Deep Neural Network's more than a linear regression problem will.


How does it compare to the models we used previously?


A lot of the implementational code will remain and look the same if you are coding in PyTorch. This might not remain true if you take the framework away and try to directly implement these with a language alone. With Deep Neural Networks you will add "Hidden Layers" in between your input layers. Their sizes are going to be arbitrary. This means it is the Machine Learning Practitioners' job to experiment and build intuition as you design more of these models. The hidden layers will take input equal to its predecessors output size. Generally, if you are using a Deep Neural Network you will be adding activation layers, which I will discuss in another section. The addition of the Hidden Layers and activation layers helps to empower our model to learn more complex relationships. Therefore, its ability to learn and achieve higher accuracy when dealing with more complex problems will be greater.


What is a Feed Forward Neural Network?


Feed Forward Neural Networks, like other ML concepts, is self-explanatory. The data gets strictly forward and does not form a cycle. A cycle is an instance where two nodes are bi-directional, meaning data can not be fed forward and backwards. So the input layer will feed output to the layer in front of it. That layer will feed output to the layer in front of it. This will continue until the data reaches the output layer and then the outputs/ predictions will be made.


What is an Activation Layer?


Activation layers are layers in between layers that modify the data prior to sending it to the next layer. These modifications depend on the activation layer you choose. This will be contingent on the data you have and the problem you are trying to solve. Essentially, they help to capture non-linear relationships, which empowers models to tackle tougher problems.


What is back propagation?


Back propagation is an algorithm implemented with Feed Forward NN's. It will go through the process of generating outputs. Once it reaches the output layer, it will start to calculate loss. From there, it will adjust the weights of the output layer. It will move backwards layer by layer, adjusting weights and biases according to the calculated gradient. This extra comparison and view of our weights, like everything else we've discussed in this blog, helps our model read more complex relationships. Which is also why it is useful.


Sources:

 
 
 

Comments


bottom of page