How to code neural networks (Part 2)
Photo by Mohammad Rahmani on Unsplash Welcome to part 2 of this article. In the previous article, I discussed the theory and working of a perceptron. If you haven't read that article I strongly suggest you read it before continuing with this one. Click this link to go there In this article, we are going to start implementing all we learned in code. So let's dive in. We will start off with the activation function. We have discussed the function we are going to be using in the previous article. function activation(x){ if(x <= 0.5){ return 0; }else{ return 1; } } This is just a basic function that returns 0 if the value is less than or equal to 0.5 and 1 otherwise. We are going to make a perceptron class that can be used to solve many different problems. For my example, I will be continuing with the AND gate example. We can start the class