Implement a differentiable variant of the PGOP order parameter#123
Draft
janbridley wants to merge 8 commits into
Draft
Implement a differentiable variant of the PGOP order parameter#123janbridley wants to merge 8 commits into
janbridley wants to merge 8 commits into
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
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.
Description
If PGOP were discontinuous, it would be more suitable for use as a CV in metadynamics and other enhanced sampling techniques. However, the current formulation is non-smooth for several reasons. The first (and most significant) is optimization, as identifying the optimal orientation using a grid search is not differentiable. However, in the case where we fix the orientation of the OP we can ignore this. Therefore, the important problem to solve is the differentiability of the PGOP compute itself. This PR is an initial attempt at doing so.
LogSumExp is a smooth approximation of the${\displaystyle \max {{x_{1},\dots ,x_{n}}}\leq \mathrm {LSE} (x_{1},\dots ,x_{n})\leq \max {{x_{1},\dots ,x_{n}}}+\log(n).}$ . More simply, this gives us a smooth upper bound on the discontinuous
maxfunction that is used for nearest-neighbor correspondences inside the PGOP compute. This obeys the following inequalities:maxfunction that underlies the core OP. This shifts the scale of the OP (as the order parameter is no longer guaranteed in [0, 1]) but is numerically stable and reasonably well studied.This kernel will be significantly slower than a single execution of the non-smooth OP, but won't be used with optimization which means it's probably still usable. I can also make this much faster if we decide its useful.
Motivation and Context
Resolves: #???
How Has This Been Tested?
Existing tests pass when setting smooth_beta to 10.0, meaning we can recover the original behavior (save for the [0, 1] bounding) with a reasonably small exponential scale. This should be reverted before merging and tested separately, but currently stands as a proof of concept.
Checklist: