Skip to content
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

Minimization in ReplicaExchangeSampler #477

Open
djhuggins opened this issue Jul 31, 2020 · 4 comments
Open

Minimization in ReplicaExchangeSampler #477

djhuggins opened this issue Jul 31, 2020 · 4 comments

Comments

@djhuggins
Copy link

Hello,

I have been using the minimize function in ReplicaExchangeSampler to minimize a set of replicas in different alchemical states like this:

lsd_move = openmmtools.mcmc.LangevinSplittingDynamicsMove(options)
repex_simulation = ReplicaExchangeSampler(mcmc_moves=lsd_move)
repex_simulation.minimize()

I am finding a lot of the replicas NaN when the initial structure contains a clash. I tried changing the minimize options but it always NaNs. I then tried the following which fixes the problem.

for k in range(nstates):
sampler_state = sampler_states[k]
thermodynamic_state = thermodynamic_states[k]
integrator=LangevinIntegrator()
context = thermodynamic_state.create_context(integrator)
sampler_state.apply_to_context(context)
mm.LocalEnergyMinimizer.minimize(context)
sampler_state.update_from_context(context)

As far as I can see ReplicaExchangeSampler uses the FIREMinimizationIntegrator. Could the minimize function be set to use LocalEnergyMinimizer as an option? It seems more effective in this case.

Cheers,

Dave

@jchodera
Copy link
Member

jchodera commented Aug 1, 2020

@hannahbrucemacdonald @dominicrufa @jaimergp : Didn't you find a way to change this default behavior? I was under the impression that was backported to openmmtools.

@hannahbrucemacdonald
Copy link
Contributor

Hi,

The Fire minimizer has been problematic, I wasn't aware that it was still the default and I can change it back to LocalEnergyMinimizer (Linking to issue #394 ) . Thanks for spotting this Dave - I will change it now

@hannahbrucemacdonald
Copy link
Contributor

Sorry I spoke too soon -- it looks like if the Fire integrator nans, then it should fall back to openmm's LocalEnergyMinimizer anyway. What version of openmmtools are you using?

@djhuggins
Copy link
Author

Hi Hannah,

I should have been clearer in my initial message. The (FIRE) minimizer completes without NANs. Its the equilibration that then NANs immediately. Looking at the initial and minimized energies for FIRE vs LocalEnergyMinimizer I can see that LocalEnergyMinimizer reduces the energy a LOT more.

Dave

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants