You Don’t Need To Be A Physicist To Understand Quantum Machine Learning
You Don’t Need To Be A Physicist To Understand Quantum Machine Learning

This post is part of the book: Hands-On Quantum Machine Learning With Python.

Machine learning aims to put a label on a yet unlabelled thing. For instance, we try to predict whether an image shows a cat or a dog.

Image by author, Frank Zickert

Distinguishing between cats and dogs is an easy task for a human. In order to let a machine take over this task, you need to program it. You need to specify exactly how to execute every single step. The problem is, though, while we can do it, we don’t know the exact rules of how we do it.

Nature gave us abilities without letting us know how these abilities work. Apparently, the ability itself has been an evolutionary advantage, whereas the knowledge of it didn’t.

With this inability to tell a machine how to tell the difference between cats and dogs, the idea came up to teach the machine the same way we would teach another person.

If you want to teach your child the difference between a cat and a dog, you show her the animals and name them.

Whenever she identifies a cat or a dog correctly, you reward her by agreeing. In case she’s wrong, you correct her. Even the slightest difference in the feedback you give to your child will make her improve because she subconsciously optimizes her behavior for a reward.

Rather than specifying the details of how to do the task, we present correctly labeled examples to the machine and say: “figure it out yourself”.

A major difference between teaching a child and teaching a machine is the representation. We humans keep our knowledge in our brains. It consists of myriads of connected neurons that form a network. Our senses feed electrical impulses into this network. The output translates into our thoughts and into commands to our muscles. As a teacher, we can’t control how the brain of our students work.

As the machine learning engineer, one of our main tasks is to come up with a representation that is sufficiently complex to keep the knowledge we want it to learn, but sufficiently simple to be trainable in a reasonable time. This representation is also called the model.

The model has a structure. It can be anything from a simple mathematical formula to a network of artificial neurons. And the model has parameters — trainable parameters. These two things determine the complexity of our model. Generally, the more parameters our model has, the better it can perform tasks, but the harder it is to train it.

Once we settled for the structure of the model we start training it. We aim to find a set of values of the parameters that let the model predict the label of a thing correctly. We do this by presenting the examples to our model, take its prediction, and calculate the error by comparing the output of the model with the actual label.

Ultimately, we search for a combination of parameter values that minimize the error. We try to solve an optimization problem.
['Frank Zickert', 'Quantum Machine Learning']
['Physics', 'Computer Science', 'Quantum Computing', 'Python', 'Programming']