I want to learn exactly what AI is? What is machine learning? What is deep learning? What does "Neural Networks" mean in this context? When was it discovered? And how can I improve my AI literacy on my own?
Welcome! I'm absolutely thrilled to help you demystify this field. To kick things off on the right foot and tailor our real-world examples, what is your current technical background, or what motivated you to build your AI literacy today?
I have some programming/math experience and want the technical details.
That's fantastic. Since you have a solid grasp of programming and mathematics, we don't have to hide behind vague hand-waving or superficial analogies. We can dive straight into the actual mechanics—like matrices, gradients, and optimization—that make these systems tick.
Before we unpack the math, I have one quick question about your background to help me calibrate our notation. Which specific programming languages or mathematical concepts are you most comfortable with? This will help me decide when to write out clean Python code snippets or leverage precise linear algebra and calculus notation.
Python and standard linear algebra / calculus
Let's dive straight in. To map out the landscape of AI, Machine Learning (ML), and Deep Learning (DL), we can bypass the vague hand-waving and look at how these paradigms actually model the world. It helps to think of them as a set of , where each category is a specialized subset of the larger one.
The Outer Doll: Artificial Intelligence
Artificial Intelligence is the broad, overarching umbrella. Technically speaking, any system that exhibits human-like cognitive functions—regardless of how it is built—falls under AI.
In the early days of computer science, this was dominated by and symbolic AI. If you write a massive, highly complex script of nested if-else statements in Python to diagnose a system failure, that is technically AI. It behaves intelligently, but it is entirely rule-based. The machine is not discovering anything on its own; it is simply executing an explicit logic tree curated by a human engineer.
The Middle Doll: Machine Learning
Machine Learning represents a fundamental shift in how we program. Instead of explicitly writing the rules, we write algorithms that use statistical methods to learn patterns directly from data.
Mathematically, we can frame ML as finding a function that maps inputs to outputs , parameterized by a set of weights :
Instead of hand-coding the logic, we feed the system paired data and use an optimization algorithm to minimize a loss function. In standard ML—like linear regression, support vector machines, or random forests—we typically have to perform manual first. For example, if you want to predict house prices, you must manually decide to feed the model specific features like square footage, number of bedrooms, and ZIP code location data.
The Inner Doll: Deep Learning
Deep Learning is a specialized subfield of Machine Learning. What makes it "deep" is its reliance on artificial neural networks with many hidden layers.
Mathematically, instead of learning a single mapping function, deep learning learns a composition of multiple functions stacked on top of each other:
Because of this multi-layered architecture, deep learning completely eliminates the need for manual feature engineering. If you feed raw pixels of an image into a deep neural network, the early layers naturally learn to detect simple edges. The middle layers combine those edges to find shapes and textures, and the final layers assemble those shapes into complex objects like faces or cars. It learns the features and the mapping simultaneously.
To check how this distinction feels, let's look at a quick conceptual question. Suppose you want to build a system that reads medical scans to identify tumors.
If you decide to bypass manual extraction of image attributes and instead feed the raw 2D pixel matrices directly into a neural network with 15 hidden layers, which paradigm are you utilizing?
Deep Learning
Spot on. Feeding raw pixel matrices directly into a 15-layer neural network to automatically discover the visual features of a tumor is the textbook definition of Deep Learning.
What Exactly is an Artificial Neural Network?
To understand how these multi-layered systems learn, we need to zoom in on their fundamental building block: the Artificial Neural Network (ANN).
While the marketing material often describes ANNs as "mimicking the biological brain," mathematically they are highly structured, parametric function approximators. They consist of layers of mathematical computation nodes (neurons) connected by learnable parameters (weights and biases).
Every standard feed-forward neural network is structured into three distinct types of layers:
- Input Layer: This is where your raw data vectors enter the network (such as individual pixel intensity values from a medical scan).
- Hidden Layers: These intermediate layers perform successive mathematical transformations, extracting increasingly complex feature representations from the inputs.
- Output Layer: The final layer that produces the network's prediction (such as a probability score from 0.0 to 1.0 indicating whether a tumor is present).
The Mathematical Anatomy of a Single Neuron
Let's strip away the biology and look at the actual mathematics. A single node (neuron) in a network is essentially a two-step mathematical operator.
First, it takes an input vector , calculates a weighted sum of those inputs, and adds a bias term . This yields a scalar intermediate value :
Second, to prevent the entire network from collapsing into a giant, glorified linear regression model, we pass through a non-linear to produce the node's final output :
To make sure this core calculation is crystal clear, let's trace the math with some actual numbers.
Suppose a single neuron receives two inputs: and . The corresponding weights for these inputs are and , and the neuron has a bias of .
If this neuron uses a ReLU (Rectified Linear Unit) activation function, which simply outputs , what is the final activation output of this neuron?
-1.5
You actually fell into a very common trap, but your calculation of the intermediate sum was spot on.
Let's look at why the final activation is actually instead of .
Remember, the ReLU activation function is defined mathematically as:
Since your calculated intermediate sum was , passing it through ReLU yields:
In a real neural network, this means the neuron is "inactive" or has not fired because its input signals didn't cross the activation threshold.
Information Flow: Forward Propagation
What we just calculated step-by-step is the fundamental operation of .
In a complete network, this process is repeated on a massive scale. Raw features flow into the input layer, get multiplied by weight matrices, have bias vectors added, pass through activation functions, and the resulting activations become the inputs for the next layer. This continues until the output layer generates a final prediction vector, .
A three-layer neural network with three input nodes, four hidden nodes, and one output node displaying mathematical activations.
I've initiated a visualization to help you see how this cascade of calculations flows smoothly from left to right across multiple layers during a forward pass.
The Learning Loop: Loss and Gradient Descent
Forward propagation gives us a prediction, but initially, that prediction will likely be terrible because the weights and biases are initialized to random numbers. To fix this, we need a way to quantify exactly how wrong the network is. We do this using a Loss Function , which measures the error between our prediction and the true label .
To make the network smarter, we must minimize this loss. Since the training data and architecture are fixed, the only variables we can alter are the weights and biases.
This is where comes in. We calculate the gradient of the loss function with respect to our weights, , which points in the direction of steepest ascent. By subtracting a fraction of this gradient from our weights, we take a step down the error hill.
By iteratively running forward propagation to calculate the loss, and then updating our weights in the opposite direction of the gradient, the network slowly carves out a pathway to highly accurate predictions.
Before we unpack the famous backpropagation algorithm that calculates these gradients, let's see how you feel about the relationship between forward propagation and optimization.
During training, if our network's loss is exceptionally high, what does that tell us about the current weights and how forward propagation behaves?