pytomography.priors#

The __init__ docstr

Submodules#

Package Contents#

Classes#

QuadraticPrior

Implentation of SmoothnessPrior where \(\phi\) is the identity function

LogCoshPrior

Implementation of SmoothnessPrior where \(\phi\) is the hyperbolic tangent function

QClearPrior

Implentation of SmoothnessPrior where \(\phi\) is the the QClear Function (DEFINE HERE)

Prior

Abstract class for implementation of prior \(V(f)\). Any function inheriting from this class should implement a foward method that computes the tensor \(\frac{\partial V}{\partial f_r}\) where \(f\) is an object tensor.

class pytomography.priors.QuadraticPrior(beta, delta=1, device='cpu')#

Bases: SmoothnessPrior

Implentation of SmoothnessPrior where \(\phi\) is the identity function

Parameters:
  • beta (float) –

  • delta (float) –

  • device (str) –

class pytomography.priors.LogCoshPrior(beta, delta=1, device='cpu')#

Bases: SmoothnessPrior

Implementation of SmoothnessPrior where \(\phi\) is the hyperbolic tangent function

Parameters:
  • beta (float) –

  • delta (float) –

  • device (str) –

class pytomography.priors.QClearPrior(beta=1, gamma=1, device='cpu')#

Bases: DiffAndSumSmoothnessPrior

Implentation of SmoothnessPrior where \(\phi\) is the the QClear Function (DEFINE HERE)

Parameters:
  • beta (float) –

  • gamma (float) –

  • device (str) –

class pytomography.priors.Prior(beta, device='cpu')#

Bases: torch.nn.Module

Abstract class for implementation of prior \(V(f)\). Any function inheriting from this class should implement a foward method that computes the tensor \(\frac{\partial V}{\partial f_r}\) where \(f\) is an object tensor.

Parameters:
  • beta (float) –

  • device (str) –

set_object_meta(object_meta)#

Sets object metadata parameters.

Parameters:

object_meta (ObjectMeta) – Object metadata describing the system.

Return type:

None

set_beta_scale(factor)#

Sets \(\beta\)

Parameters:

factor (float) – Value of \(\beta\)

Return type:

None

set_object(object)#

Sets the object \(f_r\) used to compute :math:` rac{partial V}{partial f_r}`

Args:

object (torch.tensor): Tensor of size [batch_size, Lx, Ly, Lz] which the prior will be computed on

Parameters:

object (pytomography.metadata.ObjectMeta) –

Return type:

None

set_device(device='cpu')#

Sets the pytorch computation device

Parameters:

device (str) – sets device.

Return type:

None

abstract forward()#

Abstract method to compute prior based on the self.object attribute.