Lecture 2 · Machine Learning for ICE · University of Klagenfurt, 2023
Lecture 2 of 8
From Machine Learning for ICE at the University of Klagenfurt, first taught in 2022: this is the 2023 edition, so some of it may be a little dated. All lectures.
01
None of these was true twenty years ago, all of them are now.
A few guidelines on which engineering tasks can benefit from it.
Model? y=f(x) yes Algorithm? e.g. \hat{\mathbf{x}}=(\mathbf{H}^{H}\mathbf{H})^{-1}\mathbf{H}^{H}\mathbf{y} yes Too complex? e.g. O(n^3) no Model-based design ✓
no model, no algorithm, or too complex Data available? y_i=f(x_i),\ i\in\mathcal{D}, \lvert\mathcal{D}\rvert large yes Go for ML
without enough data, neither route works ✗
Read it from the left: if a model exists, an algorithm exists and it runs fast enough, the classic design flow wins. A model deficit, an algorithm deficit or a complexity that is too high all lead to the same question: is there enough data? Only then does machine learning become an option.
A computer program is said to learn from experience E with respect to some class of tasks T and performance measure P, if its performance at tasks in T, as measured by P, improves with experience E.
Tom Mitchell, Machine Learning, 1997
Domain knowledge Physics-based mathematical model Algorithm development Performance guarantees
traditional engineering design flow
Data acquisition Data-driven parametric model Learning algorithm Trained model
machine learning design flow
02
Everything can be represented as data. Four types:
With labels, learn the map from x to y (here, a regression line). Without them, find the structure hidden in the x_i alone (here, three clusters).
Pairs of samples (x_i,y_i)\sim p(x,y), i=1,\dots,N. In practice, find a parametric model such that
y_i=f(x_i;\theta)
| Objective | Model |
|---|---|
| estimate p(y\mid x) | discriminative |
| estimate p(x,y) | generative |
| Output y_i | Problem |
|---|---|
| continuous | regression |
| discrete | classification |
Samples x_i\sim p(x), i=1,\dots,N, where a latent (hidden) variable z causes the observation x. In practice, find a parametric model such that
z_i=f(x_i;\theta)\quad\text{and/or}\quad x_i=g(z_i;\delta)
| Objective | Model |
|---|---|
| estimate p(z\mid x) | discriminative |
| estimate p(x,z) | generative |
| estimate p(z\mid x) and p(x\mid z) | autoencoder |
Typical problems: clustering (find groups), dimensionality reduction (transform the data), association (recommendations, frequent sequences).
Semi-supervised learning
Reinforcement learning
03
Channel input x\sim p_X(x) Medium p_{Y\mid X}(y\mid x) Channel output y\sim p_Y(y)
\underbrace{p(x\mid y)}_{\text{posterior}}=\frac{\overbrace{p(y\mid x)}^{\text{likelihood}}\cdot\overbrace{p(x)}^{\text{prior}}}{p(y)}
In communications we want the maximum a posteriori (MAP) estimate
\hat x=\arg\max_x\,p(x\mid y)
If we do not know the posterior but we know the likelihood and the prior, Bayes gives
\hat x=\arg\max_x\,p(y\mid x)\,p(x)=\arg\min_x\,\big[-\log p(y\mid x)-\log p(x)\big]
If the source is uniform, the prior is a constant. If the channel is AWGN,
p(y\mid x)=p_N(y-x)=\frac{1}{\sqrt{2\pi}\,\sigma_N}\,e^{-\frac12\left(\frac{y-x}{\sigma_N}\right)^2}
and we recover the Euclidean distance: \ \hat x=\arg\min_x\,-\log p(y\mid x)=\arg\min_x\,\lvert y-x\rvert^2.
Two equally likely symbols x=\pm1 through AWGN: the MAP receiver decides for the larger of p(y\mid x)\,p(x), so the threshold sits where the curves cross, at y=0. The shaded tails are the errors.
What if p(y\mid x) is unknown? Use a parametric model p(y\mid x;\theta) and estimate \theta by maximum likelihood. With N i.i.d. pairs of samples:
\begin{aligned} \hat\theta&=\arg\max_\theta\,\prod_{i=1}^N p(y_i\mid x_i;\theta)=\arg\max_\theta\,\sum_{i=1}^N\log p(y_i\mid x_i;\theta)\\ &=\arg\max_\theta\,\mathbb{E}_{(x,y)\sim\hat p_{\text{data}}}\big[\log p(y\mid x;\theta)\big]\\ &=\arg\min_\theta\,\mathrm{CE}(\hat p_{\text{data}},p_\theta) \end{aligned}
Dividing the sum by N does not move the maximum, and turns it into an expectation over the empirical distribution of the training set. \mathrm{CE}(\cdot,\cdot) is the cross-entropy.
Minimizing a negative log-likelihood is minimizing a cross-entropy: between the empirical distribution of the training set and the model. The mean squared error, for instance, is the cross-entropy with a Gaussian model.
After Goodfellow, Bengio and Courville, Deep Learning, section 5.5.
Information theory quantifies how much information a signal carries. We want a measure where
The information of an event x is I(x)=-\log p(x), and the entropy of a source is its average information, H(X)=-\mathbb{E}_{x\sim p(x)}\big[\log p(x)\big]
To measure how different two distributions p and q are, we use the Kullback-Leibler divergence
D_{\mathrm{KL}}(p\,\|\,q)=\mathbb{E}_{x\sim p(x)}\left[\log\frac{p(x)}{q(x)}\right]\ge0,\qquad D_{\mathrm{KL}}(p\,\|\,q)=\mathrm{CE}(p,q)-H(X)
D_{\mathrm{KL}}(p\,\|\,q) is zero only when the two distributions coincide, and it is not symmetric: in general D_{\mathrm{KL}}(p\,\|\,q)\neq D_{\mathrm{KL}}(q\,\|\,p). It comes back in lecture 8, inside the loss of the variational autoencoder.
letizia.tech · Machine Learning for ICE · University of Klagenfurt