Skip to content

Commit 37e1d44

Browse files
authored
Merge pull request #681 from CUQI-DTU/tweedie_prior
Add TweediePrior and ScorePrior as alias of MoreauYoshidaPrior
2 parents 1bd1659 + faecc79 commit 37e1d44

File tree

2 files changed

+36
-2
lines changed

2 files changed

+36
-2
lines changed

cuqi/implicitprior/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from ._regularizedGaussian import RegularizedGaussian, ConstrainedGaussian, NonnegativeGaussian
22
from ._regularizedGMRF import RegularizedGMRF, ConstrainedGMRF, NonnegativeGMRF
33
from ._regularizedUnboundedUniform import RegularizedUnboundedUniform
4-
from ._restorator import RestorationPrior, MoreauYoshidaPrior
4+
from ._restorator import RestorationPrior, MoreauYoshidaPrior, TweediePrior
55

cuqi/implicitprior/_restorator.py

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,4 +232,38 @@ def get_conditioning_variables(self):
232232
""" Returns the conditioning variables of the distribution. """
233233
# Currently conditioning variables are not supported for user-defined
234234
# distributions.
235-
return []
235+
return []
236+
237+
class TweediePrior(MoreauYoshidaPrior):
238+
"""
239+
Alias for MoreauYoshidaPrior following Tweedie's formula framework. TweediePrior
240+
defines priors where gradients are computed based on Tweedie's identity that links
241+
MMSE (Minimum Mean Square Error) denoisers with the underlying smoothed prior, see:
242+
- Laumont et al. https://arxiv.org/abs/2103.04715 or https://doi.org/10.1137/21M1406349
243+
244+
Tweedie's Formula
245+
-------------------------
246+
In the context of denoising, Tweedie's identity states that for a signal x
247+
corrupted by Gaussian noise:
248+
249+
∇_x log p_e(x) = (D_e(x) - x) / e
250+
251+
where D_e(x) is the MMSE denoiser output and e is the noise variance.
252+
This enables us to perform gradient-based sampling with algorithms like ULA.
253+
254+
At implementation level, TweediePrior shares identical functionality with MoreauYoshidaPrior.
255+
Thus, it is implemented as an alias of MoreauYoshidaPrior, meaning all methods,
256+
properties, and behavior are identical. The separate name provides clarity when
257+
working specifically with Tweedie's formula-based approaches.
258+
259+
Parameters
260+
----------
261+
prior : RestorationPrior
262+
Prior of the RestorationPrior type containing a denoiser/restorator.
263+
264+
smoothing_strength : float, default=0.1
265+
Corresponds to the noise variance e in Tweedie's formula context.
266+
267+
See MoreauYoshidaPrior for the underlying implementation with complete documentation.
268+
"""
269+
pass

0 commit comments

Comments
 (0)