Lecture 02: Training Neural Networks
Section 1: A Simple Neural Network Example
Back when I was interning, we coded up a neural network for handwritten digit recognition — one of the most basic examples today — in two or three hundred lines of C. That included writing the training code, the backpropagation code, debugging all of it. Now with Keras, you just call compile and fit. Compile sets up the training configuration, and fit is the actual training step — that's where all the learning happens. All the optimization algorithms are hidden behind the scenes. But here's the important caveat: even though the framework abstracts everything away, it's critical to understand how these algorithms work underneath. Otherwise you'll get really weird behavior and have absolutely no idea why. The model won't do what you want, and you won't know how to debug it. So even though you won't be writing your own backpropagation algorithm from scratch, you still need a solid mental model of what's going on so you can diagnose problems when they inevitably come up.
The fit call handles all the training for you — it runs the optimization algorithms behind the scenes. But I want to emphasize this point again: understanding what's happening below the surface is essential. These frameworks make it incredibly easy to build neural networks. If I want 100 layers, I could write 100 lines, or just use a for loop. Super easy to make really big networks. But the real challenge is that these networks have millions, hundreds of millions, billions of parameters. How do you actually pick the right numbers? That's the training problem. You've had some exposure to this already, but we're going to go deeper. First, let me walk you through a historical example of a simple neural network. This comes from your textbook. Recall that in the late 1960s, a famous paper argued that neural networks could never work — that they fundamentally couldn't learn certain functions. The function they pointed to was XOR, the simple binary logic function.
XOR is a binary logic function — look at the truth table. Two inputs, X1 and X2, and the output is like OR except when both inputs are one, the output is zero. If you graph it, you get ones at (0,1) and (1,0), zeros at (0,0) and (1,1). Simple enough that we'd expect a neural network to learn it. We want a network that, given these four input pairs, reproduces this truth table exactly. But here's an interesting question: what should the network output at (0.5, 0.5), right in the middle? The answer is there really is no right answer. We've only defined the function at the four corners. We haven't told the network what to do everywhere else. It's going to pick something — probably not minus one million, but could be near zero, could be near one. This is one of the key things about machine learning: you give it examples and it figures things out. But if you don't provide an example for a particular input, the network will just pick something, and it probably won't be what you want.
The reason that 1960s paper got it wrong is they only considered single-layer networks. You actually need more than one layer plus nonlinearities to solve XOR. With just one layer, you cannot solve this problem. The key insight is having at least two layers. Here we have a two-layer network: the first hidden layer has two neurons, and the output layer has one neuron. The inputs X1 and X2 are just features, not counted as a layer. I've written out the math so you can see the actual computation — what happens when you propagate inputs through the network. I'm computing all four inputs simultaneously in batch form. This is how it works in practice: GPUs process hundreds of examples at once because they have many parallel processing units, making batch computation most efficient. But you can take any single input pair, plug it in, and get the same answer. For this example, I'm giving you the parameters directly — the weight matrix is all ones, biases on the first layer are zero and minus one, second layer weights are one and minus two, output bias is zero.
Let's walk through the actual computation step by step. First, we take all our inputs — the four pairs (0,0), (0,1), (1,0), (1,1) — and multiply by the weight matrix of the first hidden layer. This is standard matrix multiplication. So (0,0) gives you zeros, and so on for each input pair. I'm assuming you know how matrix multiplication works — if not, go look it up right after this. After the matrix multiplication, we get the weighted inputs. The next step is to add the bias. The bias — sometimes we call it b, here we're calling it c — is a constant that gets added to each neuron's output. For the first hidden layer, the biases are zero and minus one. This is the standard sequence in a neural network: multiply inputs by weights, add the bias, then apply the activation function. We'll see that the nonlinear activation is what actually makes this network capable of solving XOR, which a single linear layer could never do.
Section 1: Optimization and Gradient Descent
Here we're walking through the actual computation of a hidden layer. We take our input vectors, multiply by the weight matrix, and add the bias term — which is the same constant added to each example. Each column in our result corresponds to a neuron in the hidden layer, and each row corresponds to one of our four input examples. After the matrix multiplication and bias addition, we still need to apply the activation function. In this case we're using ReLU, which is simply the max operation — take the maximum of zero and the value. Once we apply ReLU element-wise, we finally have the output of the first hidden layer. This is literally what the computer is doing under the hood: matrix multiplications followed by activation functions, layer by layer. You can trace through these calculations yourself to build intuition for how data flows through a neural network. Each step is straightforward linear algebra plus a simple nonlinear function.
Moving to the second layer, which has just one neuron with two weights: 1 and negative 2. We multiply each row by these weights, add the bias of zero, and get our final outputs. For our four XOR inputs — (0,0), (0,1), (1,0), (1,1) — the network correctly produces 0, 1, 1, 0. Under the hood, it's all matrix multiplications, and GPUs are specialized hardware that do these really fast. Now here's the really interesting part: why neural networks are special. XOR is not linearly separable — you cannot draw a single line in the original X1, X2 space to separate the 1s from the 0s. But after the first hidden layer transforms the inputs into H1, H2 space, suddenly the classes become linearly separable. The network learned a transformation — essentially automatic feature engineering — that makes the problem easy. Two different input points actually map to the same point in this new space. This is the magic of neural networks: given the right parameters, they learn transformations in earlier layers that simplify the problem for later layers, eliminating the need for manual feature engineering.
Now let's get into the theory, starting with optimization. Optimization problems are typically framed as minimization or maximization, but they're equivalent — just negate the function to convert between them. In machine learning, we focus on minimization. The goal is simple: given some function with multiple inputs, find the input values that minimize it across all possible inputs. Optimization problems appear in every discipline of science and engineering. In machine learning specifically, this function is called the objective function or the loss function. The loss function terminology is much more common in machine learning, so that's the term you should remember. In other domains you might hear it called the cost function, utility function, or fitness function — different names, same core idea. We have some function and we want to find its minimum. This concept is foundational to everything we'll cover in deep learning.
The critical distinction in optimization is between convex and non-convex functions. The intuitive test: if you pick any two points on the function's graph and draw a line segment between them, a convex function keeps that segment entirely above the curve. For non-convex functions, that line can dip below the curve. This matters enormously because for convex functions, any local minimum is guaranteed to be the global minimum. For non-convex functions, you can get stuck at a local minimum that's far from optimal. We have many reliable techniques for finding local minima, but essentially no general methods for guaranteeing the global minimum of non-convex functions. There are many optimization algorithms — simplex, Newton's method, coordinate descent, simulated annealing — each suited to different contexts and constraints. But the only one we really care about for deep learning is stochastic gradient descent and its variations. That's what underpins virtually everything in the field.
The key observation from calculus that drives gradient descent is this: given a multivariable function that is differentiable at a point, the direction of steepest descent is the negative gradient. The gradient generalizes the derivative to multiple dimensions — it's a vector of partial derivatives with respect to each input variable. If you take a step in the direction of the negative gradient, you're moving in the direction that decreases the function value most rapidly. Repeat this process, and you'll eventually reach a local minimum. For a concrete example, take y equals x squared. The derivative is 2x. At the point x equals 1, the gradient is 2 — positive, pointing right. Taking a step in the negative direction moves us left, downhill toward the minimum. At x equals negative 1, the gradient is negative 2, so the negative gradient points right, again toward the minimum at zero. Even for more complex multivariable functions, this same principle applies — always step opposite to the gradient.
The gradient descent algorithm is conceptually simple: keep taking small steps in the direction of the negative gradient. You start at some initial guess, then iteratively update your position. The key parameter is the step size, often called gamma or the learning rate. You don't have to use the same step size at every iteration — you can vary it. Under certain conditions, if you take enough steps with appropriate step sizes, you'll converge to a local minimum or get arbitrarily close to one. The update equation is straightforward: new position equals old position minus the step size times the gradient evaluated at your current position. The interplay between gradient magnitude and step size determines how the algorithm behaves. Where the function is steep, the gradient is large, so you take bigger steps even with a moderate learning rate. Where it flattens out near the minimum, the gradient shrinks, and combined with a decaying step size, the algorithm naturally settles into the minimum.
Walking through a concrete gradient descent example with a slightly more complex function, we can see the algorithm in action. Starting from an initial point at 0.1, with a step size that halves each iteration, the trajectory is color-coded to show progression. In the early steps, the function is relatively flat near the starting point, so even with a larger step size, the steps are small because the gradient itself is small. As we move into steeper regions, the steps get larger because the gradient magnitude increases — we descend quickly. Then as we approach the minimum where the function flattens out again, two things conspire to slow us down: the gradient gets smaller and our step size has been shrinking by half each iteration. The algorithm naturally settles near the minimum around negative 2.5. This demonstrates the elegance of gradient descent — just repeatedly stepping in the direction of the negative gradient with appropriate step sizes, and the algorithm finds the minimum.
What happens when we change the starting position? Starting at -3.5, gradient descent takes a big step, overshoots the local minimum, but the negative gradient direction pulls it back down. Eventually it settles into that local minimum. Starting at a different position like 1, the algorithm overshoots in the other direction, oscillates, and settles into a different local minimum. This illustrates a critical point: the initial starting position matters. Since gradient descent only guarantees convergence to a local minimum, where you start determines which minimum you end up in. You might land in a local minimum that is not the global minimum of the function. In this example, the algorithm finds a local minimum but misses the deeper global minimum elsewhere on the curve. This is one of the fundamental challenges with gradient descent on non-convex functions — there is no guarantee you will find the best solution, only the nearest downhill destination from your starting point.
Now let's look at what happens when we change the step size. We saw some oscillation before, and the step size plays a big role in that behavior. Here we compare two step sizes — gamma of 0.05 and gamma of 0.025 — both starting from the same position of -3.5. The slope at that starting point is very steep, so with a larger step size of 0.05, the algorithm takes a massive jump, leaping all the way past the nearby minimum. The step size directly controls how far we move in each iteration, and on steep gradients, even modest step sizes can produce dramatically large jumps. This sets up the key tradeoff we need to understand about step size selection in gradient descent.
With the larger step size of 0.05, the algorithm jumps over the nearby minimum and starts descending elsewhere. But with half the step size at 0.025, it stays in the local minimum and converges there. The step size matters enormously — too large and you jump over the minimum you want. It can also cause persistent oscillation, bouncing back and forth without converging. Too small and convergence takes forever. This is one of the key things you have to figure out in practice. This parameter is often called the learning rate, and it is genuinely fiddly with neural networks. The last example shows what happens when you combine a different starting position with a constant step size that never shrinks. The algorithm bounces back and forth across the minimum indefinitely, never settling down. The convergence guarantee for gradient descent actually requires shrinking the step size over time. A student asked whether a large step size might accidentally find the global minimum by skipping local ones — yes, it is possible, but it is essentially luck depending on starting position and step size.
Let's review Section 1. We have covered the core intuition behind gradient descent, and we will build on this when we discuss stochastic gradient descent. First review question: what is an objective or loss function? It is the thing we are trying to minimize or optimize. In a machine learning context, the loss function measures the difference between what our model outputs and what we expect — the gap between predictions and actual values. Second: why are optimization problems hard? Because we often have non-convex functions, and we can fall into a local minimum instead of the global minimum. We simply do not have reliable methods to find global minima of non-convex functions. Third: explain the intuition behind gradient descent. You take steps in the direction of the negative gradient. With appropriately sized steps and some mild assumptions, you will converge to a local minimum. That is the core idea — follow the steepest downhill direction, step by step.
Section 2: Stochastic Gradient Descent
Most interesting functions in practice are non-convex, which is precisely why optimization is so challenging — we do not know how to reliably find global minima. Now we move to Section 2: stochastic gradient descent. The key questions to focus on are: what distinguishes stochastic gradient descent from regular gradient descent? What is a mini-batch? What are hyperparameters, and which ones need tuning? What effect does varying the mini-batch size have? In machine learning, loss functions typically take the form of a summation over individual losses from each data point. You have many data points, your model produces estimates, and you compare against the actuals. Many of these models are probabilistic — you have a probability for each observation parameterized by theta. The optimization problem is to find the theta values that maximize the likelihood, meaning the probability of observing your actual data. This leads to the maximum likelihood framework, where we want to adjust parameters so the model best explains the data we see.
Maximizing the likelihood is equivalent to minimizing the negative log-likelihood. Why take the log? Two reasons. First, the log is a monotonic transformation, so maximizing a function is the same as maximizing its log — they have the same optimal point. Second, and more practically, probabilities involve products across data points. When you take the log of products, they become sums: log of P(y1) times P(y2) becomes log P(y1) plus log P(y2). Sums are much easier to work with mathematically and computationally than products. So we transform the maximum likelihood problem into minimizing the negative sum of log probabilities across all data points. This is why you see loss functions in machine learning written as summations — each term corresponds to one data point's contribution to the overall loss. This summation structure is fundamental and will become especially important when we discuss stochastic gradient descent, because it means we can approximate the full loss by looking at subsets of the data.
The key insight is that the negative log-likelihood decomposes into a sum over individual data points: minimize the sum from i equals 1 to n of the negative log probability for each observation. This summation structure is fundamental to how we set up machine learning loss functions. Each data point contributes independently to the total loss, and the overall objective is simply the sum of all these individual contributions. This mathematical property — that our loss function is a sum over data points — is what makes stochastic gradient descent possible. Rather than computing the gradient over all n data points at once, we can estimate it using subsets. The summation form also connects back to the probabilistic foundations: we assumed independent observations, which gave us a product in the likelihood, which became a sum after taking the log. This clean decomposition is not just a mathematical convenience — it is the structural property that enables scalable optimization in modern deep learning.
So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions.
So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions.
So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions.
So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions.
So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions.
So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions.
So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions.
So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions.
So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions.
So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions.
So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions. So, this is actually the sum of all the additions.
Let me show you how simple it is to build a neural network in code. We'll be using Keras, which is one of the higher-level Python frameworks — very easy to use. You import a few things, and then using the Sequential API, you just stack layers. Remember, one of the names for feedforward neural networks is "dense" — so you see dense layer, dense layer, dense layer. The first parameter is how many neurons you want in that layer. Here we have a three-layer network with widths of two, three, and one neuron respectively. You specify the activation function for each layer. The last layer has no activation specified, which means it's just the identity function — it can output anything from negative infinity to positive infinity. Once the model is trained, you feed in a vector and get outputs, just like calling a function. This is maybe five lines of code. When I was interning, we wrote two or three hundred lines of C to do the same thing, including all the training and backpropagation code. Now the frameworks handle everything.