Posts

Showing posts with the label javascript

How to code neural networks (Part 2)

Image
          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.  ...

How to code neural networks (Part 1)

Image
  Ever seen a robot performing tasks on its own? if yes, then you probably would have asked these questions:  How was it made to think like humans? How it was programmed to perform its tasks on its own?  In this 2-part article, I will try to answer both of these. We will also make our own neural network! Let's start with the first one "how computers think?". if you want to jump to directly coding, click this link to jump to part 2. How do computers think and learn? Before we answer the above question we must understand how the human brain works. The human brain is a big neural network. A neural network is a network or circuit of neurons. Neurons are the fundamental units of the brain. Neurons receive signals from previous neurons and in turn, pass signals on to other neurons. Almost all computational systems are made inspired by biological neural ...