meld.remd.adaptor.SwitchingCompositeAdaptor
- class meld.remd.adaptor.SwitchingCompositeAdaptor(switching_time, first_adaptor, second_adaptor)[source]
Bases:
object
An adaptor that switches between two strategies at a specified time
- __init__(switching_time, first_adaptor, second_adaptor)[source]
Initialize a SwitchingCompositeAdaptor
- Parameters
switching_time (
int
) – when to switch from first_adaptor to second_adaptorfirst_adaptor (
Union
[NullAdaptor
,EqualAcceptanceAdaptor
]) – adaptor before switching_timesecond_adaptor (
Union
[NullAdaptor
,EqualAcceptanceAdaptor
]) – adaptor after switching_time
Methods
__init__
(switching_time, first_adaptor, ...)Initialize a SwitchingCompositeAdaptor
adapt
(previous_lambdas, step)Compute new optimal values of lambda.
get_acceptance_probabilities
()- rtype
ndarray
reset
()Forget about any previous updates.
update
(i, accepted)Update statistics
- adapt(previous_lambdas, step)[source]
Compute new optimal values of lambda.
- Parameters
previous_lambdas (
List
[float
]) – the previous lambda valuesstep (
int
) – the current simulation step
- Return type
List
[float
]- Returns
the new, optimized lambda values