Active
- mlptrain.training.active.train(mlp: MLPotential, method_name: str, selection_method: SelectionMethod = <mlptrain.training.selection.AbsDiffE object>, max_active_time: float = 1000, n_configs_iter: int = 10, temp: float = 300.0, max_e_threshold: Optional[float] = None, max_active_iters: int = 50, n_init_configs: int = 10, init_configs: Optional['mlptrain.ConfigurationSet'] = None, fix_init_config: bool = False, bbond_energy: Optional[dict] = None, fbond_energy: Optional[dict] = None, init_active_temp: Optional[float] = None, min_active_iters: int = 1, bias_start_iter: int = 0, restart_iter: Optional[int] = None, inherit_metad_bias: bool = False, constraints: Optional[List] = None, bias: mlptrain.Bias | mlptrain.PlumedBias | None = None, md_program: str = 'ASE', pbc: bool = False, box_size: Optional[list] = None, keep_al_trajs: bool = False) None
Train a system using active learning, by propagating dynamics using ML driven molecular dynamics (MD) and adding configurations based on some selection criteria. Loop looks something like
- Generate configurations -> train a MLP -> run MLP-MD -> frames
^ | |________ calc true _________
- Active learning will loop until either:
the iteration > max_active_iters
no configurations are found to add
dftb, orca, gpaw
- Parameters:
selection_method – Method used to select active learnt configurations
max_active_time – (float) Maximum propagation time in the active learning loop. Default = 1 ps
n_configs_iter – (int) Number of configurations to generate per active learning cycle
temp – (float) Temperature in K to propagate active learning at - higher is better for stability but requires more training
max_e_threshold – (float) Maximum relative energy threshold for configurations to be added to the training data
max_active_iters – (int) Maximum number of active learning iterations to perform. Will break if we hit the early stopping criteria
n_init_configs – (int) Number of initial configurations to generate, will be ignored if init_configs is not None
init_configs – (gt.ConfigurationSet) A set of configurations from which to start the active learning from
fix_init_config –
(bool) Always start from the same initial configuration for the active learning loop. If False then:
The structure with the lowest energy (true
- energy) is used
If constraints and/or biases are attached, then
the structure with the lowest biased energy (true energy + bias energy) is used
If using the option to inherit metadynamics
bias, then the structure with the lowest inherited biased energy (true energy + inherited bias energy) is used.
bbond_energy – (dict | None) Additional energy to add to a breaking bond. e.g. bbond_energy={(0, 1), 0.1} Adds 0.1 eV to the ‘bond’ between atoms 0 and 1 as velocities shared between the atoms in the breaking bond direction
fbond_energy – (dict | None) As bbond_energy but in the direction to form a bond
init_active_temp – (float | None) Initial temperature for velocities in the ‘active’ MD search for configurations
min_active_iters – (int) Minimum number of active iterations to perform
bias_start_iter – (int) Iteration index at which the bias starts to be applied. If the bias is PlumedBias, then UPPER_WALLS and LOWER_WALLS are still applied from iteration 0
restart_iter – (int | None) Iteration index at which to restart active learning
inherit_metad_bias – (bool) If True metadynamics bias is inherited from a previous iteration to the next during active learning
constraints – (List) List of ASE contraints to use in the dynamics during active learning
bias – (mlptrain.Bias | mlptrain.PlumedBias) Bias to add during MD simulations, useful for exploring under-explored regions in the dynamics
md_program – (str) ‘ASE’ or ‘OpenMM’
pbc – (bool) If True, MLP-MD propagates with periodic boundary conditions. The solvent should be therefore placed in a box and not a sphere. The training data are still treated as clusters in electronic structure computations.
box_size – (List | None) Size of the box where MLP-MD propagated.
keep_al_trajs – (bool) If True, MLP-MD trajectories generated during AL phase are saved into new folder.