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 timet1
, with current statex0
.- Parameters:
sde (deepinv.sampling.BaseSDE) – the SDE to solve.
t0 (float or torch.Tensor) – Time at the start of the step, of size (,).
t1 (float or torch.Tensor) – Time at the end of the step, of size (,).
x0 (torch.Tensor) – Current state of the system, of size (batch_size, d).
- Returns:
Updated state of the system after the step.
- Return type:
Examples using EulerSolver
:#

Posterior Sampling for Inverse Problems with Stochastic Differential Equations modeling.