Latest / CyberSecurity Summary / Fundamentals of Deep Learning: Designing Next-Generation Machine Intelligence Algorithms
Transcript
- 0:00Speaker 1: Think about this for a second. The human infant brain
- 0:04Speaker 1: weighs just about a single pound.
- 0:06Speaker 2: Yeah, it's incredibly small, right.
- 0:08Speaker 1: Yet within like a matter of months after being born,
- 0:11Speaker 1: a baby can just effortlessly recognize its parents' faces.
- 0:14Speaker 2: Oh. Absolutely.
- 0:15Speaker 1: It can discern discrete objects from you know, the complex,
- 0:19Speaker 1: totally cluttered background of a room, and it intuitively starts
- 0:23Speaker 1: to grasp the natural physics of the.
- 0:25Speaker 2: World around it, right like gravity.
- 0:27Speaker 1: Yeah, it tracks moving objects even when they're like partially
- 0:31Speaker 1: blocked from view. And the craziest part it does all
- 0:35Speaker 1: of this in microseconds.
- 0:37Speaker 2: It really is mind blowing. It is.
- 0:39Speaker 1: It's solving computational problems that frankly routinely stump the biggest,
- 0:44Speaker 1: most powerful supercomputers we have ever built.
- 0:46Speaker 2: I mean, it really puts our technology into perspective, doesn't it.
- 0:49Speaker 1: Oh, one hundred percent.
- 0:50Speaker 2: Inherently that biological structure is what makes us intelligent, and
- 0:54Speaker 2: we take it completely for granted.
- 0:56Speaker 1: We do. We just open our eyes and see exactly.
- 0:59Speaker 2: But the raw process seeing power required for you to
- 1:01Speaker 2: just look at a cat and instantly say, you know,
- 1:04Speaker 2: that's a cat is staggering when you actually try to
- 1:07Speaker 2: write it down.
- 1:07Speaker 1: In code, which brings us to our mission for today.
- 1:11Speaker 1: We are doing a deep dive into a foundational textbook,
- 1:15Speaker 1: Fundamentals of Deep Learning, to figure out exactly how computer
- 1:19Speaker 1: scientists are trying to well reverse engineer that infant brain
- 1:24Speaker 1: into code.
- 1:25Speaker 2: It's a huge shift in how we think about computing.
- 1:27Speaker 1: It really is. We are moving away from those rigid,
- 1:30Speaker 1: massive walls of traditional programming and stepping into the world
- 1:33Speaker 1: of dynamic, artificially intelligent models.
- 1:36Speaker 2: Yes, leaving the old rules behind.
- 1:38Speaker 1: Right, and for you listening, if you have ever felt
- 1:41Speaker 1: completely overwhelmed by the buzzwords thrown around AI right now,
- 1:44Speaker 1: like neural networks, machine learning, backpropagation, this deep dive is
- 1:49Speaker 1: your shortcut.
- 1:50Speaker 2: We're going to break it all back exactly.
- 1:51Speaker 1: No jargon. We're just going to walk through the actual
- 1:53Speaker 1: magic happening inside these models, step by step.
- 1:55Speaker 2: And you know, the best place to start is actually
- 1:58Speaker 2: by looking at failure.
- 1:59Speaker 1: Failure like that.
- 2:00Speaker 2: Yeah, Because to understand why we even need a field
- 2:03Speaker 2: called deep learning, we first had to talk about why
- 2:06Speaker 2: traditional computer programming fundamentally fails at doing seemingly simple, everyday
- 2:13Speaker 2: human tasks.
- 2:14Speaker 1: Right, Because when we talk about a traditional program, we're
- 2:17Speaker 1: talking about a very literal list of explicit.
- 2:19Speaker 2: Instructions exactly if this, then that.
- 2:23Speaker 1: Yeah, if you want a computer to crunch a million
- 2:25Speaker 1: financial records, a traditional program is like your best friend.
- 2:30Speaker 1: It will do the arithmetic flawlessly.
- 2:32Speaker 2: Oh, it'll do it in a millisecond.
- 2:33Speaker 1: Right, But the moment you ask that same program to
- 2:36Speaker 1: read a handwritten sticky note, the whole system just falls apart,
- 2:39Speaker 1: completely falls apart.
- 2:40Speaker 2: Let's let's use a classic example from computer science to
- 2:43Speaker 2: show this. The MS data.
- 2:45Speaker 1: Set, Okay, the m nest data set.
- 2:47Speaker 2: Yeah, think of it as a massive collection of images,
- 2:49Speaker 2: just you know, pictures of handwritten digits zero through nine.
- 2:52Speaker 1: Got it.
- 2:53Speaker 2: Now, imagine you're a programmer trying to write a traditional
- 2:56Speaker 2: set of if in rules to teach a computer how
- 2:59Speaker 2: to wrectgnize the number zero.
- 3:01Speaker 1: Okay, let's put myself in that position. I'd probably write
- 3:03Speaker 1: a rule based on the geometry, right, Sure, so.
- 3:06Speaker 2: I'd tell the computer a zero is a single, continuous
- 3:11Speaker 2: closed loop of.
- 3:12Speaker 1: Dark pixels and on paper. That makes perfect sense, right,
- 3:16Speaker 1: But humans are messy. What happens when someone writes a
- 3:19Speaker 1: zero in a massive hurry and their pen lifts off
- 3:23Speaker 1: the paper a millisecond too early.
- 3:25Speaker 2: Oh right, so they leave a tiny gap at the
- 3:28Speaker 2: top exactly.
- 3:29Speaker 1: The loop isn't closed.
- 3:30Speaker 2: Ah, so my strict rule just failed. The computer looks
- 3:33Speaker 2: at and says not a zero.
- 3:35Speaker 1: And it gets worse. I mean, the headache just multiplies.
- 3:37Speaker 1: What if someone draws a really messy, overlapping zero and
- 3:40Speaker 1: the line like loops back over itself slightly at the top. Oh,
- 3:44Speaker 1: so it looks like a six exactly. Algorithmically, trying to
- 3:47Speaker 1: define that exact shape with rigid rules becomes incredibly difficult
- 3:51Speaker 1: to distinguish from a sloppily written number six.
- 3:53Speaker 2: That sounds like a nightmare to code it is.
- 3:56Speaker 1: Where do you draw the mathematical cutoff? How do you
- 3:58Speaker 1: write a definitive rule to distinguish a messy three from
- 4:01Speaker 1: a five?
- 4:02Speaker 2: You've just been writing rules forever, right. If you try
- 4:05Speaker 2: to hard code this, you end up trapped in this
- 4:08Speaker 2: impossible maze of exceptions. You add a rule for the gap,
- 4:12Speaker 2: a rule for the overlap, a rule for the slant.
- 4:14Speaker 1: You could spend months on trial and error just to
- 4:17Speaker 1: recognize one single digit exactly. It's exhausting just thinking about it.
- 4:22Speaker 1: We obviously need a completely different approach here, and this
- 4:25Speaker 1: I guess circles us back to that infant brain. It does,
- 4:28Speaker 1: because when we were toddlers, no one sat us down
- 4:30Speaker 1: and you know, read us a mathematical formula for the
- 4:34Speaker 1: geometry of a dog.
- 4:35Speaker 2: No, they certainly didn't. You learned by observing examples.
- 4:39Speaker 1: Right.
- 4:39Speaker 2: Your parents pointed to an animal in the park and
- 4:41Speaker 2: said dog, and your brain's internal architecture took in those
- 4:46Speaker 2: sensory inputs, the fur, the shape, the sound, absorbing the
- 4:49Speaker 2: raw data exactly. And the next day you point to
- 4:51Speaker 2: a cat and guess.
- 4:53Speaker 1: Dog and your parents correct you.
- 4:55Speaker 2: Right, they say, no cat. That negative feedback actually modifies
- 4:59Speaker 2: your intern model. Oh wow, Over time, through thousands of
- 5:03Speaker 2: positive and negative examples, your biological model fine tunes itself
- 5:07Speaker 2: until it's incredibly accurate.
- 5:09Speaker 1: I really love looking at it this way. It's it's
- 5:13Speaker 1: like the difference between memorizing a highly specific, totally inflexible
- 5:18Speaker 1: recipe versus learning how to actually cook.
- 5:21Speaker 2: Oh that's a great analogy, right.
- 5:22Speaker 1: When you just follow a recipe, that's traditional programming. But
- 5:25Speaker 1: when you learn to cook, you taste your food as
- 5:28Speaker 1: you go, You get feedback from your senses. You realize, oh,
- 5:30Speaker 1: it needs more salt, and you adjust the seasoning.
- 5:33Speaker 2: You're learning by doing exactly.
- 5:34Speaker 1: You're learning by doing, and that at its core is
- 5:37Speaker 1: machine learning. That's the perfect way to frame it.
- 5:40Speaker 2: Instead of handing the computer a massive, brittle list of rules,
- 5:44Speaker 2: we give it a very basic, flexible model.
- 5:46Speaker 1: Okay.
- 5:47Speaker 2: Then we give it a small set of instructions on
- 5:49Speaker 2: how to modify itself. When it makes a mistake, we
- 5:52Speaker 2: show it thousands of flash cards, thousands of examples, and
- 5:56Speaker 2: let it automatically adjust its own internal settings.
- 5:59Speaker 1: Okay, so we are learning by example, trying to mimic
- 6:02Speaker 1: a toddler's brain. What does this model actually look like
- 6:06Speaker 1: in the physical code? Like, how do we build a
- 6:08Speaker 1: digital brain?
- 6:09Speaker 2: Well, by looking directly at the biological.
- 6:10Speaker 1: One makes sense.
- 6:11Speaker 2: If you take a piece of the human brain the
- 6:13Speaker 2: size of a grain of rice, you're holding about ten
- 6:16Speaker 2: thousand biological neurons.
- 6:18Speaker 1: Ten thousand just in a grain of rice.
- 6:21Speaker 2: Yeah, and each one of those individual neurons is reaching
- 6:24Speaker 2: out and forming roughly six thousand connections with its neighbors.
- 6:27Speaker 1: That's just a staggering amount of wiring, it really is.
- 6:31Speaker 2: And the way a single biological neuron operates is fascinating.
- 6:34Speaker 2: It receives incoming electrical signals through these branch like antennas
- 6:39Speaker 2: called dendrites.
- 6:40Speaker 1: Okay, dendrites, now.
- 6:41Speaker 2: Here is the crucial part. Each of those incoming connections
- 6:45Speaker 2: has a different strength based on how often it gets used.
- 6:48Speaker 1: Ah.
- 6:49Speaker 2: So, like muscle memory, almost exactly, that strength dictates how
- 6:53Speaker 2: much influence a specific input has on the neuron. The
- 6:56Speaker 2: neuron collects all these varying weighted signals, sums them together
- 7:00Speaker 2: in a central cell body, transforms that total into a
- 7:03Speaker 2: new signal, and fires it down a cable called the
- 7:05Speaker 2: axon to the next set of cells.
- 7:07Speaker 1: So to build our machine learning model, we basically just
- 7:10Speaker 1: need to translate that biological process into math. We need
- 7:13Speaker 1: to build an artificial neuron.
- 7:14Speaker 2: We do, and the translation is actually surprisingly direct.
- 7:17Speaker 1: Really yeah.
- 7:19Speaker 2: An artificial neuron takes in multiple numerical inputs. Before those
- 7:23Speaker 2: inputs enter the neuron, each one is multiplied by a
- 7:27Speaker 2: specific number called a weight. A weight Okay, that weight
- 7:30Speaker 2: is the mathematical equivalent of the connection strength in our
- 7:34Speaker 2: biological brain.
- 7:35Speaker 1: So like, a high weight means this particular input is
- 7:38Speaker 1: incredibly important, and a low weight means it's mostly ignored.
- 7:42Speaker 2: You've got it. So we multiply the inputs by their weights,
- 7:44Speaker 2: and we add them all together into a grand total. Right.
- 7:47Speaker 2: We also toss in a constant number called a bias,
- 7:50Speaker 2: just to help shift the result if needed. The textbook
- 7:53Speaker 2: calls this final sum the logit.
- 7:55Speaker 1: The logit okay, but just to keep the jargon out
- 7:57Speaker 1: for you listening, we can basically just think of the
- 7:59Speaker 1: logit as the grand total of all the weighted inputs.
- 8:03Speaker 2: Yes, the grand total is a perfect way to think
- 8:05Speaker 2: of it. And finally, just like the biological cell transforming
- 8:08Speaker 2: the signal before firing it out, our artificial neuron passes
- 8:12Speaker 2: that grand total through a mathematical transformation to produce its
- 8:16Speaker 2: final output.
- 8:17Speaker 1: Let's ground this a bit for you listening. The textbook
- 8:20Speaker 1: provides a really clean example of this, using something called
- 8:23Speaker 1: a linear perceptron.
- 8:24Speaker 2: Yes, a great example.
- 8:26Speaker 1: So imagine we have a single, lonely artificial neuron and
- 8:30Speaker 1: its only job is to predict whether you will score
- 8:33Speaker 1: above or below average on your next exam. Okay, it
- 8:37Speaker 1: only takes two inputs. Input one is the hours of
- 8:40Speaker 1: sleep you got last night. Input two is the hours
- 8:43Speaker 1: you spent studying.
- 8:44Speaker 2: So the model assigns a weight to the sleep input
- 8:47Speaker 2: and a weight to the study input. Right, it multiplies
- 8:50Speaker 2: your hours by those respective weights. As everything together and
- 8:54Speaker 2: spins out of prediction.
- 8:55Speaker 1: And as it looks at the historical data of past students,
- 8:58Speaker 1: it realizes when it makes a mistake, like it tastes
- 9:01Speaker 1: the food, realizes it needs salt and tweaks those weights. Uzach,
- 9:04Speaker 1: Maybe it discovers studying is twice as important as sleep.
- 9:07Speaker 1: So the study weight gets dialed up, and.
- 9:10Speaker 2: Eventually it settles on the optimal weights to correctly predict
- 9:13Speaker 2: the exam scores for everyone in the data.
- 9:16Speaker 1: Hold on, though, I have to step in here.
- 9:17Speaker 2: Sure, what's up?
- 9:18Speaker 1: If we can solve this exam prediction problem perfectly with
- 9:22Speaker 1: just one single artificial neuron, why is this entire field
- 9:27Speaker 1: called deep learning?
- 9:29Speaker 2: That is the big question, right?
- 9:31Speaker 1: Why are we talking about massive neural networks if one
- 9:35Speaker 1: neuron does the trick well?
- 9:37Speaker 2: Because the exam problem is a very simple linear relationship. Okay,
- 9:41Speaker 2: more studying generally equals a higher score. But think back
- 9:45Speaker 2: to our handwritten.
- 9:46Speaker 1: Digits, the messi, zeros and sixes.
- 9:48Speaker 2: Right, a single neuron cannot possibly look at a gride
- 9:51Speaker 2: of hundreds of raw pixels and capture the wildly complex
- 9:55Speaker 2: relationships required to tell a MESSI zero from a sloppy six.
- 9:58Speaker 1: It just gets overwhelmed exactly.
- 10:00Speaker 2: One neuron just doesn't have the capacity. We need architecture.
- 10:02Speaker 2: We need to stack these neurons into massive layers.
- 10:05Speaker 1: Ah, we need to build the equivalent of the human
- 10:08Speaker 1: visual cortex.
- 10:09Speaker 2: That's the goal. In what we call a feed forward
- 10:11Speaker 2: neural network, information flows in one direction, like an assembly line.
- 10:14Speaker 1: Okay, an assembly line.
- 10:15Speaker 2: We have an input layer that takes in the raw data,
- 10:18Speaker 2: all those individual pixels of an image, and at the
- 10:21Speaker 2: far end you have an output layer that gives you
- 10:23Speaker 2: the final answer.
- 10:24Speaker 1: But sandwiched in the middle are what we call the
- 10:27Speaker 1: hidden layers.
- 10:28Speaker 2: Yes, the hidden layers.
- 10:30Speaker 1: I see this term everywhere. What exactly are they hiding?
- 10:33Speaker 2: They're hiding the manual labor we used to have to
- 10:35Speaker 2: do as programmers.
- 10:36Speaker 1: All interesting.
- 10:37Speaker 2: The hidden layers are where the network learns to compress
- 10:40Speaker 2: and understand the data on its own. Instead of us
- 10:43Speaker 2: having to write rules about what a closed loop looks like,
- 10:46Speaker 2: the hidden layers automatically extract features.
- 10:50Speaker 1: How does that actually work?
- 10:51Speaker 2: Well? The first hidden layer might just look at raw
- 10:53Speaker 2: pixels and learn to recognize very basic shadows or straight edges.
- 10:58Speaker 2: It passes that information to the next layer.
- 11:00Speaker 1: So it's building up right right.
- 11:02Speaker 2: The second layer combines those edges to recognize a curve.
- 11:06Speaker 2: The third layer takes those curves and recognizes a closed loop.
- 11:10Speaker 1: Wow, it's literally building the concept of a number from
- 11:13Speaker 1: the ground up exactly. But the book points out a
- 11:16Speaker 1: massive trap here. It's called the nonlinearity rule.
- 11:19Speaker 2: Yes, this is huge.
- 11:20Speaker 1: It says if you build these hidden layers using the
- 11:22Speaker 1: simple linear neurons we use for the exam predictor, the
- 11:26Speaker 1: entire deep network just collapses in on itself.
- 11:29Speaker 2: This is a really common pitfall to understand. A linear
- 11:32Speaker 2: mathematical function basically just draws a straight line.
- 11:35Speaker 1: Okay, a straight line.
- 11:36Speaker 2: If you take the output of a linear equation and
- 11:39Speaker 2: you feed it into another linear equation, the math simplifies down.
- 11:44Speaker 2: The result is just another straight line.
- 11:46Speaker 1: Oh I see.
- 11:47Speaker 2: So no matter how many hundreds of hidden layers of
- 11:50Speaker 2: linear neurons you stack together, mathematically, they candense down and
- 11:54Speaker 2: behave exactly like a network with zero hidden layers.
- 11:57Speaker 1: That completely defeats the purpose exactly.
- 12:00Speaker 2: The depths becomes completely useless.
- 12:02Speaker 1: So we have to force the network to bend. We
- 12:05Speaker 1: need to introduce nonlinear math. So the layers don't just
- 12:08Speaker 1: collapse into a single straight line.
- 12:10Speaker 2: We do, and this is where that final step of
- 12:13Speaker 2: the neuron, the transformation, comes into play. Right. We use
- 12:16Speaker 2: activation functions to bend the output. Historically, one of the
- 12:19Speaker 2: first ones used was the sigmoid function. Sigmoid it takes
- 12:22Speaker 2: any input number, no matter how huge or how negative,
- 12:25Speaker 2: and mathematically squashes it into an S shaped curve between
- 12:28Speaker 2: zero and one.
- 12:29Speaker 1: Okay, so a massive input becomes something close to a one,
- 12:33Speaker 1: and a huge negative input gets squashed down to almost
- 12:36Speaker 1: zero exactly. But what if we need our model to
- 12:39Speaker 1: deal with negative numbers, like a scale of zero to one.
- 12:42Speaker 1: Doesn't leave room for.
- 12:43Speaker 2: That, which is why researchers develop the Ton function. Huh. Yeah,
- 12:47Speaker 2: it's another S curve, but it squashes everything between negative
- 12:51Speaker 2: one and positive one, so it's perfectly centered around zero.
- 12:54Speaker 1: Oh clever.
- 12:55Speaker 2: But both of these S curves have a flaw. When
- 12:58Speaker 2: networks get really deep, the squashing effect makes it hard
- 13:02Speaker 2: for the network to learn efficiently.
- 13:03Speaker 1: So what's the modern solution?
- 13:05Speaker 2: Then, a function with a terrible name but a brilliant design.
- 13:09Speaker 2: It's called the rectified linear unit or re LU. Re LU.
- 13:14Speaker 1: Yeah, I've seen that acronym. How does it bend the
- 13:16Speaker 1: line without squashing everything.
- 13:18Speaker 2: It creates a shape like a hockey stick.
- 13:19Speaker 1: Hocky stick.
- 13:20Speaker 2: Yeah, the rule is incredibly simple. If the input is
- 13:23Speaker 2: a negative number, ReLU just outputs a flat zero. It
- 13:26Speaker 2: shuts off. Okay. But if the input is a positive number,
- 13:29Speaker 2: it just outputs that exact same number.
- 13:31Speaker 1: Oh wow.
- 13:32Speaker 2: It bends the line sharply at zero, preventing the math
- 13:36Speaker 2: from collapsing. But it doesn't squash the large positive numbers,
- 13:40Speaker 2: which makes training deep networks vastly faster. It's heavily used
- 13:44Speaker 2: in computer vision today.
- 13:46Speaker 1: And then, after all these hidden layers have extracted the
- 13:49Speaker 1: edges and curves using their hockey stick math, we hit
- 13:53Speaker 1: the final output.
- 13:54Speaker 2: Layer right the end of the line.
- 13:55Speaker 1: And usually we don't just want the computer to screen
- 13:58Speaker 1: eight at us. We want to know how confident it is.
- 14:01Speaker 1: We want probabilities exactly.
- 14:03Speaker 2: We want the network to say, I am ninety percent
- 14:06Speaker 2: confident this is an eight, but there's a ten percent
- 14:09Speaker 2: chance it's.
- 14:09Speaker 1: A three, which is totally realistic.
- 14:11Speaker 2: To get that, we cap the network off with a
- 14:13Speaker 2: special function called softmas softmax. It looks at all the
- 14:16Speaker 2: final scores and mathematically forces them to add up to
- 14:19Speaker 2: exactly one hundred percent. It gives us a clear distinct
- 14:24Speaker 2: distribution of probabilities we can actually read.
- 14:26Speaker 1: Okay, let's take a breath here and look at the
- 14:28Speaker 1: digital brain we've just built.
- 14:30Speaker 2: It's a lot to take in.
- 14:31Speaker 1: It is. We have layers of artificial neurons acting like
- 14:36Speaker 1: biological synapses. They are multiplying inputs by weights, bending the
- 14:41Speaker 1: math with non linear hockey sticks, and passing the signals
- 14:44Speaker 1: deep down the line. But here's the elephant in the room.
- 14:48Speaker 1: Right out of the box, this brain is entirely empty.
- 14:52Speaker 1: All of those thousands of weights, the connection strength. They
- 14:55Speaker 1: start out as completely random, meaningless numbers. How does the
- 15:00Speaker 1: network actually figure out what the correct weights should be?
- 15:05Speaker 2: This is the process of training, and the textbook introduces
- 15:08Speaker 2: a fantastic analogy to explain how a network discovers these
- 15:12Speaker 2: unknown weights.
- 15:12Speaker 1: Oh, I love a good analogy.
- 15:14Speaker 2: It's called the fast food problem. Okay, let's put you
- 15:16Speaker 2: in the driver's seat for this one. Yeah, imagine you
- 15:18Speaker 2: go to a fast food restaurant every day. You always
- 15:21Speaker 2: order some random combination of burgers, fries, and sodas.
- 15:24Speaker 1: Sounds delicious, but.
- 15:25Speaker 2: There's a catch. The restaurant has no price tags on
- 15:27Speaker 2: the menu.
- 15:28Speaker 1: Sounds like a terribly run restaurant.
- 15:29Speaker 2: It really does. So you walk up to the counter
- 15:32Speaker 2: you know your inputs. Say you order two burgers, one fry,
- 15:34Speaker 2: and two sodas. The cashier rings it up and tells
- 15:37Speaker 2: you the final total bill is fifteen dollars. Your goal
- 15:41Speaker 2: is to figure out the individual secret price of a
- 15:44Speaker 2: single burger, a single fry, and a single soda.
- 15:49Speaker 1: And those secret prices represent the unknown weights our neural
- 15:52Speaker 1: network is trying to learn exactly.
- 15:54Speaker 2: Since you don't know the prices, you just have to guess, right.
- 15:57Speaker 2: Let's say you guess a burger is one dollar, a
- 16:00Speaker 2: fry is one dollar, and a soda is one dollar.
- 16:03Speaker 2: You do the math for your order and your guest
- 16:06Speaker 2: total is five dollars.
- 16:07Speaker 1: But the real total was fifteen.
- 16:09Speaker 2: Right. You compare your five dollars guests to the cashier's
- 16:12Speaker 2: reel total of fifteen dollars. The difference between your guess
- 16:16Speaker 2: and the reality is.
- 16:17Speaker 1: Your error, and in machine learning, we usually square that
- 16:20Speaker 1: difference right to make the big error stand out more.
- 16:23Speaker 2: We do we calculate the squared error, and obviously our
- 16:25Speaker 2: goal is to get that error down to zero. We
- 16:28Speaker 2: want our guest weights to perfectly predict the cashier's total
- 16:31Speaker 2: every single time.
- 16:32Speaker 1: But if I'm just guessing randomly, I could be eating
- 16:34Speaker 1: burgers for a decade before I stumble on the exact
- 16:36Speaker 1: right prices.
- 16:37Speaker 2: That's true.
- 16:38Speaker 1: How do we systematically get the error to zero without
- 16:41Speaker 1: just relying on blind luck.
- 16:43Speaker 2: We visualize the problem as a physical landscape. Imagine a
- 16:47Speaker 2: massive three D bowl A bowl, okay. The horizontal dimensions
- 16:51Speaker 2: of this bowl represent all the different possible prices you
- 16:54Speaker 2: could guess for the burgers and fries. The vertical depth
- 16:58Speaker 2: of the bowl presents your error.
- 17:01Speaker 1: So if my guesses are completely wrong, I am standing
- 17:04Speaker 1: way up high on the rim of the bowl.
- 17:06Speaker 2: Yep.
- 17:07Speaker 1: And the perfect correct prices where the error is zero
- 17:10Speaker 1: are located at the very bottom center of the bowl.
- 17:13Speaker 2: That's the landscape. When we make our initial random guesses,
- 17:18Speaker 2: we are essentially dropping a blindfolded hiker somewhere high up
- 17:22Speaker 2: on the slopes of this bowl.
- 17:23Speaker 1: Oh boy.
- 17:24Speaker 2: The network's job is to get the hiker to the bottom.
- 17:27Speaker 2: To do this, the network calculates the gradient. The gradient
- 17:30Speaker 2: think of the gradient as feeling the ground with your
- 17:32Speaker 2: foot to figure out which exact direction gives you the
- 17:35Speaker 2: steepest downward slope from where you are currently standing.
- 17:38Speaker 1: So the hiker feels around, finds the steepest way down
- 17:41Speaker 1: and takes a step in that direction exactly. This is
- 17:43Speaker 1: gradient descent. You recalculate the slope, take another step, and
- 17:48Speaker 1: repeat this until the ground goes completely flat. When it's flat,
- 17:51Speaker 1: you know you've reached the bottom of the bowl.
- 17:53Speaker 2: That is gradient descend in a nutshell. But it introduces
- 17:56Speaker 2: a really tricky problem for the engineers building these mods,
- 18:00Speaker 2: determining how big of a step the hiker should take.
- 18:03Speaker 1: Right Because if I'm blindfolded on a mountain, my step
- 18:06Speaker 1: size matters a lot.
- 18:07Speaker 2: In deep learning, we call this step size the learning rate,
- 18:10Speaker 2: and it is a crucial hyper parameter.
- 18:13Speaker 1: A hyper parameter.
- 18:14Speaker 2: Yeah, you have to multiply the steepness of the slope
- 18:17Speaker 2: by this learning rate to tell the network how far
- 18:20Speaker 2: to move.
- 18:20Speaker 1: And if you set the learning rate too high, you
- 18:22Speaker 1: give your blindfolded hiker giant hulk sized legs. They feel
- 18:27Speaker 1: the downward slope, they take a massive leap, and they
- 18:30Speaker 1: accidentally jump completely over the bottom of the valley and
- 18:33Speaker 1: land high up on the opposite wall.
- 18:34Speaker 2: They'll just violently bounce back and forth across the bowl,
- 18:38Speaker 2: never actually settling at the bottom.
- 18:39Speaker 1: And the reverse is just as problematic, I imagine it is.
- 18:43Speaker 2: If your learning rate is too small, your hiker takes microscopic, millimeter.
- 18:47Speaker 1: Sized steps, you'd never get there.
- 18:49Speaker 2: Well, they will eventually reach the bottom, but you'll be
- 18:52Speaker 2: waiting a lifetime for the model to finish training. Finding
- 18:55Speaker 2: that Goldilock's learning rate is one of the true arts
- 18:58Speaker 2: of training a neural network.
- 19:00Speaker 1: Okay, so the blindfolded hiker makes total sense. When we
- 19:02Speaker 1: are just trying to find the price of a burger
- 19:04Speaker 1: and fries. We only have a few weights to worry about, right,
- 19:08Speaker 1: But earlier we talked about deep, hidden layers. A modern
- 19:11Speaker 1: neural network doesn't have three weights. It has thousands or
- 19:15Speaker 1: even millions of connections, oh easily millions. If a specific
- 19:20Speaker 1: weight is buried deep in the middle of layer four,
- 19:23Speaker 1: how on earth does the hiker know which way to step?
- 19:25Speaker 1: How do you figure out the downward slope for one
- 19:28Speaker 1: tiny connection buried in the middle of a million others?
- 19:31Speaker 2: You just hit on the massive roadblock that stalled AI
- 19:34Speaker 2: research for years. Really, yeah, it wasn't practically solved until
- 19:38Speaker 2: a major breakthrough in nineteen eighty six, heavily championed by
- 19:41Speaker 2: researchers like Jeffrey Hinton. The algorithm is called back propagation.
- 19:45Speaker 1: Backpropagation propagating backward, Okay, but how does it actually work?
- 19:50Speaker 1: If you say, calculus, you're gonna lose me.
- 19:52Speaker 2: Don't worry. Let's avoid the math jargon and just look
- 19:54Speaker 2: at the mechanics. The problem is that we don't know
- 19:58Speaker 2: what those hidden neurons the middle of the network should
- 20:01Speaker 2: be doing. We only know what the very final output
- 20:04Speaker 2: layer did and whether it was right or wrong. Okay,
- 20:08Speaker 2: So backpropagation says start at the very end.
- 20:11Speaker 1: Okay, So we look at the final answer. Let's say
- 20:13Speaker 1: the network was eighty percent wrong.
- 20:15Speaker 2: Right. We take that final error and we look at
- 20:18Speaker 2: the layer immediately before the output. We figure out exactly
- 20:23Speaker 2: how much each neuron in that specific layer contributed to
- 20:27Speaker 2: the final mistake.
- 20:28Speaker 1: It's like asking who handed me this bad information?
- 20:31Speaker 2: A domino effect of blame.
- 20:32Speaker 1: Yes, exactly.
- 20:33Speaker 2: Once we figure out the blame for that last hidden layer,
- 20:35Speaker 2: we use that information to step backward again and figure
- 20:38Speaker 2: out the blame for the layer before it.
- 20:40Speaker 1: So you're just moving backward through the whole network.
- 20:43Speaker 2: We cascade this calculation backward, layer by layer all the
- 20:47Speaker 2: way to the input. By doing this reverse domino effect,
- 20:51Speaker 2: we can figure out the exact gradient, the exact path
- 20:55Speaker 2: of steepest descent for every single weight in the network,
- 20:58Speaker 2: no matter how deeply buried it is. Wow. It tells
- 21:01Speaker 2: the network exactly how to tweak every single connection simultaneously
- 21:06Speaker 2: to make the overall air slightly smaller on the next try.
- 21:09Speaker 1: That is unbelievably elegant. We can seamlessly update millions of
- 21:13Speaker 1: parameters at once just by tracing the error backward.
- 21:16Speaker 2: It really is beautiful.
- 21:17Speaker 1: But the textbook warns of one final major trap here.
- 21:20Speaker 1: It says that if we aren't careful with how we
- 21:22Speaker 1: feed the data to our blindfold and hiker, they can
- 21:25Speaker 1: get totally stuck in the mountain.
- 21:27Speaker 2: Yeah. This brings us to the danger of using what's
- 21:29Speaker 2: called batch gradian descent.
- 21:30Speaker 1: Batch gradient descent.
- 21:31Speaker 2: Okay, let's say you have a data set of fifty
- 21:33Speaker 2: thousand images of handwritten digits. In batch grading descent, you
- 21:37Speaker 2: force the network to look at all fifty thousand images,
- 21:40Speaker 2: calculate the total average error for the whole batch, and
- 21:43Speaker 2: then take one single step down the mountain.
- 21:45Speaker 1: That sounds incredibly slow, But why is it dangerous?
- 21:48Speaker 2: Because if you use the exact same massive data set
- 21:51Speaker 2: to calculate every single step the mountain, your aeror landscape
- 21:55Speaker 2: is totally static. It never moves or changes shape.
- 21:59Speaker 1: And a static the mountain is bad because wait, these
- 22:01Speaker 1: landscapes aren't perfectly smooth bowls, are they?
- 22:04Speaker 2: They are not real high dimensional error landscapes are rugged.
- 22:08Speaker 2: They have flat regions called saddle points or plateaus. Oh no,
- 22:12Speaker 2: imagine our blindfolded hiker walking down the mountain and suddenly
- 22:16Speaker 2: they wander out onto a wide, perfectly flat parking lot
- 22:19Speaker 2: halfway down the slope.
- 22:20Speaker 1: Oh I see. They feel around with their foot and
- 22:23Speaker 1: there's no downward slope. The ground is flat. The gradient
- 22:26Speaker 1: is zero.
- 22:26Speaker 2: And because the gradient is zero, the algorithm thinks, great,
- 22:30Speaker 2: the ground is flat. I must have reached the bottom
- 22:31Speaker 2: of the bowl. Er is zero.
- 22:33Speaker 1: But they aren't at the bottom.
- 22:34Speaker 2: They're just marooned on a ledge. The network completely stops learning,
- 22:38Speaker 2: even though it's still making terrible predictions.
- 22:40Speaker 1: So how do we rescue the hiker? How do we
- 22:42Speaker 1: get them off the plateau?
- 22:44Speaker 2: We change the terrain on them. Change the terrain yeah,
- 22:46Speaker 2: we use a technique called stochastic gradient descent or SGD.
- 22:49Speaker 2: SGD the words stochastic just means random. Instead of using
- 22:53Speaker 2: all fifty thousand images to calculate the slope, we estimate
- 22:57Speaker 2: the air using only a single random training exams ample
- 23:00Speaker 2: at a time.
- 23:01Speaker 1: So instead of the whole batch, the hiker takes a
- 23:03Speaker 1: step based on the air of just one single image
- 23:06Speaker 1: of like a number three.
- 23:07Speaker 2: Yes, and here is the genius of it, Because every
- 23:10Speaker 2: single image in your data set is slightly different, a
- 23:13Speaker 2: messy three, a neat three, a slanted three. The topography
- 23:17Speaker 2: of the mountain constantly dynamically shifts with every single step
- 23:21Speaker 2: you take.
- 23:22Speaker 1: Oh, that's brilliant. It's like a continuous earthquake is rippling
- 23:25Speaker 1: through the air landscape.
- 23:26Speaker 2: Yes, exactly like an earthquake.
- 23:28Speaker 1: If the hiker accidentally wanders onto a flat plateau, the
- 23:31Speaker 1: very next image they look at shifts, the mountain, the
- 23:33Speaker 1: plateau tilts, the ground drops out from under them, and
- 23:37Speaker 1: the hiker gets jiggled right off the ledge. So they
- 23:39Speaker 1: can keep.
- 23:39Speaker 2: Descending that stochastic jiggling is the secret sauce. It's exactly
- 23:44Speaker 2: what prevents the algorithm from getting trapped in shallow flat lands.
- 23:47Speaker 2: It keeps the descent alive, bumping and sliding down the
- 23:50Speaker 2: mountain until it finds a true, deep valley of low error.
- 23:54Speaker 1: Let's take a breath and look back at the whole journey.
- 23:57Speaker 1: We started with the sheer impossibility of writing hard coded,
- 24:00Speaker 1: if thin rules to recognize something as simple as a
- 24:04Speaker 1: sloppy handwritten zero.
- 24:05Speaker 2: Because the traditional rules always break right, so.
- 24:08Speaker 1: We realized we needed to mimic the biological brain. We
- 24:11Speaker 1: build artificial neurons that multiply inputs by varying weights.
- 24:15Speaker 2: We stacked those neurons into massive hidden layers, injecting nonlinear
- 24:20Speaker 2: math like those hockey stick functions, so the network could
- 24:23Speaker 2: automatically extract complex unseen features without us having to code them.
- 24:28Speaker 1: And finally, we taught this digital brain how to actually learn.
- 24:32Speaker 1: We sent it blindly stepping down a mathematical mountain, using
- 24:35Speaker 1: backpropagation to trace its errors, and stochastic earthquakes to keep
- 24:39Speaker 1: it from getting stuck on flat ledges.
- 24:41Speaker 2: It is a profoundly beautiful system. It takes these very
- 24:43Speaker 2: foundational principles of calculus and biology and scales them up
- 24:48Speaker 2: into something that borders on magic.
- 24:49Speaker 1: So the next time you pick up your phone and
- 24:51Speaker 1: you ask a voice assistant a question, or the facial
- 24:54Speaker 1: recognition instantly unlocks your screen, take a moment to appreciate
- 24:57Speaker 1: what's actually happening behind the glass. There isn't a massive,
- 25:01Speaker 1: dusty encyclopedia of rules inside your phone trying to cross
- 25:05Speaker 1: reference the exact geometry of your nose. No.
- 25:08Speaker 2: Yeah, you are interacting with an incredibly complex, multi layered
- 25:12Speaker 2: topography of mathematical weights, a model that is constantly evaluating inputs,
- 25:18Speaker 2: bending the math and finding the path of least error.
- 25:21Speaker 1: It's remarkable, but it does leave me with one final
- 25:24Speaker 1: slightly provocative thought for you to chew on as we
- 25:27Speaker 1: wrap up Cohl.
- 25:27Speaker 2: Let's hear it.
- 25:28Speaker 1: We've established today that our most advanced artificial intelligence fundamentally
- 25:32Speaker 1: relies on taking blind steps down an error gradient. But
- 25:35Speaker 1: it's doing this based entirely on past example.
- 25:38Speaker 2: Right, the historical training data exactly.
- 25:41Speaker 1: It relies on navigating a mountain that we have constructed
- 25:44Speaker 1: out of past data. So what happens when we ask
- 25:46Speaker 1: this intelligence to navigate a completely novel situation, that is
- 25:50Speaker 1: the big unknown, a crisis, or a totally unique problem
- 25:54Speaker 1: where the valley of a correct answer hasn't even been
- 25:57Speaker 1: mapped out yet. Does it actually have the capacity to
- 25:59Speaker 1: leap off the mountain entirely and invent something new or
- 26:02Speaker 1: are we just building incredibly fast toddlers trying to guess
- 26:04Speaker 1: what a dog looks like based on what they saw yesterday.
- 26:07Speaker 1: Something to think about until next time. Keep diving deep.