fix langevin corrector alpha to general num timesteps #81
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.
Addresses issue raised in #79 where the$\alpha$ coefficient for the Langevin corrector was not generalizing for different numbers of integration time steps.
The way it's generalized now works as follows:
In the score SDE paper, the scaling coefficient in the noise distribution$p(x_t | x_0)$ is defined as $\sqrt{\bar{\alpha}} = \exp\left(-0.5\int_0^t \beta(s) ds\right)$ , so $\bar{\alpha} = \exp\left(-\int_0^t \beta(s) ds\right)$ (Eq. 29). In the discrete case $\bar{\alpha} = \prod_{t=1}^T \alpha_t$ , i.e., the cumulative product of the per-step $\alpha_t$ coefficients. Thus, for the continuous case we obtain the equivalent by dividing the cumulative products for $t$ and $t + dt$ , i.e., $\alpha_t = \frac{\bar{\alpha_t}}{\bar{\alpha}_{t + dt}}$ . This happens in these lines in the code:
where$\sqrt{\bar{\alpha}_t}$ .
sde._marginal_mean_coeff(t)
corresponds toAlso minor fixes to tests and MP20 config.