-
Notifications
You must be signed in to change notification settings - Fork 78
Refactoring of integration routines #598
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
arrjon
wants to merge
36
commits into
dev
Choose a base branch
from
new_samplers
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Codecov Report❌ Patch coverage is
|
Contributor
|
Thank you! Will you let us know once we shall start reviewing the PR? |
Member
Author
All tests are passing now so it is ready :) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request introduces significant improvements to the integration utilities, focusing on broader support for stochastic integration methods. The main changes include adding new samplers, refactoring the diffusion model to cleanly separate the
scoreandvelocityfunctions, updating integration method defaults and handling, and adding comprehensive tests for deterministic and stochastic solvers.RK45 was the classical Runge-Kutta 4 method. Now it is really a Runge-Kutta method with error controlled step size selection. I updated the coefficients to be the one from Dormand-Prince, which is the standard implementation in lots of packages and has higher accuracy. I also added TSIT5, a newer Runge-Kutta method, which is the default in DifferentialEquations.jl and Diffrax. In the benchmarking, both methods were equally accurate and fast, but TSIT5 was marginally better.
I added several new SDE solvers (inspired again by Diffrax): SEA has same order as Euler with better properties, ShARK is a higher order method and the fast adaptive solver from Jolicoeur-Martineau et al. The latter outperformed all other samplers in speed and accuracy. I also added Langevin-sampling and predictor-corrector methods. However, these do not perform nearly as well as the ODE or SDE solvers.
Refactored the
DiffusionModelclass to separate thescoreandvelocityfunctions. The newscoremethod computes the score function directly, andvelocitynow callsscoreand composes the velocity using the noise schedule, clarifying their roles and simplifying downstream usage.Improved the handling of stochastic integration in the diffusion model by supporting additional stochastic methods and corrector steps, and by passing the score function to
integrate_stochasticwhere needed (e.g., for Langevin dynamics).Added extensive parameterized tests for both deterministic and stochastic integration methods, including forward and backward SDEs, zero-noise (ODE) reduction, and Langevin dynamics.
Changed the default integration methods and step settings in both the diffusion model (
two_step_adaptive,"adaptive") and flow matching model (tsit5,"adaptive"). This was a result of benchmarking both models on the Lueckmann low-dimensional problems.