data_consistency.pyΒΆ

Source: LION/reconstructors/diffusion/data_consistency.py

Shared adjoint data-consistency updates for diffusion reconstructors.

class LION.reconstructors.diffusion.data_consistency.AdjointDataConsistency[source]ΒΆ

Bases: object

Apply adjoint measurement updates shared by diffusion samplers.

apply_adjoint_correction(x, residual, step_size, params, sigma)[source]ΒΆ

Apply one scheduled adjoint correction to a padded sampler state.

Parameters:
  • x (Tensor)

  • residual (Tensor)

  • step_size (Tensor)

  • sigma (Tensor)

Return type:

tuple[Tensor, Tensor, Tensor, float, float]

adjoint_data_step_size(residual, sigma, params, *, public_repo_multiplier)[source]ΒΆ

Compute the paper or public-repository adjoint step size.

Parameters:
  • residual (Tensor)

  • sigma (Tensor)

  • public_repo_multiplier (bool)

Return type:

Tensor