pub trait Tune<P, B, S, X, C, L, H, MA> {
// Required method
fn tune(
&mut self,
microstate: &Microstate<B, S, X, C>,
hamiltonian: &H,
macrostate: &MA,
target_acceptance: OpenUnitIntervalNumber,
samples: usize,
steps: usize,
);
// Provided method
fn tune_default(
&mut self,
microstate: &Microstate<B, S, X, C>,
hamiltonian: &H,
macrostate: &MA,
) { ... }
}Expand description
Tune trial move maximum sizes toward a target acceptance ratio.
Trial moves that implement Tune can automatically adjust
their trial move size to achieve a desired acceptance ratio.
The tuning is performed in the context of a given microstate,
Hamiltonian, and macrostate but the microstate is not modified.
Required Methods§
Sourcefn tune(
&mut self,
microstate: &Microstate<B, S, X, C>,
hamiltonian: &H,
macrostate: &MA,
target_acceptance: OpenUnitIntervalNumber,
samples: usize,
steps: usize,
)
fn tune( &mut self, microstate: &Microstate<B, S, X, C>, hamiltonian: &H, macrostate: &MA, target_acceptance: OpenUnitIntervalNumber, samples: usize, steps: usize, )
Tune the trial move maximum size to achieve a given acceptance ratio.
Use tune_default unless you have a specific need to adjust the
tuning parameters.
tune performs samples individual trial moves to measure the
current acceptance ratio. It then adjusts the trial move size
to increase or decrease the acceptance ratio as needed over
steps iterations.
Provided Methods§
Sourcefn tune_default(
&mut self,
microstate: &Microstate<B, S, X, C>,
hamiltonian: &H,
macrostate: &MA,
)
fn tune_default( &mut self, microstate: &Microstate<B, S, X, C>, hamiltonian: &H, macrostate: &MA, )
Tune the trial move maximum size with default parameters.
The defaults are:
target_acceptance: 0.2samples: 8,000steps: 32