Inverse Problems and Learning

École Centrale Casablanca · 2026

Objectives and probabilistic modelling

What follows, what does not, and what assumptions select · C1

Hermann Agossou1,2

PhD candidate, UTER MID@S, ECC / UH2C

1École Centrale Casablanca · 2Université Hassan II de Casablanca

Part 01

The vocabulary

The vocabulary

What does your training loop minimize

Two questions before we start

Your last objective

Name the loss you used most recently. Why that one, and who decided?

The counterfactual

Had you chosen differently, what would have changed about the claim you made?

Keep your answer to the second one

Most answers are about convenience or convention. By the end of the session that question has a precise answer, and it is not about convenience.

3 / 33

The vocabulary

Three teams, three losses, one dataset

They may be answering different questions

Team A: squared error

Targets a conditional mean under squared decision loss. A Gaussian likelihood is one stronger reading.

Team B: absolute error

Targets a conditional median under absolute decision loss. Robustness is a separate empirical question.

Team C: Poisson NLL

Can encode a count-data likelihood when its support, rate, and dependence assumptions are actually stated.

Three legitimate optimization problems, three different commitments

The objective names what is optimized. It does not, by itself, identify a data-generating model or prove that the chosen decision target matches the application.

4 / 33

The vocabulary

Probability, likelihood, density

Same expression, different variable held fixed

The same expression, read in two directions

one expression, two readings

Write $p(D\mid\theta)$. Fix $\theta$ and vary $D$: this is a mass or density over possible data. Fix the observed $D$ and vary $\theta$: this is a likelihood. The formula does not change; its domain and normalization obligation do.

$$ p(D\mid\theta) \ \text{with } \theta \text{ fixed} \qquad\longleftrightarrow\qquad L(\theta;D) = p(D\mid\theta) \ \text{with } D \text{ fixed} $$

The symbolic version. Same right-hand side; only the variable being varied differs.

Notation for this track, stated once

$\sigma$ is reserved for the unknown physical parameter in tracks B and D. Here the Gaussian noise scale is $\sigma_{\mathrm{n}}$, with $\varepsilon \sim \mathcal{N}(0,\sigma_{\mathrm{n}}^2)$; the Poisson rate is $r$; the Bernoulli probability is $\pi$. The Gaussian mean is written $f_\theta(x)$ because it is the model output.

5 / 33

The vocabulary

Density, mass, and what p of x means

The notation everything else is written in

Definition: mass and density

discrete case / continuous case

Discrete: p(x) is the probability of that exact outcome, in [0,1], summing to one. Continuous: the probability of any exact value is zero, so p(x) is a density; probability appears only on integrating. A density is not a probability and may exceed one.

discrete: $\sum_x p(x)=1$ · continuous: $\int p(x)\,dx=1$, while $p(x)$ itself may exceed 1

$$ P(a \leq Y \leq b) \;=\; \int_a^b p(y)\,\mathrm{d}y \qquad\text{while}\qquad P(Y = y) = 0 \ \text{ for every } y $$

Both hold at once for a continuous variable, and neither contradicts the other.

The counterexample worth remembering

A Gaussian with $\sigma_{\mathrm{n}} = 0.01$ has density about 40 at its peak. Nothing is wrong: it is large because it is concentrated on a narrow interval, and its integral is still one.

6 / 33

The vocabulary

Conditionally independent is not the same as i.i.d.

The assumption that licenses a product

Definition: conditional independence

conditional, not absolute

Given $\theta$, one observation provides no further information about another. They still share $\theta$; only the remaining randomness factorizes.

i.i.d. adds one shared law · unequal $s_i$ can be independent without being identical

$$ p(y_1,\dots,y_N \mid X,\theta) = \prod_{i=1}^{N} p(y_i \mid x_i,\theta) \qquad\Longrightarrow\qquad \log p = \sum_{i=1}^{N}\log p(y_i\mid x_i,\theta) $$

The logarithm turns the licensed product into the sum optimized in code.

Remember that this is an assumption

Nothing forces this factorization. It is a claim about the data, and part 4 deliberately removes it.

7 / 33

The vocabulary

Casella and Berger: the likelihood function

A data density is not parameter probability

Likelihood is not a posterior density

Statistical Inference, 2nd ed.

The likelihood is the sampling mass or density read as a function of the parameter with data fixed. It has no normalization obligation over $\theta$. A bare integral over $\theta$ depends on a chosen measure and parameterization; marginal likelihood instead integrates against a prior.

$L(\theta;D)$ need not integrate to one over $\theta$

See: [1] Casella & Berger (2002)

This is not pedantry. It is the difference between maximum likelihood and Bayesian inference, and it decides what your fitted number is allowed to be called.

8 / 33

Part 02

From model to loss

From model to loss

The chain from model to objective

Predict, distribute, multiply, log, negate

Workflow 01

Predict

The model outputs $f_\theta(x)$.

Workflow 02

Distribute

Say which distribution $f_\theta(x)$ parameterises.

Workflow 03

Factor

Build the joint likelihood under a stated dependence model.

Workflow 04

Log

Turn licensed products into sums.

Workflow 05

Negate

Minimize the negative log-likelihood.

$$ \mathcal{L}_{\mathrm{NLL}}(\theta) = -\sum_{i}\log p(y_i\mid x_i,\theta) $$

Maximising the likelihood and minimising this are the same problem: the logarithm is increasing, and the minus sign flips the direction.

10 / 33

From model to loss

Unequal scales produce weighted square loss

Fully derived, then checked numerically

$$ \begin{aligned}Y_i\mid x_i,\theta&\sim\mathcal{N}(f_\theta(x_i),s_i^2),\qquad s_i>0\ \text{known},\\ \ell_i(\theta)&=\frac{1}{2}\left(\frac{y_i-f_\theta(x_i)}{s_i}\right)^2+\log s_i+\frac{1}{2}\log(2\pi),\\ \mathcal{L}_{\mathrm{NLL}}(\theta)&=\ell_1(\theta)+\cdots+\ell_N(\theta)\end{aligned} $$

Verification

Sum scalar negative log-densities and compare with the vectorized NLL. A mismatch exposes a lost scale or normalization term.

11 / 33

From model to loss

Finish the Bernoulli derivation

The model is given, the algebra is yours

$$ y\mid x,\theta \sim \mathrm{Bernoulli}(\pi_\theta(x)): \qquad p(y\mid x,\theta) = \pi_\theta(x)^{\,y}(1-\pi_\theta(x))^{\,1-y}, \quad y\in\{0,1\} $$

Given. The exponents simply select $\pi$ when $y=1$ and $1-\pi$ when $y=0$.

To complete

5 minutes. Artifact: one derivation per pair from the Bernoulli mass to binary cross-entropy, with the conditional-independence step boxed. Check it against a second pair before the reveal.

12 / 33

From model to loss

Categorical gives you cross-entropy

The multiclass case, derived in full

$$ \ell_i(\theta)=-y_i^{\mathsf{T}}\log p_\theta(x_i),\qquad \mathbf{1}^{\mathsf{T}}y_i=\mathbf{1}^{\mathsf{T}}p_\theta(x_i)=1,\qquad \mathcal{L}(\theta)=\ell_1(\theta)+\cdots+\ell_N(\theta) $$

Verification

The one-hot product selects the true class. Compare the final sum with library cross-entropy on the same logits and targets.

13 / 33

From model to loss

Poisson gives you the Poisson NLL

Counts, and the term you are allowed to drop

$$ \begin{aligned}p(y\mid x,\theta)&=r_\theta(x)^y e^{-r_\theta(x)}/y!,\qquad y\in\{0,1,\dots\},\quad r_\theta(x)>0,\\ \ell_i(\theta)&=r_\theta(x_i)-y_i\log r_\theta(x_i)+\log(y_i!),\\ \mathcal{L}_{\mathrm{NLL}}(\theta)&=\ell_1(\theta)+\cdots+\ell_N(\theta)\end{aligned} $$

Verification

The rate must stay positive. Compute the objective with and without log y!; the minimizer must be unchanged because that term is data-only.

14 / 33

From model to loss

The assumption ledger for the assessed Gaussian case

Six entries, none optional

LayerDeclared assumptionIf changed
Support$Y_i\in\mathbb{R}$Counts or classes require a different law
MeasureLebesgue densityA discrete outcome uses probability mass
Conditional lawGaussian around $f_\theta(x_i)$Tail and support commitments change
Parameterization$f_\theta(x_i)$ is the conditional meanA different target changes the interpretation
DependenceIndependent conditional on $X,\theta$Use a joint covariance, not a product
ScaleKnown $s_i>0$, allowed to differUnknown or predicted scales add parameter terms

15 / 33

From model to loss

Bishop: the standard losses and what they assume

Including where weight decay comes from

Three results, one source

PRML, sections 1.2.5, 3.1, and 4.3
  • Sum-of-squares error arises from maximum likelihood under a Gaussian noise model of constant variance.
  • Cross-entropy errors arise the same way from Bernoulli and multinomial models.
  • Under MAP estimation, a zero-mean isotropic Gaussian prior contributes a quadratic penalty with scale fixed by its variance.

See: [2] Bishop (2006)

16 / 33

Part 03

Reading it backwards

Reading it backwards

What MSE does and does not identify

One objective, several compatible readings

Decision-theoretic

When the conditional second moment exists, expected squared loss is minimized by the conditional mean. No Gaussian assumption is needed.

Likelihood

Gaussian, conditionally independent, constant-variance errors make empirical squared error an NLL up to scale and constants.

Surrogate

An optimizer may use squared loss for tractability without claiming that it is a log-likelihood or the final decision cost.

The objective alone does not choose among these readings. Additional assumptions and the decision target do.

Compare: [3] Miller et al. (1993); [2] Bishop (2006)

18 / 33

Reading it backwards

Audit the same squared objective in reverse

One expression, at least two licensed readings

$$ J(\theta)=\sum_i(y_i-f_\theta(x_i))^2, \qquad \mathcal{L}_{\mathrm{NLL}}(\theta)=\frac{J(\theta)}{2s^2}+N\log(\sqrt{2\pi}\,s) $$

Likelihood reading: conditionally independent Gaussian errors with one fixed scale make the NLL an affine transform of J.

Two licensed readings

  • Likelihood: real response, Gaussian law, conditional independence, fixed common scale
  • Decision: finite conditional second moment; target is the conditional mean

Verification: a non-Gaussian counterexample

Masses 0.8, 0.1, 0.1 on values 0, 1, 9 give mean 1. Squared risk is 7.2 at decision 1 versus 8.2 at decision 0, with no Gaussian law.

19 / 33

Reading it backwards

Your turn: audit an objective you use

Multiple readings, defended aloud

Task

12 minutes. Artifact: a three-column audit table with at least two compatible interpretations, each interpretation's added assumption, and the evidence that could support or refute it.

  • Separate likelihood, decision-theoretic, and surrogate readings
  • Name the added assumption before checking it against the data
  • Check: a randomly chosen peer must challenge one unsupported inference
  • Do not turn algebraic compatibility into a model-adequacy claim

20 / 33

Reading it backwards

Five-minute break

Resume with one question

When you return

What did your objective fail to identify without extra assumptions?

21 / 33

Reading it backwards

Likelihood, posterior, and where priors enter

MLE, MAP, and the regularizer that was a prior

Definition: maximum a posteriori

MLE plus a prior

MLE asks which $\theta$ makes the observed data most plausible. MAP asks the same question after multiplying in a prior belief about $\theta$ itself. Taking logs turns that product into a sum: your data term, plus a penalty.

$\tau$ = prior standard deviation on each parameter · small $\tau$ = a strong belief that $\theta$ is near zero

$$ \hat\theta_{\mathrm{MAP}} = \arg\max_\theta[\log p(D\mid\theta) + \log p(\theta)], \qquad p(\theta)=\mathcal{N}(0,\tau^2 I) \ \Longrightarrow\ +\,\lambda\|\theta\|^2, \ \ \lambda=\frac{1}{2\tau^2} $$

Under this chosen isotropic Gaussian prior, the negative log-prior is quadratic and $\lambda$ records its strength.

22 / 33

Part 04

When the simple picture breaks

When the simple picture breaks

Latent variables and the complete data

What EM is actually completing

Definition: latent variable and complete data

what is unobserved

Sometimes each observation carries a hidden label you never see: which mixture component produced this point. That label is the latent variable. If someone handed you all the labels, fitting would be easy. That imagined dataset is the complete data. EM works by averaging over the labels you do not have.

$C_i$ = hidden component label of observation $i$ · $(y_i,C_i)$ = complete data · $\gamma_{ij}$ = responsibility

$$ p(y\mid\theta) = \sum_{C} p(y,C\mid\theta), \qquad \gamma_{ij} = P(C_i = j \mid y_i,\theta) $$

The observed likelihood is the complete one summed over labels. $\gamma$ is the responsibility, and is what the E step computes.

24 / 33

When the simple picture breaks

Dempster, Laird and Rubin: the EM algorithm

What the 1977 paper actually establishes

Workflow 01

E step

Compute the responsibilities $\gamma$ under the current $\theta$, then form the expected complete-data log-likelihood.

Workflow 02

M step

Exact EM maximises that expectation over $\theta$; generalized EM need only increase it.

Workflow 03

Repeat

Each iteration does not decrease the observed-data likelihood.

Theorem: EM likelihood monotonicity

JRSS-B, 1977

An exact EM step, or a generalized EM step that increases Q, produces an observed-data likelihood at least as large as before. Parameter convergence and optimality require separate conditions.

$\ell(\theta^{(t+1)}) \ge \ell(\theta^{(t)})$ for every $t$: an inequality, not a limit

See: [4] Dempster et al. (1977)

25 / 33

When the simple picture breaks

What E and M actually guarantee

Monotone is not the same as convergent

Left

What is guaranteed

By the 1977 paper.

  • Exact EM maximises Q; generalized EM increases it
  • Observed-data likelihood does not decrease

Right

What is not

And what students assert anyway.

  • Convergence to the maximum likelihood estimate
  • Convergence to a global optimum
  • Independence from the initialisation

A bounded increasing value converges, but to what?

Convergence of likelihood values does not imply parameter convergence. Wu obtains stationary limit points under added compactness and continuity, and the unique MLE only under stronger conditions.

See: [5] Wu (1983)

26 / 33

When the simple picture breaks

EM on one declared mixture: three monotone destinations

The trace is evidence, not a global certificate

initial meansinitial log Lfinal meansfinal log Lall increments
(-4, 0)-50.188(-4.000, 2.000)-30.928non-negative
(0, 4)-50.188(-2.000, 4.000)-30.928non-negative
(-4, 4)-46.837(-2.697, 2.697)-34.976non-negative

Verification before interpretation

Recompute each initial likelihood, then check every `np.diff(trace)`. A decrease falsifies the implementation contract; three increasing traces do not certify parameter convergence or a global optimum.

27 / 33

When the simple picture breaks

The covariance matrix of a Gaussian process

Where the kernel enters, and what it encodes

Definition: kernel and covariance matrix

models dependence explicitly

A positive-semidefinite kernel $k(x,x')$ specifies the covariance between function values. Radial kernels may decay with distance; periodic, linear, and constant kernels need not. Adding independent observation noise contributes only a diagonal term.

$K_{ij}=k(x_i,x_j)$ · $K_y=K+\sigma_{\mathrm{n}}^2I$ · independence implies diagonal covariance, not necessarily identity

$$ \mathbf{f}\mid X,\theta\sim\mathcal{N}(0,K_\theta), \qquad \mathbf{y}\mid\mathbf{f}\sim\mathcal{N}(\mathbf{f},\sigma_{\mathrm{n}}^2I) \quad\Longrightarrow\quad \mathbf{y}\mid X,\theta\sim\mathcal{N}(0,K_y),\;K_y=K_\theta+\sigma_{\mathrm{n}}^2I $$

The latent function has been integrated out. Independence implies diagonal noise covariance; identity additionally requires one common unit variance.

28 / 33

When the simple picture breaks

The GP marginal likelihood, derived

Just the multivariate Gaussian density, logged

$$ \mathbf{y}\mid X,\theta \sim \mathcal{N}(0,K_y(\theta)): \qquad p(\mathbf{y}\mid X,\theta) = (2\pi)^{-N/2}\,| K_y|^{-1/2}\,\exp\!(-\frac{1}{2}\,\mathbf{y}^{\mathsf{T}}K_y^{-1}\mathbf{y}) $$

Step 1: after marginalizing the latent function, one joint Gaussian density replaces an independence product.

$$ -\log p(\mathbf{y}\mid X,\theta) = \frac{1}{2}\mathbf{y}^{\mathsf{T}}K_y^{-1}\mathbf{y} \;+\; \frac{1}{2}\log| K_y| \;+\; \frac{N}{2}\log 2\pi $$

Step 2: data fit, complexity, constant. Because $\log|K_y|$ depends on $\theta$, it stays.

Verification

Compare with a library GP value on the same data. A constant offset exposes a mishandled $2\pi$ term.

29 / 33

When the simple picture breaks

Rasmussen and Williams: marginal likelihood

Observations that are not independent

$$ \log p(\mathbf{y}\mid X,\theta) = -\frac{1}{2}\mathbf{y}^{\mathsf{T}}K_y^{-1}\mathbf{y} \;-\;\frac{1}{2}\log| K_y| \;-\; \frac{N}{2}\log 2\pi $$

Written entirely in K_y, which was defined on the previous slide.

Why this decomposition matters

The first term rewards data fit and the second penalizes covariance volume. Their sum supports hyperparameter comparison within the chosen GP family, but does not certify that family or prevent overfitting when many hyperparameters are optimized.

See: [6] Rasmussen & Williams (2006)

30 / 33

When the simple picture breaks

One GP case, four statistical objects

Classify by what varies, normalizes, and is integrated

$$ \begin{aligned}q_\theta(y)&:=p(y\mid X,\theta)=\int p(y\mid f,\theta)p(f\mid X,\theta)\,df,\\ A:&\ \theta\mapsto p(y\mid f,\theta),\qquad C:\ f\mapsto p(f\mid y,X,\theta),\\ B:&\ y\mapsto q_\theta(y),\qquad D:\ \theta\mapsto q_\theta(y)\end{aligned} $$

5-minute classification artifact

  • For A through D, record varying and fixed arguments plus the normalization domain
  • Assign likelihood, marginal data density, posterior, and marginal likelihood; then swap and challenge one claim

31 / 33

When the simple picture breaks

What survives when the library changes

One chain, read in both directions

  • A model can determine an NLL; an objective rarely identifies one model.
  • Likelihood is a function of the parameter, not a distribution over it.
  • Independence has to be earned: the factorisation is a claim about the data.
  • Audit reverse correspondences: which interpretations fit, and what selects among them?

Carried into tracks B and D

$\sigma$ stays the physical parameter; the noise scale is $\sigma_{\mathrm{n}}$; $\lambda$ is the regularization weight, which is where B1's Tikhonov term came from.

32 / 33

Part 05

References