Optimizers.monte_carlo module¶
Description¶
This module defines the ParaMol.Optimizers.monte_carlo.MonteCarlo class, which is the ParaMol implementation of the Monte Carlo method.
-
class
ParaMol.Optimizers.monte_carlo.MonteCarlo(n_blocks, max_iter, f_tol, avg_acceptance_rate)¶ Bases:
objectParaMol implementation of the Monte Carlo optimizer.
- Parameters
n_blocks (int) – Number of iteration (attempted moves) per block. Within each block the maximum displacements are not updated.
max_iter (int) – Maximum number of iterations.
f_tol (float) – Threshold that defines when the objective function is deemed to be converged, i.e., if the change in the objective function is lower than this threshold than we assume convergence has been reached.
avg_acceptance_rate (float) – Acceptance rate threshold. If at the start of a new MC block the acceptance rate of a given parameter is larger (lower) than avg_acceptance_rate, the maximum displacement for that parameter is increased (decreased).
-
run_optimization(f, parameters, constraints=None)¶ Method that performs optimization using the Monte Carlo method.
Notes
Source: ‘Developing accurate molecular mechanics force fields for conjugated molecular systems’ Do H. and Troisi A. PCCP 2015, 17, 25123-25132
- Parameters
f (callable) – Reference of the objective function.
parameters (list) – 1D list with the adimensional mathematical parameters that will be used in the optimization.
constraints (None) – Should be None. Monte Carlo optimizer cannot handle restraints.
- Returns
parameters (list) – 1D list with the updated adimensional mathematical parameters.