Machine Learning is an integral part of Artificial Intelligence it is the discipline of training a machine to learning. It achieves this through using a neural network and is give data to train on, it then approximates and is able to predict an answer from a new set of data. It can do it very fast and never needs a break. It is at the heart of all current AI and is considered to by cutting edge technology that can bring about great benefits but also greater fears.
ML5.js (p5.js, TensorFlow.js)
Similar scenario to the above description. This can be done in the p5.js web editor and is a good place to start if you have used p5.js as it will be very familiar. Even if you haven’t it is still a good place to start because the principles are common to both python and JavaScript even though they are quite different coding languages.
References: p5.js TensorFlow.js ML5.js
Types of Learning
There are broadly two types of learning, supervised and unsupervised. Supervised Learning is where it is given the data which has the inputs and the outputs. For instance it is shown pictures of cats and pictures of dogs and for each picture it is labelled ‘dog’ or ‘cat’ and it learns which is which after being shown thousands of images, all labelled correctly. Unsupervised Learning is when it is give all the same images (you wouldn’t really do this) but without labels. It will try to group the images into the two camps either dogs or cats. This is a very silly and simplistic view of the difference.
Another very common one used in robotics is Reinforcement Learning. This is where a particular action gets a reward or not. Through a form of trial and error it starts to work out which action gives it the highest reward. All the positive actions are reinforced, an example might by navigating a maze so that it doesn’t keep making the same mistake over and over again. Examples might be playing chess without telling it the rules of the game or more famously playing the game of ‘Go’. Through a process of playing the game against another machine repeatedly you start to find the model which improves and you let it keep learning. Remember it can work things out faster than you and doesn’t get tired.
Types of tasks given to ML
There are two main types in supervised learning. Classification and Regression. You would use classification if you wanted it to identify a particular species of bird or tree. Whereas in a regression task the data is continuous, for instance the prediction of the weather or the stock exchange. Whereas if you were labelling emails as spam or not spam you would use classification. If you wanted to know whether the price of bitcoin was going to go up or down you would input all the previous historical data along with other factors that might influence the value of bitcoins.
Data
The quality and quantity of the data is crucial but even then there is no guarantee that the AI can predict accurately. This can be extremely costly in time and money, for instance if you want to be able to classify objects for a self driving car using camera vision. It doesn’t know what anything is so it needs lots of images of objects like humans, other cars, signs, obstructions etc. someone has to sit down and draw a box round a tree, a person, etc, for tens of thousands of images. One way round it is to augment images or to use synthetic data.
Neural Networks
Much of AI and the nuts and bolts of Machine Learning is around something called Deep Learning or Deep Neural Networks.These are semi-mysterious algorithms that have a fairly straightforward maths element to them (a bit of calculus would suffice) yet when they are operating no-one (not even the experts) know what s happening inside the Neural Network. The history of Neural Networks is quite interesting and despite the hype to the contrary not new. Yet they are powerful algorithms, just a bit of maths and coding lumped together to do something quite astonishing.