EulerSolver#

class deepinv.sampling.EulerSolver(timesteps, rng=None)[source]#

Bases: BaseSDESolver

Euler-Maruyama solver for SDEs.

This solver uses the Euler-Maruyama method to numerically integrate SDEs. It is a first-order method that approximates the solution using the following update rule:

\[x_{t+dt} = x_t + f(x_t,t)dt + g(t) W_{dt}\]

where \(W_t\) is a Gaussian random variable with mean 0 and variance dt.

Parameters:
  • timesteps (torch.Tensor) – The time steps at which to evaluate the solution.

  • rng (torch.Generator) – A random number generator for reproducibility.

step(sde, t0, t1, x0, *args, **kwargs)[source]#

Perform a single step with step size from time t0 to time t1, with current state x0.

Parameters:
Returns:

Updated state of the system after the step.

Return type:

torch.Tensor

Examples using EulerSolver:#

Posterior Sampling for Inverse Problems with Stochastic Differential Equations modeling.

Posterior Sampling for Inverse Problems with Stochastic Differential Equations modeling.