spyrit.core.prep.DirectPoisson.denormalize_expe

DirectPoisson.denormalize_expe(x, beta, h, w)[source]

Denormalize images from the range [-1;1] to the range [0; \(\beta\)]

It computes \(m = \frac{\beta}{2}(x+1)\), where \(\beta\) is the normalization factor.

Args:

x: Batch of images

beta: Normalizarion factor

h: Image height

w: Image width

Shape:

x: \((*, 1, h, w)\)

beta: \((*)\) or \((*, 1)\)

h: int

w: int

Output: \((*, 1, h, w)\)

Example:
>>> x = torch.rand([10, 1, 32,32], dtype=torch.float)
>>> beta = 9*torch.rand([10])
>>> y = prep_op.denormalize_expe(x, beta, 32, 32)
>>> print(y.shape)
torch.Size([10, 1, 32, 32])