MIT 6.S191 Deep Learning Intro


MIT 6.S191 Deep Learning Intro

Hope
So this course, MIT 6.S191, is a one-week intensive bootcamp on deep learning, and the intro video they showed was actually generated using deep learning—voice synthesis and video replacement to mimic Barack Obama. It's a powerful demonstration, but it also raises ethical concerns they'll address later.

Corey
Right, and that sets the stage for why deep learning is such a big deal. But before diving in, they clarify what we mean by intelligence, AI, machine learning, and deep learning. Intelligence is the ability to process information to inform decisions; AI builds algorithms to do that artificially. Machine learning is a subset where algorithms learn without explicit programming, and deep learning takes it further by automatically extracting useful features from raw data.

Hope
Exactly. And the course covers neural networks, sequential modeling, computer vision, generative modeling, and reinforcement learning over the first three days, then guest lectures and final projects. They also mention software labs after each lecture day that build on the foundations. For credit, you can either do a group project proposing a novel deep learning idea or a one-page paper review.

Corey
And they give out cool prizes like NVIDIA GPUs for the best project proposals. But let's get into the core content. The fundamental building block is a single neuron, or perceptron. You have inputs x1 to xm, each with a weight, you take the dot product, add a bias, and pass it through a nonlinear activation function to get the output.

Hope
The bias term is important because it shifts the activation function left or right independent of the inputs. And mathematically, you can express the whole thing as y = g(W·X + b), where g is the activation function. One common activation is the sigmoid, which squashes any real number to between 0 and 1, making it useful for probabilities.

Corey
Activation functions introduce nonlinearities, which is crucial because real-world data is nonlinear. If you only use linear activations, no matter how many layers you stack, you're just composing lines and can't capture complex patterns. Nonlinearities allow neural networks to approximate arbitrarily complex functions.

Hope
They illustrate this with a simple two-input, one-hidden-neuron network. For a given set of weights, the neuron computes a line in the input space. The sigmoid then decides if a point is on one side or the other. That's a binary classifier. But as networks grow, you have millions of parameters, and visualizing becomes impractical.

Corey
So to build a neural network, you stack layers of perceptrons. A dense or fully connected layer means every input connects to every output. In TensorFlow, you can implement a dense layer with `tf.keras.layers.Dense`. For a single hidden layer network, you define two dense layers and combine them in a sequential model.

Hope
And for deep neural networks, you just keep stacking more layers. The code is basically the same—just add more `Dense` layers in the `Sequential` model. Now, how do we actually train these networks to solve a task? They use the example of predicting whether you'll pass the class based on lectures attended and project hours.

Corey
Initially, the network has random weights, so it gives a bad prediction. To train it, we need to quantify its error using a loss function. For binary classification, they use softmax cross-entropy loss, which was introduced by Claude Shannon at MIT. It measures how different the predicted probability distribution is from the true distribution.

Hope
For regression problems, like predicting a final grade, you'd use mean squared error loss instead. Once we have the loss, we want to find the weights that minimize it. That's done with gradient descent: start with random weights, compute the gradient of the loss with respect to each weight, and take a step in the opposite direction, scaled by a learning rate.

Corey
The gradient tells us the direction of steepest ascent, so we go the opposite way downhill. But computing gradients for all weights is done via backpropagation, which is just repeated application of the chain rule. You propagate the error from the output back to the input, layer by layer. Modern frameworks like TensorFlow do automatic differentiation, so you don't have to implement it manually.

Hope
Training in practice is tough because the loss landscape is complex with many local minima. The learning rate is critical: too small and you get stuck; too large and you diverge. One solution is adaptive learning rates, where the rate changes during training. Examples include SGD, Adam, and RMSprop. You can experiment with these in the labs.

Corey
Another key idea is mini-batching. Computing the gradient over the entire dataset is computationally expensive, so we use a mini-batch of, say, 32 or 128 points. This gives a good gradient estimate, is much faster, and allows for larger learning rates. Plus, it's parallelizable across GPUs.

Hope
Lastly, they discuss overfitting—where the model memorizes training data but fails on new data. To combat this, we use regularization techniques like dropout. During training, randomly set a fraction of neuron activations to zero (e.g., 50%). This forces the network to learn multiple pathways and generalize better.

Corey
Another technique is early stopping. As training progresses, the training loss keeps decreasing, but at some point the validation loss starts to increase—that's when overfitting begins. You stop training at that inflection point. That's a simple but effective way to prevent overfitting without extra computation.

Hope
So to recap: we learned the perceptron, building deep networks with layers, training via backprop and gradient descent, and practical tips like mini-batching, adaptive learning rates, dropout, and early stopping. That's a solid foundation for the rest of the course.

Ask anything
We've read this whole study set, so questions about it get the best answers.