You can Become a Teacher… For Robots?| Machine Learning

Original article was published by Bagavan Marakathalingasivam on Artificial Intelligence on Medium


You can Become a Teacher… For Robots?| Machine Learning

Cat or Dog?

Like you or some people you know, there are many people out there that are teaching each other many new things. You are too and may not even recognize. At the same time, even more people are learning something new that they could apply in the real world.

There is a boy named Timmy. Timmy was being taught how to tell the difference between a cat and a dog. Now, Timmy has never seen any of these things before or even knows what they are, but because of your teaching, he was able to detect the difference between a cat and a dog. Here’s the thing, Timmy isn’t actually a real person. You see, this Timmy is actually a machine that was programmed to learn how to tell the difference between cat and a dog. So, how could this machine learn how to tell the difference. Timmy was taught through the use of machine learning.

Machine Learning … What’s That?

So, what exactly is machine learning? Well, as the name states itself its a way to program a machine to learn on its own. With machine learning, the machine will automatically get better and improve with more experience, kind of like humans. As humans, we learn in many different ways. Some people learn on their own, some get taught, some get taught just enough so that they can learn the rest on their own, but how can we make a machine do that. This is where Supervised, Unsupervised, and Semi-Supervised Learning come in to play.

As humans, we learn in many different ways. Some people learn on their own, some get taught, some get taught just enough so that they can learn the rest on their own, but how can we make a machine do that. This is where Supervised, Unsupervised, and Semi-Supervised Learning come in to play.

Supervised Learning

You’ve just learned about machine learning and now have no idea what this supervised learning even is. First of all, inorder to train a machine we have to give it a bunch of data to learn from. What does this mean? In the example with Timmy, inorder for that machine to learn the difference from a dog and a cat, you would have to keep giving pictures of dogs and cats and telling the machine which one is which. After a while, the machine will be able to know which one is which even without you telling it.

This is how the machine trains, but Well, for starters this is method used to train a machine. What this means is that, when you give data to the machine with the answers. At first we would give Timmy a picture of a dog, and label it as “Dog”. We would do the same thing with cat and label it with “Cat”. Let’s say we show Timmy 50 images of dogs labelled with “Dogs”, and 50 images of cats labelled with “Cats”. After the machine would now be able to tell the difference between a cat and a dog, so if we show a picture of a cat, it would know its a cat.

Unsupervised

We know about However, if we wan’t to apply this to the real world, knowing the difference between a cat and a dog isn’t something that could be used. What if we wanted to teach a machine to learn how to play a certain game, or do a certain task. It is going to be hard to give it data to learn from. This is where Unsupervised Learning comes in to play.

This image represents the process of unsupervised

This is the opposite of Supervised learning. We would just let the machine run and do whatever it wants. How is it going to learn? We would use something called a rewarding system. This is where if a machine does what you want it to do, or close to what you would want to do, you would give the machine a point. If they do the opposite you would lose a point.The goal for the machine is to get the most amount of points as possible. Since the machine is doing random actions, if it loses a point, it would have a lower chance of doing that action, and vice-versa with gaining a point. Once you keep letting the machine do this, it will slowly start to learn and realise what it needs to do. Pretty cool right?

Semi-Supervised

Let’s say you want to create a machine for facial recognition. You can’t really give a picture of all the people in the entire world for machine to recognise, but that the same time, you can’t not give any information about people for a machine to learn from itself, that would take forever. So, what can you do? Well, you can actually combine both types of learning and use something called, “Semi-Supervised Learning.” So, what exactly is semi-supervised learning. This is essentially where you would give data to a machine to learn from with some labels. For example, you can train images of parts of the body, like the eyes or the nose. This way, the machine can develop an understanding of what features a human has. After a ton of training, the machine will finally be able to detect human faces properly.

Let’s dive Deeper into Machine Learning

Now, the real question is, how does the machine actually learn and process this data that we give it? This is where we can go deeper into machine learning and talk about Deep Learning. What exactly is deep learning? You see our brain is made up of several neurons and are all connected to each other. People decided that if they could replicate what is happening in our brain, then they can essentially create a machine that can learn certain things. This thing inside our brain is called, and neural network, which was replicated into deep learning called and artificial neural network(ANN). So, how does this ANN actually work?

Neural Network

In order to properly understand what a Neural network is in deep learning, let’s look back at our example with Timmy the Robot. When we give Timmy an image of a dog, that would be the input. The answer which could either be dog or cat, is going to be the output. So Timmy will have to look at the picture, and analyze every detail of the image. Depending on what a machine analyzes, it will change the values of each hidden layer. The hidden layers are what is in between the input and output layers. These layers can vary depending on what you want the machine to learn/do. Each part of the input layer is connected to each part of the first hidden layer, and each part of the last hidden layer is connected to each part of the output layer, and all the hidden layers between are connected to each other. They are all connected by synapses which change to value of each layer depending on the previous one.

Weights & Biases

There are two key parts in a Neural Network that you must know and those are weight and biases, but what even is that?

This image represents how weights and biases are used to get the output

As I mentioned before, when we give an input to a machine it changes the value of each layer depending on the previou input. This is basically what a weight is, it decides how much influence the input would have on the output. Now, what are biases? Biases will always add an additional input to the next layer that always have a value of 1. In turn, weights are what decides the changed value, whereas biases add value to any input with the value of one.