What is Machine Learning?
Introduction
This is part three of the series on the difference between Artificial Intelligence, Machine Learning and Deep Learning (link to Part 1 and 2). In Part 1 I gave a VERY shallow explanation of the relationship between AI, ML and DL. Part 2 went more in to detail on Artificial Intelligence. In this part I will explain Machine Learning, and its relation to parenting.
The "Learning" in Machine Learning
Remember "GOFAI" from part 2? These were the rule-based, early computerised AI algorithms that had to be explicitly programmed in order to give you the desired output. With Machine Learning you actually turn this on its head:
By changing what is fed to the model you achieve a more dynamic system. In GOFAI, if the features of the input changed, you had to rewrite the function in order for it to output the desired result. With Machine Learning, you merely have to present the model with the input and output, and it gives you the resulting function that approximates your data.
Types of Machine Learning algorithms
There are several different categories of Machine Learning algorithms, and I will try to explain the most prominent in this chapter. This will not be a technical explanation, but rather an analogy that explains the inner workings by giving examples from everyday life.
Unsupervised Learning
In unsupervised learning, only the input data is presented and not the output. But how can you solve a problem when you are only presented the input, with neither a function nor output? It would be pretty tempting to think that a problem like this is unsolvable. But if this same problem was presented to a child, what would it do? Let's take an example of coloured geometric objects:
Maybe the child is interested in colours, so they would take the objects and categorise them by colour. And lets further imagine that after they did that they also saw that the objects had different shapes, and then they would move on to categorise each colour category with a subset of geometric shapes.
Much in the same way as a child fiddles with toys, unsupervised learning algorithms are masters at finding structure in unstructured data.
Since the algorithm is not presented with the output data, there is no way to specify the structuring of the data, and the categories are presented without labels. Nevertheless, unsupervised learning is a good way to preprocess data, and this is typically done before moving on to supervised learning.
Supervised Learning
In supervised learning, both the input and output data is presented to the algorithm. By feeding the algorithm both input and output, the algorithm can learn the correlation between these and generate a function that approximates the output for a given input.
Have you ever used those cute animal flash-cards in order to learn your child the different classes of animals? Well congratulations! You can now brag to your peers about your prowess in the practical application of Supervised Learning! Now let's see if we can use your newly acquired skill in an example:
In this example the input is the image on the flash-card you are showing to your child. The output is the sound you are making when showing your child the flash-card. The function is the connections being made between the neurons in the biological brain of you child. So the model for training your child would look something like this:
Now I'm going to tell you something utterly mind blowing: After you have trained your child with these flash-cards, you can just utter an animal name (output), and your child will just intuitively reverse its newly configured biological neural network and point to the corresponding flash-card (input). Now that's some serious next-level sh!t right there:
Do you think I'm done being mind-blown? Well, think again folks! After you have trained your child, what do you think happens if you show it a flash-card of an animal that is not within the training set? It makes a GENERALISED assumption, based on the flash-cards it has already been trained on.
Remember that one of the flash-cards was a baby chimpanzee (labeled as "monkey" in the flash-card)? Lets imagine that this new flash-card has a picture of an adult gorilla. Gorillas are also monkeys, and although the size is vastly different, many of the features are similar. I bet you 5 dollars that the first word your child would utter is "monkey".
What if you just showed your child the bottom half of a flash-card of an eagle? It would see the feathers, the talon-like feet and the peculiar long feathers of the tail, and note the resemblance to the features of the Yellow Robin from the training set. My guess is that even before you have the time to ask your child a question it would splutter out the word "bird".
Much in the same way that children can generalise from their past experience, so does Supervised Learning algorithms (as long as they are fed enough training data). And it is exactly this ability to generalise that is one of the big advantages of Machine Learning.
Reinforcement Learning
In reinforcement learning, you usually don't have an existing data set. To remedy this, a simulation is programmed which creates the data set for you. A simulation is just a fancy word for generating a controlled environment (input), in which you can alter a set of variables (agent) and calculate the outcome (function):
An inherent flaw with this kind of simulation is that it has a multitude of different outcomes. So how do we manipulate this simulation in to generating a data set that fits our desired outcome? One way is to implement a system that rewards specific actions and punish others:
So how can we relate a system like this to our every day life? Well, if you are a parent I'm pretty sure you are already living and breathing this system. Now lets try to frame this example into a typical parenting problem:
In this simulation we want our child to eat its veggies (outcome). The house is where the action happens (input). The actions [not] being performed is by an Impudent Little Brat (agent). The parents may conjure up some kind incentive system to coax the child into eating its veggies (reward/punishment).
Now before I explain the different solutions to this problem I need to give you fair warning: Much like the algorithms of Reinforcement Learning, Impudent Little Brats are masters at HACKING THE SYSTEM. Their sole purpose in life is EXPLORATION of uncharted waters and EXPLOITATION of their current knowledge (I'm not even joking, this is LITERALLY what it says on the wiki page).
Do you find it a little hard imagining how an algorithm can hack a system? Well, here's a video of an algorithm doing exactly that in Tetris:
If there is even the slightest kink in your armour, they will find it and exploit it. When Reinforcement Learning algorithms hack the system, it's pretty hilarious to behold. When Impudent Little Brats hack the system, welcome to your worst nightmare.
Now there's three different ways in which you can approach this problem. First of is constricting the simulation, so instead of simulating a whole house, try just simulating the bounds of the dinner table (and thereby reducing the degree of freedom for the Impudent Little Brat).
The second solution is using brute force (what?!?), but surprise, surprise, this does not work on neither algorithms, nor Impudent Little Brats (though the thought has crossed my mind on several occasions).
Lastly, we have the carrot/stick solution. The carrot part of this solution could be something in the lines of: "If you eat your veggies, you'll get ice-cream for desert!". The stick part of this solution could be something like: "I'm going to count to three, and if those veggies aren't gone from your plate by then I swear I'm going to throw your iPad in the trashcan!!!"
And by the way, bonus points to the parents that foresaw that the Impudent Little Brat would just toss the veggies on the floor in response to the "stick" solution....
Now this was actually supposed to be the end of the article, but I found a hilarious movie that i'm just dying to show you. It's a movie about training kitties with reinforcement learning, and everybody loves kitties!
Summary
So what has this article taught us? A key difference between GOFAI and Machine Learning is what is fed to the system. In GOFAI, input and a function is fed to the system. In Machine Learning, input and output is fed to the system.
There are a lot of different types of Machine Learning algorithms, of which the most prominent are Unsupervised Learning, Supervised Learning and Reinforcement Learning.
It seems like the concept of learning is pretty universal, and a lot of the concepts of Machine Learning can be translated into examples from everyday life.
The abilities of kids can in some instances blow your mind, and in other instances be your worst nightmare (I'm kidding of course, I love kids).
You can't go wrong with kitties!
Until next time folks.
CEO at White Legend Properties
5 年I'm very interested about this topic would like if you can tag me for future articles? :)?
CEO at Sentient AS
5 年Well, the shameless shilling of my last article was pretty successful so I'll continue that with this article too. Frode Ramvik?Beatrice Quan?Erlend Fredriksen Syltevik?Joakim Raninen?Eirik Vika?Denis Bogunic?Sundeep Patpatia