rosetta icon indicating copy to clipboard operation
rosetta copied to clipboard

Test for beta scorefunction discrepancy with clone and minimization.

Open roccomoretti opened this issue 2 months ago • 3 comments

@Bloeci noticed a substantial scoring discrepancy when working with poses which had been cloned and then minimized. It looks like there's an issue when you score the pose before cloning and then go into minimization. -- Notably, this seems to only be the case for beta & beta_nov16 energy functions.

I've tracked this down to some issue with the Energy Graph. If you reset the energy graph (basically delete and then re-add the EnergyEdges) this discrepancy goes away. -- I can't understand why, though, because it goes away even if you put all the energy edges back the way they were. I'm also not sure how/why that would be interacting with the beta_nov16 specifically.

Lacking the ability to take this any further, I've encapsulated things into a unit test. Hopefully this will help someone to investigate further.

(P.S. It looks like only the errant score-before-cloned minimization is resulting in the "Inaccurate G" messages -- which may or may lead into the discrepancy.)

roccomoretti avatar Oct 17 '25 17:10 roccomoretti

Note that this likely shouldn't be merged until we figure out how to fix it.

roccomoretti avatar Oct 17 '25 17:10 roccomoretti

I think I've already asked Max this during the workshop, but does the minimiser take any of the already-calculated energies/forces/any other vectors? Because the shape of the minimised molecule was also different, as though it started with different starting conditions.

zznidar avatar Oct 18 '25 17:10 zznidar

To save on computation, the ScoreFunction does a bunch of caching of energies, and only recomputes things as needed. This caching happens in the Energies object. I'm guessing that's what's causing the issue -- there's some issue with the use of the cached energies during minimization which causes the difference.

Note that while minimization should be deterministic, it's expected that if you have slightly different starting conditions, you'll possibly end up in completely different places. This would also be the case if you had a slightly different energy function, even if only for a few steps. The path you take through the energy landscape is highly sensitive to the exact energy function gradients you compute, and if those deviate slightly, you'll take a (potentially wildly) different trajectory.

roccomoretti avatar Oct 20 '25 14:10 roccomoretti