Master Study Guide: Artificial Neural Networks and Machine Learning Foundations
Module 1: Foundations of Supervised Learning
1.1 Formal Setup and Terminology
Supervised learning aims to learn a function that maps an input vector to an output target value. An object is represented by a feature vector of length d:
x=(x(1),…,x(d))T
A dataset with l objects and target values y∈R is represented by the data matrix Z:
Z=(XyT)
where X is a d×l matrix containing the feature vectors xi as columns, and y is the target vector.
1.2 Generalization Error and Risk
The generalization error (or risk) measures how well a model g(x;w) performs on unseen future data, defined as the expected loss:
An overly simple model yields high bias (underfitting), while a highly complex model yields high variance (overfitting).
Module 2: Probabilistic Framework and Linear Models
2.1 The Probabilistic Framework
Bayes' Theorem dictates the relationship between the joint, marginal, and conditional probabilities:
p(y∣x)=p(x)p(x∣y)p(y)
For a Gaussian classifier, we assume p(x∣y) is normally distributed. The density of a d -variate Gaussian N(μ,Σ) is:
p(x)=(2π)d/2detΣ1exp[−21(x−μ)TΣ−1(x−μ)]
2.2 Linear and Polynomial Regression
Linear regression aims to find a function g(x)=WTx that minimizes the squared error. For a polynomial of degree m, the feature vector is expanded to x=(1,x,x2,…,xm)T. Using the Vandermonde matrix X~, the global minimum parameter vector W is found explicitly via:
W=(X~TX~)−1X~Ty
Minimizing the squared error is mathematically equivalent to minimizing the negative log-likelihood under the assumption of Gaussian noise: p(yi∣xi)=N(g(xi),σ2).
2.3 Logistic Regression and Softmax
For binary classification, logistic regression utilizes the sigmoid activation function:
g(x;W)=σ(WTx)=1+e−WTx1
We minimize the cross-entropy loss (negative log-likelihood):
Wmin[−i∑[yilng(xi;W)+(1−yi)ln(1−g(xi;W))]]
For multi-class settings (M classes), this generalizes to the Softmax function:
p(y=j∣x)=∑k=1KeWkTxeWjTx
Module 3: Support Vector Machines (SVM)
3.1 Linear SVMs (Hard Margin)
The objective is to find a separating hyperplane that maximizes the margin 2/∥w∥. Primal Problem:
To handle non-linear separability caused by noise or outliers, slack variables ξi≥0 are introduced. The new primal problem minimizes 21∥w∥2+C∑iξi. The dual problem remains largely identical but introduces an upper bound C on the Lagrange multipliers:
0≤αi≤C
3.3 Nonlinear SVMs (The Kernel Trick)
Data is transformed into a higher-dimensional Hilbert space H via a non-linear map Φ(x). Instead of computing dot products in H, we use a positive semi-definite kernel function k(x,x′)=Φ(x)⋅Φ(x′). Popular Kernels include:
Neural networks use hidden layers to learn non-linear representations. The Universal Approximation Theorem proves that a network with a single hidden layer and a sigmoidal activation function ϕ can approximate any continuous function f:
F(x)=i=1∑Nαiϕ(wiTx+bi)
where ∣F(x)−f(x)∣<ϵ.
In matrix-vector notation, the forward pass for layer l computing activations a[l] and pre-activations s[l] is:
s[l]=W[l]a[l−1]+b[l]
a[l]=σ[l](s[l])
5.2 Convolutional Neural Networks (CNNs)
CNNs utilize local receptive fields, weight sharing, and striding. The discrete 2D convolution over channels C and a spatial kernel R×R is computed as:
RNNs process sequences by combining the current input xt with the previous hidden state ht−1:
ht=f(WTxt+RTht−1+b)
A major issue is the Vanishing Gradient Problem, which arises during Backpropagation Through Time (BPTT) due to the multiplication of Jacobian matrices:
∂s(t−l)∂s(t)=τ=0∏l−1Rdiag[f′(s(t−τ−1))]
Long Short-Term Memory (LSTM) architectures solve this via a gating mechanism around a cell state ct. The core formulas are: