meld.remd.adaptor

Classes

AcceptanceCounter(n_replicas)

Class to keep track of acceptance rates.

AdaptationPolicy(growth_factor, burn_in, …)

Repeat adaptation on a regular schedule with an optional burn-in and increasing adaptation times.

AdaptationRequired(adapt_now, reset_now)

EqualAcceptanceAdaptor(n_replicas, …)

Adaptor based on making acceptance rates uniform.

FluxAdaptor(n_replicas, adaptation_policy, …)

NullAdaptor(n_replicas)

SwitchingCompositeAdaptor(switching_time, …)

class meld.remd.adaptor.AcceptanceCounter(n_replicas: int)[source]

Class to keep track of acceptance rates.

class meld.remd.adaptor.AdaptationPolicy(growth_factor: float, burn_in: int, adapt_every: int, stop_after: Optional[int] = None)[source]

Repeat adaptation on a regular schedule with an optional burn-in and increasing adaptation times.

Parameters
  • growth_factor – increase adapt_every by a factor of growth_factor every adaptation

  • burn_in – number of steps to ignore at the beginning

  • adapt_every – how frequently to adapt (in picoseconds)

should_adapt(step: int) → meld.remd.adaptor.AdaptationRequired[source]

Is adaptation required?

Parameters

step – the current simulation step

Returns

an AdaptationPolicy.AdaptationRequired object indicating if adaptation or resetting is necessary

class meld.remd.adaptor.AdaptationRequired(adapt_now, reset_now)
adapt_now

Alias for field number 0

count(value) → integer -- return number of occurrences of value
index(value[, start[, stop]]) → integer -- return first index of value.

Raises ValueError if the value is not present.

reset_now

Alias for field number 1

class meld.remd.adaptor.EqualAcceptanceAdaptor(n_replicas: int, adaptation_policy: meld.remd.adaptor.AdaptationPolicy, min_acc_prob: float = 0.1)[source]

Adaptor based on making acceptance rates uniform.

Parameters
  • n_replicas – number of replicas

  • min_acc_prob – all acceptence probabilities below this value will be raised to this value

adapt(previous_lambdas: List[float], step: int) → List[float][source]

Compute new optimal values of lambda.

Parameters
  • previous_lambdas – a list of the previous lambda values

  • step – the current simulation step

Returns

a list of the new, optimized lambda values

reset() → None[source]

Forget about any previous updates.

Resets all internal counters and statistics to zero.

update(i: int, accepted: bool) → None[source]

Update adaptor with exchange.

Parameters
  • i – index of first replica; second replica is i+1

  • accepted – True if the exchange was accepted

class meld.remd.adaptor.FluxAdaptor(n_replicas: int, adaptation_policy: meld.remd.adaptor.AdaptationPolicy, smooth_factor: float = 0.5)[source]
class meld.remd.adaptor.NullAdaptor(n_replicas: int)[source]