Artificial Intelligence: An Intuitive Introduction

I know what you’re thinking. God dammit, it’s another article about Artificial Intelligence with a bunch of math that I’m not gonna understand, close tab

WAIT!!!

GIVE ME 4 WORDS TO BLOW YOUR MIND

I’m 17 years old.

Me

Yeah, a 17 year old high school student who hasn’t even taken calculus. If I can understand it, so can you.

Before we begin, what truly is AI?

Literally everyone, even my 50 year old high school teachers have heard about AI. It’s that thing in Google’s self driving cars. That thing that people are worried will take their jobs. However, not many people realize how Artificial Intelligence IS actually being used.

IS

  • Google Photos: Allows you to search for specific people or objects within your photos.
  • Deep Genomics: Literally performing drug discovery using AI, at rates millions of times faster than traditional systems.
  • Rigetti: Quantum Machine Learning. Can compute what today’s supercomputers would take billions of years to compute. Do I need to say more…
  • Worth over $7 BILLION. And projected to be worth over $90 BILLION by 2025.

Wow. If you had any doubt about AI, it should now be gone. We are living in the temporal hub of Artificial Intelligence right now. We’ve hit the inflection point, and there’s no stopping.

The Math.

Here are the prerequisites you will need to understand the math I’m about to explain to you.

  • Grade 3 Math
“red apple fruit on four pyle books” by Element5 Digital on Unsplash

That’s literally it. All you need to know is how to add, subtract, divide, and multiply.

Easy.

Let’s take a case study

“white and black building during daytime” by Alexander Andrews on Unsplash

Imagine you’re designing a program to predict the value of real estate. You’ll need certain inputs/parameters that correspond to the value of real estate. To keep things simple, we’ll only take one parameter: Square Footage.

You realize square footage is heavily correlated to the value of a house. You then find a dataset online with a table containing different real estate with their square footage, and value.

Your goal is to allow end users to be able to predict the value of their house by entering the square footage of their house.

Inputs: Square Footage (ft²)

Outputs: Value ($)

Here’s an example of a dataset:

This relationship could be modeled as such,

Y = mX (A Linear Relationship)

or,

Value = m * Square Footage

Square footage multiplied by some number (m) will equal our value. We do not know what that value m is, but we can figure it out.

Here comes the machine learning

Let’s initialize our variable (m) to a random number. Let’s say 20. Now, we’ll pass some of our data through our model.

+----------------+-----+-----------------+--------------+
| Square Footage | m | Predicted Price | Actual Price |
+----------------+-----+-----------------+--------------+
| 1000 | *20 | 20000 | 250000 |
+----------------+-----+-----------------+--------------+

Error (Actual Price — Predicted Price) = 250000–20000 = 230000

As you can see, the price we’ve predicted is way below the actual price of $250000. Our error, is measured to be 230000. So, how do we get our predicted price to be closer to the actual price, therefore making our model more accurate? We’ll, we adjust the one variable in our model, m.

Let’s imagine we adjust our variable (m) by a tiny amount, 0.0001, what would the predicted price become?

+----------------+---------+-----------------+--------------+
| Square Footage | m | Predicted Price | Actual Price |
+----------------+---------+-----------------+--------------+
| 1000 | *20.001 | 20001 | 250000 |
+----------------+---------+-----------------+--------------+

Error (Actual Price — Predicted Price) = 250000–20001 = 229999

As you can see, the predicted price got ever so closer to the actual price of $250000. Our error is now only 229999. Logically, this means that we should increase our variable m to make our model more accurate. If we repeat this millions upon millions of times, we’d eventually get an optimized model that would allow us to accurately predict the price of a house, given the square footage.

And that’s it!

That is the intuitive logic behind most forms of Machine Learning. Whether it’s a basic neural network, a convolutional neural network, or even a deep q-network, all are based around adjusting your variables to lower your error.


In practice, I’ve skipped a TON of steps here. But, my end goal was to give you an intuitive understanding of how Machine Learning works, not the nitty gritty. The method I showed you above is a Machine Learning algorithm called Gradient Descent, using the Delta Rule. In practice, we’d use a Neural Network instead of this model. In a neural network, we’d be using Backpropagation to take partial derivatives of our cost function, allowing us to adjust all of our weights appropriately. I’ll post a second article on back propagation in the future, but here’s some common terminology ahead of time.

Cost: Essentially error, but normally put through a Cost Function (Such as Sum of Squared Errors)

Weights: The variables (m) in a neural network

Activation Function: Introduces non-linearity (So it’s not just a straight line like in our example! Ex. ReLU, Sigmoid)

Gradient Descent: Essentially the process I explained, lowering our error by adjusting our weights

Backpropagation: How real neural networks learn! Partial derivatives, chain rule, a lot more to explain. But based on the same principle as gradient descent.

Overall, I wrote this article to help beginners get into the field of AI. I hope you’re excited about what AI can do in the future. And I hope you now realize that you don’t need a PhD to get into this field.

Me at Microsoft along with Kirsty Duncan (Canadian Minister of Science)

Over the past year, I’ve developed many of my own personal projects using AI. From a virtual self driving car, to an app that aids the legally blind. (Check out my website) I’ve even been able to work at Microsoft this summer! And speak at the Toronto Machine Learning Summit. If you’re interested in AI/ML, go and learn! There’s nothing like the present.


If you enjoyed this article:

  • share it with your network
  • follow me on Medium and LinkedIn