You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While there are use cases in generic integrative modeling where one might want to use the gradients of a subset of the scoring function, this is dangerous when using MD and gradient-based Markov Chain Monte Carlo techniques. Restraints with non-constant scores that don't accumulate derivatives modify the score/energy without modifying the gradients/forces accordingly; consequently, the moves will in general not be valid.
Here's an example for IMP::isd::CysteineCrossLinkRestraint:
// check if probability is too low (e.g. equal to zero)
// and assign its value to the smallest double
if (prob <= std::numeric_limits<double>::epsilon()) {
prob = std::numeric_limits<double>::epsilon();
}
score = -log(prob);
if (accum) {
}
return score;
}
A warning when derivatives are requested from such a restraint seems the least disruptive way to go, but perhaps we want to be disruptive here. An alternative would be a special exception macro, something like IMP_NON_DIFFERENTIABLE_EXCEPTION, which the user could disable with something like IMP_CHECK_NON_DIFFERENTIABLE(false).
I can't think of an easy way to raise a warning/exception whenever this happens except to modify the unprotected_evaluate statements for all such restraints. For example, in the above restraint, we would make a modification like:
if (accum) {
IMP_NON_DIFFERENTIABLE_EXCEPTION("Derivatives are not computed.");
}
This would especially help when the user does not directly interact with the IMP restraint, such as when using PMI. This would also be part of an effort to catalog what is missing from all IMP restraints being fully differentiable. The downside to this approach is that it takes no steps towards ensuring that all derivatives are computed correctly.
Thoughts on this approach?
The text was updated successfully, but these errors were encountered:
While there are use cases in generic integrative modeling where one might want to use the gradients of a subset of the scoring function, this is dangerous when using MD and gradient-based Markov Chain Monte Carlo techniques. Restraints with non-constant scores that don't accumulate derivatives modify the score/energy without modifying the gradients/forces accordingly; consequently, the moves will in general not be valid.
Here's an example for
IMP::isd::CysteineCrossLinkRestraint
:imp/modules/isd/src/CysteineCrossLinkRestraint.cpp
Lines 241 to 259 in 0a66eb2
A warning when derivatives are requested from such a restraint seems the least disruptive way to go, but perhaps we want to be disruptive here. An alternative would be a special exception macro, something like
IMP_NON_DIFFERENTIABLE_EXCEPTION
, which the user could disable with something likeIMP_CHECK_NON_DIFFERENTIABLE(false)
.I can't think of an easy way to raise a warning/exception whenever this happens except to modify the
unprotected_evaluate
statements for all such restraints. For example, in the above restraint, we would make a modification like:This would especially help when the user does not directly interact with the IMP restraint, such as when using PMI. This would also be part of an effort to catalog what is missing from all IMP restraints being fully differentiable. The downside to this approach is that it takes no steps towards ensuring that all derivatives are computed correctly.
Thoughts on this approach?
The text was updated successfully, but these errors were encountered: