Deep Learning Midterm Review — concepts from ML basics to optimizers (4 widgets + 10-question quiz)
① Machine Learning Basics → ② Linear Regression & Gradient Descent → ③ Perceptron → ④ MLP & Backpropagation → ⑤ Learning Rate & Optimization → ⑥ 10-Question Summary Quiz
The calculator isn't meant for test prep, but is a hands-on tool to get a feel for the concepts.Try playing around with it for just 3 minutes.
① Basics of Machine Learning (Chapter 3)
Traditional programming is a method where humans write algorithms and hand them over to a computer. Writing code for a procedure that looks at a photo of a dog and identifies it as a dog is nearly impossible even for humans. Machine learning flips this direction: by providing many photos and just the correct answers saying "this is a dog," the system finds the rules on its own.
A key exam point is matching names and years: Arthur Samuel, 1959, IBM Checkers program — this combination is the origin of the term "Machine Learning."
flowchart TD AI[Artificial Intelligence AI] --> ML[Machine Learning ML] ML --> DL[Deep Learning DL] ML --> S1[Supervised Learning: Regression · Classification] ML --> S2[Unsupervised Learning: Clustering · Dimensionality Reduction] ML --> S3[Reinforcement Learning: Value-Based · Policy-Based · Actor-Critic]
You can memorize the concept diagram as follows: Artificial Intelligence ⊃ Machine Learning ⊃ Deep Learning, and under Machine Learning, it branches into Supervised, Unsupervised, and Reinforcement Learning.
- Supervised Learning: Learning with a teacher where correct answers (labels) are provided. If the output is a continuous value, it is regression; if it is divided into classes, it is classification (e.g., dog/cat). Classification algorithm examples: Neural Networks, kNN, SVM, Decision Trees.
- Unsupervised Learning: Self-classification without labels (clustering, dimensionality reduction).
- Reinforcement Learning: Value-based, policy-based, actor-critic.
Three key terms were also introduced: Feature is the input value used for distinction (such as a beverage's color or acidity); Data Labeling is the process where humans attach correct answers (the PPT used the metaphor "attaching doll eyes in the 21st century"); and Training Data (for learning) and Test Data (for evaluation, data the model has never seen before) are always kept separate.
② Linear Regression and Gradient Descent (Chapter 4)
Regression predicts continuous values (e.g., house prices), while classification predicts categories. The basic formula for linear regression is f(x) = Wx + b — the slope W is called the weight, and the intercept b is called the bias. If there is one x, it is simple linear regression; if there are multiple, it is multiple linear regression.
The sum of squared errors between the data and the line is the loss function, and machine learning ultimately boils down to finding W and b that minimize this loss. There are two minimization methods: for simple regression, statistics' ordinary least squares, and for complex models, gradient descent. This method steps down incrementally in the direction opposite to the slope (gradient) of the loss.
Two pitfalls of gradient descent are also exam points: if the learning rate is too large, it diverges, and while stepping down, it can get trapped in a local minimum.
[Interactive 1] Gradient Descent Simulator — Exact PPT Code
Even if calculation problems don't appear, the concept of divergence will. This is a tool to run the PPT code (X=[0,1,2], y=[3,3.5,5.5], W=b=0, η=0.01, 1000 epochs). If you gradually increase the learning rate slider from 0.01, you can directly observe the moment it diverges.
Note: Running it 1000 times with η=0.01 converges to W≈1.253, b≈2.746.
Overfitting occurs when the model fits training data well but performs poorly on new data (generalization), while underfitting means it fails to fit even the training data. In case of underfitting, the model itself needs to be replaced.
③ Perceptron (Chapter 5)
A single-unit artificial neural network devised by Rosenblatt in 1957. Two advantages of neural networks: ① Ability to learn from examples, ② The overall system remains intact even if some components malfunction (fault tolerance).
Converting the weighted sum of inputs into an output is done by an activation function — initially, it was a step function (1 if above a threshold, 0 otherwise).
[Interactive 2] Perceptron Gate Calculator — AND Gate
The PPT configuration (w1=w2=1, b=-1.5) forms an AND gate. Use the slider to increase b to near -0.5 to see it change into an OR gate (0,1,1,1).
Learning Algorithm: Incorporating bias b as w0 (1 at the very end of input), updating weights upon misclassification — if misclassifying 1 as 0, it increases by η × (1-0) × x; if misclassifying 0 as 1, it decreases. Uses η=0.2, epochs=10.
Limitation of perceptrons: A single unit cannot solve XOR. This limitation is why we move to MLPs.
④ MLP and Backpropagation (Chapter 6)
MLP consists of an Input Layer - Hidden Layer - Output Layer structure. 3 steps of learning: Forward Pass (Input → Hidden → Output) → Error Calculation → Backward Pass (Weight adjustment).
Activation functions are all non-linear — if stacked linearly, no matter how many layers you stack, it is equivalent to a single linear layer and thus useless. Comparing the four is an exam point: Step (early Perceptrons), Sigmoid (S-curve, 1980s tradition), ReLU (keeps values above 0, currently most popular), tanh (similar to Sigmoid, output -1 to 1).
For the forward pass, hand-calculation practice was covered (weighted sum of inputs → Sigmoid → hidden layer output → repeat → output layer).
[Interactive 3] MLP Forward Pass Calculator
2 Inputs - 2 Hidden - 1 Output. Change the weights to observe the flow: z (weighted sum) → Sigmoid → Output.
The loss function is MSE = 0.5 × Σ(y−t)². PPT example: if the prediction is close to the ground truth, it's 0.03; if far, it's 0.81.
[Interactive 4] MSE Calculator — Including PPT Example Presets
Backpropagation — Propagating the loss from the output layer towards the hidden layer to adjust weights. Derivation uses the calculus chain rule. Hidden layer error is calculated by propagating output layer error backwards, and this error value is delta (δ). Gradient = delta × unit output.
⑤ Learning Rate, Batch, Optimization (Chapter 7)
Three timing methods for weight updates — matching their characteristics is tested.
| Method | Description | Characteristics |
|---|---|---|
| Online Learning (SGD) | Update per 1 sample | Shaken by noisy samples |
| Full Batch | Update after processing all | Stable but slow |
| Mini-batch | Update per batch | Compromise between the two, relatively stable convergence |
Processing multiple samples simultaneously is implemented via matrix multiplication (batch learning).
Learning Rate: Diverges if too large, slow if too small. Momentum: Accelerates using momentum + helps escape local minima. Adaptive family: Adagrad (learning rate decay inversely proportional to cumulative gradient sum, default 0.01, limitation where learning rate becomes too small with long training) → RMSprop (proposed by Hinton, exponentially weighted moving average) → Adam (= RMSprop + Momentum, currently most popular). Memorize them in genealogical order.

