Uncertainty quantification with PnP-ULA.#

This code shows you how to use sampling algorithms to quantify uncertainty of a reconstruction from incomplete and noisy measurements.

ULA obtains samples by running the following iteration:

\[x_{k+1} = x_k + \alpha \eta \nabla \log p_{\sigma}(x_k) + \eta \nabla \log p(y|x_k) + \sqrt{2 \eta} z_k\]

where \(z_k \sim \mathcal{N}(0, I)\) is a Gaussian random variable, \(\eta\) is the step size and \(\alpha\) is a parameter controlling the regularization.

The PnP-ULA method is described in the paper Laumont et al.[1].

import deepinv as dinv
from deepinv.utils.plotting import plot
import torch
from deepinv.utils import load_example

Load image from the internet#

This example uses an image of Messi.

device = dinv.utils.get_device()

x = load_example("messi.jpg", img_size=32).to(device)
Selected GPU 0 with 5670.25 MiB free memory

Define forward operator and noise model#

This example uses inpainting as the forward operator and Gaussian noise as the noise model.

sigma = 0.1  # noise level
physics = dinv.physics.Inpainting(mask=0.5, img_size=x.shape[1:], device=device)
physics.noise_model = dinv.physics.GaussianNoise(sigma=sigma)

# Set the global random seed from pytorch to ensure reproducibility of the example.
torch.manual_seed(0)
<torch._C.Generator object at 0x7f1bba7883b0>

Define the likelihood#

Since the noise model is Gaussian, the negative log-likelihood is the L2 loss.

\[-\log p(y|x) \propto \frac{1}{2\sigma^2} \|y-Ax\|^2\]
# load Gaussian Likelihood
likelihood = dinv.optim.data_fidelity.L2(sigma=sigma)

Define the prior#

The score a distribution can be approximated using Tweedie’s formula via the deepinv.optim.ScorePrior class.

\[\nabla \log p_{\sigma}(x) \approx \frac{1}{\sigma^2} \left(D(x,\sigma)-x\right)\]

This example uses a pretrained DnCNN model. From a Bayesian point of view, the score plays the role of the gradient of the negative log prior The hyperparameter sigma_denoiser (\(sigma\)) controls the strength of the prior.

In this example, we use a pretrained DnCNN model using the deepinv.loss.FNEJacobianSpectralNorm loss, which makes sure that the denoiser is firmly non-expansive (see Terris et al.[2]), and helps to stabilize the sampling algorithm.

sigma_denoiser = 2 / 255
prior = dinv.optim.ScorePrior(
    denoiser=dinv.models.DnCNN(pretrained="download_lipschitz")
).to(device)

Create the MCMC sampler#

Here we use the Unadjusted Langevin Algorithm (ULA) to sample from the posterior defined in deepinv.sampling.ULAIterator. The hyperparameter step_size controls the step size of the MCMC sampler, regularization controls the strength of the prior and iterations controls the number of iterations of the sampler.

regularization = 0.9
step_size = 0.01 * (sigma**2)
iterations = int(5e3) if torch.cuda.is_available() else 10
params = {
    "step_size": step_size,
    "alpha": regularization,
    "sigma": sigma_denoiser,
}
f = dinv.sampling.sampling_builder(
    "ULA",
    prior=prior,
    data_fidelity=likelihood,
    max_iter=iterations,
    params_algo=params,
    thinning=1,
    verbose=True,
)

Generate the measurement#

We apply the forward model to generate the noisy measurement.

y = physics(x)

Run sampling algorithm and plot results#

The sampling algorithm returns the posterior mean and variance. We compare the posterior mean with a simple linear reconstruction.

mean, var = f.sample(y, physics)

# compute linear inverse
x_lin = physics.A_adjoint(y)

# compute PSNR
print(f"Linear reconstruction PSNR: {dinv.metric.PSNR()(x, x_lin).item():.2f} dB")
print(f"Posterior mean PSNR: {dinv.metric.PSNR()(x, mean).item():.2f} dB")

# plot results
error = (mean - x).abs().sum(dim=1).unsqueeze(1)  # per pixel average abs. error
std = var.sum(dim=1).unsqueeze(1).sqrt()  # per pixel average standard dev.
imgs = [x_lin, x, mean, std / std.flatten().max(), error / error.flatten().max()]
plot(
    imgs,
    titles=["measurement", "ground truth", "post. mean", "post. std", "abs. error"],
)
measurement, ground truth, post. mean, post. std, abs. error
  0%|          | 0/5000 [00:00<?, ?it/s]
  1%|          | 30/5000 [00:00<00:16, 298.39it/s]
  1%|          | 61/5000 [00:00<00:16, 304.28it/s]
  2%|▏         | 92/5000 [00:00<00:16, 306.04it/s]
  2%|▏         | 123/5000 [00:00<00:15, 306.72it/s]
  3%|β–Ž         | 154/5000 [00:00<00:15, 306.67it/s]
  4%|β–Ž         | 185/5000 [00:00<00:15, 306.77it/s]
  4%|▍         | 216/5000 [00:00<00:15, 306.76it/s]
  5%|▍         | 247/5000 [00:00<00:15, 306.70it/s]
  6%|β–Œ         | 278/5000 [00:00<00:15, 306.61it/s]
  6%|β–Œ         | 309/5000 [00:01<00:15, 306.49it/s]
  7%|β–‹         | 340/5000 [00:01<00:15, 306.58it/s]
  7%|β–‹         | 371/5000 [00:01<00:15, 306.68it/s]
  8%|β–Š         | 402/5000 [00:01<00:14, 306.62it/s]
  9%|β–Š         | 433/5000 [00:01<00:14, 306.68it/s]
  9%|β–‰         | 464/5000 [00:01<00:14, 306.71it/s]
 10%|β–‰         | 495/5000 [00:01<00:14, 306.88it/s]
 11%|β–ˆ         | 526/5000 [00:01<00:14, 307.07it/s]
 11%|β–ˆ         | 557/5000 [00:01<00:14, 307.09it/s]
 12%|β–ˆβ–        | 588/5000 [00:01<00:14, 307.15it/s]
 12%|β–ˆβ–        | 619/5000 [00:02<00:14, 307.28it/s]
 13%|β–ˆβ–Ž        | 650/5000 [00:02<00:14, 307.18it/s]
 14%|β–ˆβ–Ž        | 681/5000 [00:02<00:14, 307.28it/s]
 14%|β–ˆβ–        | 712/5000 [00:02<00:13, 307.44it/s]
 15%|β–ˆβ–        | 743/5000 [00:02<00:13, 307.59it/s]
 15%|β–ˆβ–Œ        | 774/5000 [00:02<00:13, 307.34it/s]
 16%|β–ˆβ–Œ        | 805/5000 [00:02<00:13, 307.41it/s]
 17%|β–ˆβ–‹        | 836/5000 [00:02<00:13, 307.35it/s]
 17%|β–ˆβ–‹        | 867/5000 [00:02<00:13, 306.13it/s]
 18%|β–ˆβ–Š        | 898/5000 [00:02<00:13, 306.07it/s]
 19%|β–ˆβ–Š        | 929/5000 [00:03<00:13, 306.26it/s]
 19%|β–ˆβ–‰        | 960/5000 [00:03<00:13, 306.75it/s]
 20%|β–ˆβ–‰        | 991/5000 [00:03<00:13, 307.36it/s]
 20%|β–ˆβ–ˆ        | 1022/5000 [00:03<00:13, 303.32it/s]
 21%|β–ˆβ–ˆ        | 1053/5000 [00:03<00:13, 298.94it/s]
 22%|β–ˆβ–ˆβ–       | 1083/5000 [00:03<00:13, 295.95it/s]
 22%|β–ˆβ–ˆβ–       | 1113/5000 [00:03<00:13, 294.10it/s]
 23%|β–ˆβ–ˆβ–Ž       | 1143/5000 [00:03<00:13, 292.70it/s]
 23%|β–ˆβ–ˆβ–Ž       | 1173/5000 [00:03<00:13, 291.52it/s]
 24%|β–ˆβ–ˆβ–       | 1203/5000 [00:03<00:13, 290.96it/s]
 25%|β–ˆβ–ˆβ–       | 1233/5000 [00:04<00:12, 290.54it/s]
 25%|β–ˆβ–ˆβ–Œ       | 1263/5000 [00:04<00:12, 290.04it/s]
 26%|β–ˆβ–ˆβ–Œ       | 1293/5000 [00:04<00:12, 289.96it/s]
 26%|β–ˆβ–ˆβ–‹       | 1322/5000 [00:04<00:12, 289.65it/s]
 27%|β–ˆβ–ˆβ–‹       | 1351/5000 [00:04<00:12, 289.70it/s]
 28%|β–ˆβ–ˆβ–Š       | 1380/5000 [00:04<00:12, 289.48it/s]
 28%|β–ˆβ–ˆβ–Š       | 1409/5000 [00:04<00:12, 289.59it/s]
 29%|β–ˆβ–ˆβ–‰       | 1438/5000 [00:04<00:12, 289.46it/s]
 29%|β–ˆβ–ˆβ–‰       | 1467/5000 [00:04<00:12, 289.31it/s]
 30%|β–ˆβ–ˆβ–‰       | 1496/5000 [00:04<00:12, 289.38it/s]
 30%|β–ˆβ–ˆβ–ˆ       | 1525/5000 [00:05<00:12, 289.47it/s]
 31%|β–ˆβ–ˆβ–ˆ       | 1554/5000 [00:05<00:11, 289.59it/s]
 32%|β–ˆβ–ˆβ–ˆβ–      | 1584/5000 [00:05<00:11, 289.99it/s]
 32%|β–ˆβ–ˆβ–ˆβ–      | 1614/5000 [00:05<00:11, 290.07it/s]
 33%|β–ˆβ–ˆβ–ˆβ–Ž      | 1644/5000 [00:05<00:11, 290.34it/s]
 33%|β–ˆβ–ˆβ–ˆβ–Ž      | 1674/5000 [00:05<00:11, 290.06it/s]
 34%|β–ˆβ–ˆβ–ˆβ–      | 1704/5000 [00:05<00:11, 290.10it/s]
 35%|β–ˆβ–ˆβ–ˆβ–      | 1734/5000 [00:05<00:11, 290.16it/s]
 35%|β–ˆβ–ˆβ–ˆβ–Œ      | 1764/5000 [00:05<00:11, 290.25it/s]
 36%|β–ˆβ–ˆβ–ˆβ–Œ      | 1794/5000 [00:06<00:11, 290.28it/s]
 36%|β–ˆβ–ˆβ–ˆβ–‹      | 1824/5000 [00:06<00:10, 289.54it/s]
 37%|β–ˆβ–ˆβ–ˆβ–‹      | 1853/5000 [00:06<00:10, 289.39it/s]
 38%|β–ˆβ–ˆβ–ˆβ–Š      | 1882/5000 [00:06<00:10, 289.56it/s]
 38%|β–ˆβ–ˆβ–ˆβ–Š      | 1911/5000 [00:06<00:10, 289.52it/s]
 39%|β–ˆβ–ˆβ–ˆβ–‰      | 1941/5000 [00:06<00:10, 289.72it/s]
 39%|β–ˆβ–ˆβ–ˆβ–‰      | 1971/5000 [00:06<00:10, 290.02it/s]
 40%|β–ˆβ–ˆβ–ˆβ–ˆ      | 2001/5000 [00:06<00:10, 290.00it/s]
 41%|β–ˆβ–ˆβ–ˆβ–ˆ      | 2031/5000 [00:06<00:10, 290.16it/s]
 41%|β–ˆβ–ˆβ–ˆβ–ˆ      | 2061/5000 [00:06<00:10, 289.42it/s]
 42%|β–ˆβ–ˆβ–ˆβ–ˆβ–     | 2090/5000 [00:07<00:10, 288.82it/s]
 42%|β–ˆβ–ˆβ–ˆβ–ˆβ–     | 2119/5000 [00:07<00:09, 288.62it/s]
 43%|β–ˆβ–ˆβ–ˆβ–ˆβ–Ž     | 2148/5000 [00:07<00:09, 288.59it/s]
 44%|β–ˆβ–ˆβ–ˆβ–ˆβ–Ž     | 2177/5000 [00:07<00:09, 288.61it/s]
 44%|β–ˆβ–ˆβ–ˆβ–ˆβ–     | 2206/5000 [00:07<00:09, 288.80it/s]
 45%|β–ˆβ–ˆβ–ˆβ–ˆβ–     | 2235/5000 [00:07<00:09, 287.06it/s]
 45%|β–ˆβ–ˆβ–ˆβ–ˆβ–Œ     | 2264/5000 [00:07<00:09, 285.66it/s]
 46%|β–ˆβ–ˆβ–ˆβ–ˆβ–Œ     | 2293/5000 [00:07<00:09, 284.65it/s]
 46%|β–ˆβ–ˆβ–ˆβ–ˆβ–‹     | 2322/5000 [00:07<00:09, 283.78it/s]
 47%|β–ˆβ–ˆβ–ˆβ–ˆβ–‹     | 2351/5000 [00:07<00:09, 283.10it/s]
 48%|β–ˆβ–ˆβ–ˆβ–ˆβ–Š     | 2380/5000 [00:08<00:09, 282.86it/s]
 48%|β–ˆβ–ˆβ–ˆβ–ˆβ–Š     | 2409/5000 [00:08<00:09, 282.66it/s]
 49%|β–ˆβ–ˆβ–ˆβ–ˆβ–‰     | 2438/5000 [00:08<00:09, 282.57it/s]
 49%|β–ˆβ–ˆβ–ˆβ–ˆβ–‰     | 2467/5000 [00:08<00:08, 281.52it/s]
 50%|β–ˆβ–ˆβ–ˆβ–ˆβ–‰     | 2496/5000 [00:08<00:08, 281.48it/s]
 50%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆ     | 2525/5000 [00:08<00:08, 281.36it/s]
 51%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆ     | 2554/5000 [00:08<00:08, 281.43it/s]
 52%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–    | 2583/5000 [00:08<00:08, 281.63it/s]
 52%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–    | 2612/5000 [00:08<00:08, 281.50it/s]
 53%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–Ž    | 2641/5000 [00:08<00:08, 280.89it/s]
 53%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–Ž    | 2670/5000 [00:09<00:08, 281.26it/s]
 54%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–    | 2699/5000 [00:09<00:08, 281.82it/s]
 55%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–    | 2728/5000 [00:09<00:08, 281.85it/s]
 55%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–Œ    | 2757/5000 [00:09<00:07, 281.88it/s]
 56%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–Œ    | 2786/5000 [00:09<00:07, 281.92it/s]
 56%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‹    | 2815/5000 [00:09<00:07, 282.10it/s]
 57%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‹    | 2844/5000 [00:09<00:07, 282.11it/s]
 57%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‹    | 2873/5000 [00:09<00:07, 282.11it/s]
 58%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–Š    | 2902/5000 [00:09<00:07, 282.30it/s]
 59%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–Š    | 2931/5000 [00:09<00:07, 282.48it/s]
 59%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‰    | 2960/5000 [00:10<00:07, 282.49it/s]
 60%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‰    | 2989/5000 [00:10<00:07, 282.57it/s]
 60%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ    | 3018/5000 [00:10<00:07, 282.45it/s]
 61%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ    | 3047/5000 [00:10<00:06, 282.24it/s]
 62%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–   | 3076/5000 [00:10<00:06, 282.11it/s]
 62%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–   | 3105/5000 [00:10<00:06, 282.31it/s]
 63%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–Ž   | 3134/5000 [00:10<00:06, 282.38it/s]
 63%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–Ž   | 3163/5000 [00:10<00:06, 282.43it/s]
 64%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–   | 3192/5000 [00:10<00:06, 281.71it/s]
 64%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–   | 3221/5000 [00:11<00:06, 281.16it/s]
 65%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–Œ   | 3250/5000 [00:11<00:06, 281.35it/s]
 66%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–Œ   | 3279/5000 [00:11<00:06, 281.73it/s]
 66%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–Œ   | 3308/5000 [00:11<00:05, 282.01it/s]
 67%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‹   | 3337/5000 [00:11<00:05, 282.11it/s]
 67%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‹   | 3366/5000 [00:11<00:05, 281.54it/s]
 68%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–Š   | 3395/5000 [00:11<00:05, 281.79it/s]
 68%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–Š   | 3424/5000 [00:11<00:05, 282.06it/s]
 69%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‰   | 3453/5000 [00:11<00:05, 281.97it/s]
 70%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‰   | 3482/5000 [00:11<00:05, 282.10it/s]
 70%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ   | 3511/5000 [00:12<00:05, 282.24it/s]
 71%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ   | 3540/5000 [00:12<00:05, 282.36it/s]
 71%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–  | 3569/5000 [00:12<00:05, 282.44it/s]
 72%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–  | 3598/5000 [00:12<00:04, 282.21it/s]
 73%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–Ž  | 3627/5000 [00:12<00:04, 282.14it/s]
 73%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–Ž  | 3656/5000 [00:12<00:04, 282.11it/s]
 74%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–Ž  | 3685/5000 [00:12<00:04, 282.17it/s]
 74%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–  | 3714/5000 [00:12<00:04, 282.30it/s]
 75%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–  | 3743/5000 [00:12<00:04, 282.46it/s]
 75%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–Œ  | 3772/5000 [00:12<00:04, 282.31it/s]
 76%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–Œ  | 3801/5000 [00:13<00:04, 282.00it/s]
 77%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‹  | 3830/5000 [00:13<00:04, 282.20it/s]
 77%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‹  | 3859/5000 [00:13<00:04, 282.39it/s]
 78%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–Š  | 3888/5000 [00:13<00:03, 282.22it/s]
 78%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–Š  | 3917/5000 [00:13<00:03, 282.07it/s]
 79%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‰  | 3946/5000 [00:13<00:03, 282.11it/s]
 80%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‰  | 3975/5000 [00:13<00:03, 282.24it/s]
 80%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ  | 4004/5000 [00:13<00:03, 282.25it/s]
 81%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ  | 4033/5000 [00:13<00:03, 282.44it/s]
 81%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ  | 4062/5000 [00:14<00:03, 282.31it/s]
 82%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ– | 4091/5000 [00:14<00:03, 282.41it/s]
 82%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ– | 4120/5000 [00:14<00:03, 282.72it/s]
 83%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–Ž | 4149/5000 [00:14<00:03, 281.48it/s]
 84%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–Ž | 4178/5000 [00:14<00:02, 281.68it/s]
 84%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ– | 4207/5000 [00:14<00:02, 281.66it/s]
 85%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ– | 4236/5000 [00:14<00:02, 281.91it/s]
 85%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–Œ | 4265/5000 [00:14<00:02, 282.14it/s]
 86%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–Œ | 4294/5000 [00:14<00:02, 282.38it/s]
 86%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‹ | 4323/5000 [00:14<00:02, 282.54it/s]
 87%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‹ | 4352/5000 [00:15<00:02, 282.28it/s]
 88%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–Š | 4381/5000 [00:15<00:02, 282.25it/s]
 88%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–Š | 4410/5000 [00:15<00:02, 282.47it/s]
 89%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‰ | 4439/5000 [00:15<00:01, 282.50it/s]
 89%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‰ | 4468/5000 [00:15<00:01, 281.90it/s]
 90%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‰ | 4497/5000 [00:15<00:01, 281.97it/s]
 91%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ | 4526/5000 [00:15<00:01, 282.12it/s]
 91%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ | 4555/5000 [00:15<00:01, 282.26it/s]
 92%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–| 4584/5000 [00:15<00:01, 282.03it/s]
 92%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–| 4613/5000 [00:15<00:01, 282.28it/s]
 93%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–Ž| 4642/5000 [00:16<00:01, 282.19it/s]
 93%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–Ž| 4671/5000 [00:16<00:01, 282.18it/s]
 94%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–| 4700/5000 [00:16<00:01, 282.13it/s]
 95%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–| 4729/5000 [00:16<00:00, 282.36it/s]
 95%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–Œ| 4758/5000 [00:16<00:00, 281.90it/s]
 96%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–Œ| 4787/5000 [00:16<00:00, 281.86it/s]
 96%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‹| 4816/5000 [00:16<00:00, 282.23it/s]
 97%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‹| 4845/5000 [00:16<00:00, 282.17it/s]
 97%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‹| 4874/5000 [00:16<00:00, 282.51it/s]
 98%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–Š| 4903/5000 [00:16<00:00, 282.11it/s]
 99%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–Š| 4933/5000 [00:17<00:00, 284.52it/s]
 99%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‰| 4963/5000 [00:17<00:00, 286.40it/s]
100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‰| 4992/5000 [00:17<00:00, 287.26it/s]
100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 5000/5000 [00:17<00:00, 288.64it/s]
Iteration 4999, current converge crit. = 1.43E-05, objective = 1.00E-03
Iteration 4999, current converge crit. = 3.42E-04, objective = 1.00E-03
Linear reconstruction PSNR: 8.55 dB
Posterior mean PSNR: 22.31 dB
References:

Total running time of the script: (0 minutes 17.804 seconds)

Gallery generated by Sphinx-Gallery