Continue active learning with a new system or new simulation settings

Note: This example requires AMS2024 or later.

This example uses results from Single molecule: setup and run, so run through that example first!

To follow along, either

Initialization

from scm.simple_active_learning import SimpleActiveLearningJob
import scm.plams as plams
import matplotlib.pyplot as plt
import os

plams.init(folder="plams_workdir_continuation")
PLAMS working folder: /path/plams_workdir_continuation.002

Set the correct path to the previous Simple Active Learning job. The path should be a directory containing the file “simple_active_learning.rkf”

# replace the path with your own path !
previous_sal_job_path = os.path.expandvars(
    "$AMSHOME/examples/SAL/Output/SingleMolecule/plams_workdir/sal"
)
previous_sal_job = SimpleActiveLearningJob.load_external(previous_sal_job_path)
previous_params_path = previous_sal_job.results.get_params_results_directory()

Initial system, reference engine settings, MD settings

These settings were explained in the first tutorial.

Here we use a new molecule (acetic acid), but we could also have changed the temperature of the MD simulation, or any other setting.

mol = plams.from_smiles("CC(O)=O")
for at in mol:
    at.properties = {}
mol = plams.preoptimize(mol)
plams.plot_molecule(mol)
../../../_images/sal_continue_with_new_system_5_0.png
ref_s = plams.Settings()
ref_s.input.ForceField.Type = "UFF"
ref_s.runscript.nproc = 1
md_s = plams.AMSNVTJob(temperature=300, timestep=0.5, nsteps=10000).settings

ParAMS ML training settings

Here we set LoadModel = previous_params_path to load the model from the previous job.

This will also automatically load the previous training and validation data, unless it’s disabled in the Active Learning settings.

ml_s = plams.Settings()
ml_s.input.ams.MachineLearning.Backend = "M3GNet"
ml_s.input.ams.MachineLearning.CommitteeSize = 1
ml_s.input.ams.MachineLearning.LoadModel = os.path.abspath(previous_params_path)
ml_s.input.ams.MachineLearning.MaxEpochs = 200

Active Learning settings

Here we use the same settings as before, but if the system is similar (or even the same!) as before, you may consider increasing the Start to let the system evolve a bit more before the first reference calculation.

You can also set theActiveLearning.InitialReferenceData.Load.Directory option instead of the MachineLearning.LoadModel option to load the data from the previous run. See the documentation for details about the difference between the two options.

al_s = plams.Settings()
al_s.input.ams.ActiveLearning.Steps.Type = "Geometric"
al_s.input.ams.ActiveLearning.Steps.Geometric.Start = 10  # 10 MD frames
al_s.input.ams.ActiveLearning.Steps.Geometric.NumSteps = 5  # 5 AL steps
# alternative to ml_s.input.ams.MacineLearning.LoadModel:
# al_s.input.ams.ActiveLearning.InitialReferenceData.Load.Directory = os.path.abspath(previous_params_path)
al_s.input.ams.ActiveLearning.InitialReferenceData.Generate.ReferenceMD.Enabled = "Yes"

Simple Active Learning job

We can run the active learning as before.

Note that the training jobs now take longer than before since the training and validation sets are bigger.

settings = ref_s + md_s + ml_s + al_s
job = SimpleActiveLearningJob(settings=settings, molecule=mol, name="sal")
job.run(watch=True);
[05.02|14:47:09] JOB sal STARTED
[05.02|14:47:09] JOB sal RUNNING
[05.02|14:47:10] Simple Active Learning 2023.205,  Nodes: 1, Procs: 1
[05.02|14:47:13] Composition of main system: C2H4O2
[05.02|14:47:13] All REFERENCE calculations will be performed with the following ForceField engine:
[05.02|14:47:13]
Engine forcefield
  type UFF
EndEngine


[05.02|14:47:13] The following are the settings for the to-be-trained MACHINE LEARNING model:
[05.02|14:47:13]
MachineLearning
  Backend M3GNet
  CommitteeSize 1
  LoadModel /path/plams_workdir/sal/step4_attempt1_training/results
  MaxEpochs 200
End

[05.02|14:47:13] A single model will be trained (no committee).
[05.02|14:47:13] The ACTIVE LEARNING loop will contain 5 steps, using the following schema:
[05.02|14:47:13]    Active Learning Step   1:       10 MD Steps (cumulative:       10)
[05.02|14:47:13]    Active Learning Step   2:       46 MD Steps (cumulative:       56)
[05.02|14:47:13]    Active Learning Step   3:      260 MD Steps (cumulative:      316)
[05.02|14:47:13]    Active Learning Step   4:     1462 MD Steps (cumulative:     1778)
[05.02|14:47:13]    Active Learning Step   5:     8222 MD Steps (cumulative:    10000)
[05.02|14:47:13] Total number of MD Steps: 10000
[05.02|14:47:13] Max attempts per active learning step: 15
[05.02|14:47:13]
[05.02|14:47:13] Tip: create a file called SKIP_STEP to skip an active learning step and move on to the next!
[05.02|14:47:13]
[05.02|14:47:13] The directory /path/plams_workdir/sal/step4_attempt1_training/results is of type RestartDirectoryType.PARAMS_RESULTS
[05.02|14:47:13] Successfully loaded previous ParAMS Job: from /path/plams_workdir/sal/step4_attempt1_training/results
[05.02|14:47:13] Running initial reference MD for constructing initial training set...
[05.02|14:47:15] Expanding training and validation sets....
[05.02|14:47:15]     Adding frames 2, 3, 4 from initial_reference_calculations/ams.rkf to training set.
[05.02|14:47:15]     Adding frames 1 from initial_reference_calculations/ams.rkf to validation set.
[05.02|14:47:15]     Current # training set entries: 18
[05.02|14:47:15]     Current # validation set entries: 9
[05.02|14:47:15]     Storing data in initial_reference_data
[05.02|14:47:15] Deleting initial_reference_calculations
[05.02|14:47:15]     Initial reference data has been created. Storing data in folder: initial_reference_data
[05.02|14:47:15] Running initial ParAMS training in folder: initial_training
[05.02|14:47:18] JOB m3gnet STARTED
[05.02|14:47:18] Starting m3gnet.prerun()
[05.02|14:47:18] m3gnet.prerun() finished
[05.02|14:47:18] JOB m3gnet RUNNING
[05.02|14:47:18] Executing m3gnet.run
[05.02|14:48:05] training_set    Epoch:      0 Loss: 0.002221
[05.02|14:48:05] validation_set  Epoch:      0 Loss: 0.053319
[05.02|14:48:06] training_set    Epoch:     10 Loss: 0.000094
[05.02|14:48:06] validation_set  Epoch:     10 Loss: 0.004871
[05.02|14:48:07] training_set    Epoch:     20 Loss: 0.000026
[05.02|14:48:07] validation_set  Epoch:     20 Loss: 0.002905
[05.02|14:48:09] training_set    Epoch:     30 Loss: 0.000017
[05.02|14:48:09] validation_set  Epoch:     30 Loss: 0.002245
[05.02|14:48:10] training_set    Epoch:     40 Loss: 0.000016
[05.02|14:48:10] validation_set  Epoch:     40 Loss: 0.003674
[05.02|14:48:12] training_set    Epoch:     50 Loss: 0.000011
[05.02|14:48:12] validation_set  Epoch:     50 Loss: 0.002469
[05.02|14:48:13] training_set    Epoch:     60 Loss: 0.000011
[05.02|14:48:13] validation_set  Epoch:     60 Loss: 0.002215
[05.02|14:48:14] training_set    Epoch:     70 Loss: 0.000010
[05.02|14:48:14] validation_set  Epoch:     70 Loss: 0.002543
[05.02|14:48:16] training_set    Epoch:     80 Loss: 0.000008
[05.02|14:48:16] validation_set  Epoch:     80 Loss: 0.002334
[05.02|14:48:17] training_set    Epoch:     90 Loss: 0.000008
[05.02|14:48:17] validation_set  Epoch:     90 Loss: 0.002346
[05.02|14:48:19] training_set    Epoch:    100 Loss: 0.000007
[05.02|14:48:19] validation_set  Epoch:    100 Loss: 0.002134
[05.02|14:48:20] training_set    Epoch:    110 Loss: 0.000009
[05.02|14:48:20] validation_set  Epoch:    110 Loss: 0.002169
[05.02|14:48:21] training_set    Epoch:    120 Loss: 0.000008
[05.02|14:48:21] validation_set  Epoch:    120 Loss: 0.003598
[05.02|14:48:23] training_set    Epoch:    130 Loss: 0.000007
[05.02|14:48:23] validation_set  Epoch:    130 Loss: 0.001976
[05.02|14:48:24] training_set    Epoch:    140 Loss: 0.000007
[05.02|14:48:24] validation_set  Epoch:    140 Loss: 0.001831
[05.02|14:48:26] training_set    Epoch:    150 Loss: 0.000006
[05.02|14:48:26] validation_set  Epoch:    150 Loss: 0.002723
[05.02|14:48:27] training_set    Epoch:    160 Loss: 0.000017
[05.02|14:48:27] validation_set  Epoch:    160 Loss: 0.002327
[05.02|14:48:28] training_set    Epoch:    170 Loss: 0.000008
[05.02|14:48:28] validation_set  Epoch:    170 Loss: 0.001964
[05.02|14:48:30] training_set    Epoch:    180 Loss: 0.000019
[05.02|14:48:30] validation_set  Epoch:    180 Loss: 0.010553
[05.02|14:48:31] training_set    Epoch:    190 Loss: 0.000014
[05.02|14:48:31] validation_set  Epoch:    190 Loss: 0.002502
[05.02|14:48:34] Execution of m3gnet.run finished with returncode 0
[05.02|14:48:34] JOB m3gnet FINISHED
[05.02|14:48:34] Starting m3gnet.postrun()
[05.02|14:48:34] m3gnet.postrun() finished
[05.02|14:48:34] JOB m3gnet SUCCESSFUL
[05.02|14:48:46] Running all jobs through AMS....
[05.02|14:48:46] Storing results/optimization/training_set_results/latest
[05.02|14:48:46] Storing results/optimization/validation_set_results/latest
[05.02|14:48:46] PLAMS environment cleaned up successfully
[05.02|14:48:46] PLAMS run finished. Goodbye
[05.02|14:48:47] Initial model has been trained!
[05.02|14:48:47]     ParAMSResults  training_set   validation_set
[05.02|14:48:47]     energy MAE     0.0085         0.0142          eV
[05.02|14:48:47]     forces MAE     0.0298         0.0760          eV/angstrom
[05.02|14:48:47]
[05.02|14:48:47] Starting active learning loop...
[05.02|14:48:47] ##########################
[05.02|14:48:47] ### Step 1 / Attempt 1 ###
[05.02|14:48:47] ##########################
[05.02|14:48:47] MD Steps: 10 (cumulative: 10)
[05.02|14:48:47] Current engine settings:
[05.02|14:48:47]
Engine MLPotential
  Backend M3GNet
  MLDistanceUnit angstrom
  MLEnergyUnit eV
  Model Custom
  ParameterDir /path/plams_workdir_continuation.003/sal/initial_training/results/optimization/m3gnet/m3gnet
EndEngine


[05.02|14:48:47]     Running step1_attempt1_simulation...
[05.02|14:48:58]     Job step1_attempt1_simulation finished
[05.02|14:48:58] Deleting files that are no longer needed...
[05.02|14:48:58] Launching reference calculation
[05.02|14:49:02]      Reference calculation finished!
[05.02|14:49:02] Checking success for step1_attempt1
[05.02|14:49:02]     CheckEnergy: Checking energy for MDStep10, n_atoms = 8
[05.02|14:49:02]     CheckEnergy: normalization coefficient = 8
[05.02|14:49:02]     CheckEnergy:                   Actual  Threshold
[05.02|14:49:02]     CheckEnergy: dE/8             -0.0089     0.2000 OK!
[05.02|14:49:02]
[05.02|14:49:02]     CheckForces: Comparing predicted forces to reference forces (eV/angstrom) on MD snapshot
[05.02|14:49:02]     CheckForces: ------------
[05.02|14:49:02]     CheckForces: Reference job from step1_attempt1_reference_calc1
[05.02|14:49:02]     CheckForces: Prediction job from final frame (MDStep10) of step1_attempt1_simulation
[05.02|14:49:02]     CheckForces: ------------
[05.02|14:49:02]     CheckForces: Histogram of forces
[05.02|14:49:02]     CheckForces: eV/Ang    Ref   Pred
[05.02|14:49:02]     CheckForces:     -3      0      0
[05.02|14:49:02]     CheckForces:     -2      4      0
[05.02|14:49:02]     CheckForces:     -1     10     13
[05.02|14:49:02]     CheckForces:      0      8     10
[05.02|14:49:02]     CheckForces:      1      1      1
[05.02|14:49:02]     CheckForces:      2      0      0
[05.02|14:49:02]     CheckForces:      3      1      0
[05.02|14:49:02]     CheckForces:      4      0      0
[05.02|14:49:02]     CheckForces: Threshold for 0 force: 0.50 eV/angstrom
[05.02|14:49:02]     CheckForces: Force components with an error exceeding the threshold:
[05.02|14:49:02]     CheckForces: Ref    Pred   Delta  Threshold
[05.02|14:49:02]     CheckForces:  -1.92  -0.74   1.18      0.63
[05.02|14:49:02]     CheckForces:   3.99   1.22   2.77      0.96
[05.02|14:49:02]     CheckForces:   1.83   0.85   0.98      0.62
[05.02|14:49:02]     CheckForces:  -1.54  -0.53   1.01      0.60
[05.02|14:49:02]     CheckForces:  -1.43  -0.57   0.86      0.59
[05.02|14:49:02]     CheckForces: Maximum deviation: 2.773 eV/angstrom
[05.02|14:49:02]     CheckForces:          Actual   Threshold
[05.02|14:49:02]     CheckForces: # > thr.        5        0  Not OK!
[05.02|14:49:02]     CheckForces: MAE         0.387     0.30  Not OK!
[05.02|14:49:02]     CheckForces: R^2         0.868     0.80  OK!
[05.02|14:49:02]     CheckForces: --------------------
[05.02|14:49:02]
[05.02|14:49:02] Adding results from step1_attempt1_reference_calc1 to training set
[05.02|14:49:02]     Current # training set entries: 19
[05.02|14:49:02]     Current # validation set entries: 9
[05.02|14:49:02]     Storing data in step1_attempt1_reference_data
[05.02|14:49:02]     Deleting initial_reference_data
[05.02|14:49:02]     Deleting step1_attempt1_reference_calc1
[05.02|14:49:02]
[05.02|14:49:02] Current (cumulative) timings:
[05.02|14:49:02]                                           Time (s) Fraction
[05.02|14:49:02]     Ref. calcs                                5.54    0.051
[05.02|14:49:02]     ML training                              91.80    0.846
[05.02|14:49:02]     Simulations                              11.20    0.103
[05.02|14:49:02]
[05.02|14:49:02]
[05.02|14:49:02]
[05.02|14:49:02] --- Begin summary ---
[05.02|14:49:02] Step  Attempt Status   Reason      finalframe_forces_max_delta
[05.02|14:49:02]     1      1 FAILED   Inaccurate                  2.7726
[05.02|14:49:02] --- End summary ---
[05.02|14:49:02]
[05.02|14:49:02] Running more reference calculations....
[05.02|14:49:02]     Running reference calculations on frames [6] from step1_attempt1_simulation/ams.rkf
[05.02|14:49:02]     Calculating 1 frames in total
[05.02|14:49:02]     Running step1_attempt1_reference_calc2
[05.02|14:49:06]     Reference calculations finished!
[05.02|14:49:06] Adding results from step1_attempt1_reference_calc2 to validation set
[05.02|14:49:06]     Current # training set entries: 19
[05.02|14:49:06]     Current # validation set entries: 10
[05.02|14:49:06]     Storing data in step1_attempt1_reference_data
[05.02|14:49:06]     Deleting step1_attempt1_reference_calc2
[05.02|14:49:06] Launching reparametrization job: step1_attempt1_training
[05.02|14:49:09] JOB m3gnet STARTED
[05.02|14:49:09] Starting m3gnet.prerun()
[05.02|14:49:09] m3gnet.prerun() finished
[05.02|14:49:09] JOB m3gnet RUNNING
[05.02|14:49:09] Executing m3gnet.run
[05.02|14:49:54] training_set    Epoch:      0 Loss: 0.001593
[05.02|14:49:54] validation_set  Epoch:      0 Loss: 0.045549
[05.02|14:49:56] training_set    Epoch:     10 Loss: 0.000124
[05.02|14:49:56] validation_set  Epoch:     10 Loss: 0.003381
[05.02|14:49:57] training_set    Epoch:     20 Loss: 0.000041
[05.02|14:49:57] validation_set  Epoch:     20 Loss: 0.002584
[05.02|14:49:58] training_set    Epoch:     30 Loss: 0.000021
[05.02|14:49:58] validation_set  Epoch:     30 Loss: 0.001870
[05.02|14:50:00] training_set    Epoch:     40 Loss: 0.000013
[05.02|14:50:00] validation_set  Epoch:     40 Loss: 0.001939
[05.02|14:50:01] training_set    Epoch:     50 Loss: 0.000010
[05.02|14:50:01] validation_set  Epoch:     50 Loss: 0.001839
[05.02|14:50:03] training_set    Epoch:     60 Loss: 0.000009
[05.02|14:50:03] validation_set  Epoch:     60 Loss: 0.001988
[05.02|14:50:04] training_set    Epoch:     70 Loss: 0.000007
[05.02|14:50:04] validation_set  Epoch:     70 Loss: 0.002044
[05.02|14:50:06] training_set    Epoch:     80 Loss: 0.000011
[05.02|14:50:06] validation_set  Epoch:     80 Loss: 0.002002
[05.02|14:50:07] training_set    Epoch:     90 Loss: 0.000008
[05.02|14:50:07] validation_set  Epoch:     90 Loss: 0.001845
[05.02|14:50:09] training_set    Epoch:    100 Loss: 0.000006
[05.02|14:50:09] validation_set  Epoch:    100 Loss: 0.001532
[05.02|14:50:10] training_set    Epoch:    110 Loss: 0.000016
[05.02|14:50:10] validation_set  Epoch:    110 Loss: 0.005885
[05.02|14:50:11] training_set    Epoch:    120 Loss: 0.000020
[05.02|14:50:11] validation_set  Epoch:    120 Loss: 0.003585
[05.02|14:50:13] training_set    Epoch:    130 Loss: 0.000008
[05.02|14:50:13] validation_set  Epoch:    130 Loss: 0.003392
[05.02|14:50:14] training_set    Epoch:    140 Loss: 0.000006
[05.02|14:50:14] validation_set  Epoch:    140 Loss: 0.001984
[05.02|14:50:16] training_set    Epoch:    150 Loss: 0.000005
[05.02|14:50:16] validation_set  Epoch:    150 Loss: 0.001855
[05.02|14:50:17] training_set    Epoch:    160 Loss: 0.000005
[05.02|14:50:17] validation_set  Epoch:    160 Loss: 0.001567
[05.02|14:50:18] training_set    Epoch:    170 Loss: 0.000006
[05.02|14:50:18] validation_set  Epoch:    170 Loss: 0.002081
[05.02|14:50:20] training_set    Epoch:    180 Loss: 0.000063
[05.02|14:50:20] validation_set  Epoch:    180 Loss: 0.003117
[05.02|14:50:21] training_set    Epoch:    190 Loss: 0.000020
[05.02|14:50:21] validation_set  Epoch:    190 Loss: 0.003667
[05.02|14:50:23] Execution of m3gnet.run finished with returncode 0
[05.02|14:50:24] JOB m3gnet FINISHED
[05.02|14:50:24] Starting m3gnet.postrun()
[05.02|14:50:24] m3gnet.postrun() finished
[05.02|14:50:24] JOB m3gnet SUCCESSFUL
[05.02|14:50:35] Running all jobs through AMS....
[05.02|14:50:35] Storing results/optimization/training_set_results/latest
[05.02|14:50:35] Storing results/optimization/validation_set_results/latest
[05.02|14:50:35] PLAMS environment cleaned up successfully
[05.02|14:50:35] PLAMS run finished. Goodbye
[05.02|14:50:36]     ParAMSResults  training_set   validation_set
[05.02|14:50:36]     energy MAE     0.0223         0.0192          eV
[05.02|14:50:36]     forces MAE     0.0317         0.0725          eV/angstrom
[05.02|14:50:36]     Newly created parameter file/dir: step1_attempt1_training/results/optimization/m3gnet/m3gnet
[05.02|14:50:36]     Done!
[05.02|14:50:36]     Deleting initial_training
[05.02|14:50:36] ##########################
[05.02|14:50:36] ### Step 1 / Attempt 2 ###
[05.02|14:50:36] ##########################
[05.02|14:50:36] MD Steps: 10 (cumulative: 10)
[05.02|14:50:36] Current engine settings:
[05.02|14:50:36]
Engine MLPotential
  Backend M3GNet
  MLDistanceUnit angstrom
  MLEnergyUnit eV
  Model Custom
  ParameterDir /path/plams_workdir_continuation.003/sal/step1_attempt1_training/results/optimization/m3gnet/m3gnet
EndEngine


[05.02|14:50:36]     Running step1_attempt2_simulation...
[05.02|14:50:48]     Job step1_attempt2_simulation finished
[05.02|14:50:48] Deleting files that are no longer needed...
[05.02|14:50:48] Launching reference calculation
[05.02|14:50:49]      Reference calculation finished!
[05.02|14:50:49] Checking success for step1_attempt2
[05.02|14:51:00]     CheckEnergy: Checking energy for MDStep10, n_atoms = 8
[05.02|14:51:00]     CheckEnergy: normalization coefficient = 8
[05.02|14:51:00]     CheckEnergy:                   Actual  Threshold
[05.02|14:51:00]     CheckEnergy: dE/8              0.0030     0.2000 OK!
[05.02|14:51:00]     CheckEnergy: ddE/8            -0.0008     0.0050 OK!      (relative to step1_attempt1_simulation:MDStep10)
[05.02|14:51:00]
[05.02|14:51:00]     CheckForces: Comparing predicted forces to reference forces (eV/angstrom) on MD snapshot
[05.02|14:51:00]     CheckForces: ------------
[05.02|14:51:00]     CheckForces: Reference job from step1_attempt2_reference_calc1
[05.02|14:51:00]     CheckForces: Prediction job from final frame (MDStep10) of step1_attempt2_simulation
[05.02|14:51:00]     CheckForces: ------------
[05.02|14:51:00]     CheckForces: Histogram of forces
[05.02|14:51:00]     CheckForces: eV/Ang    Ref   Pred
[05.02|14:51:00]     CheckForces:     -2      0      0
[05.02|14:51:00]     CheckForces:     -1     12     13
[05.02|14:51:00]     CheckForces:      0     12     10
[05.02|14:51:00]     CheckForces:      1      0      1
[05.02|14:51:00]     CheckForces: Threshold for 0 force: 0.50 eV/angstrom
[05.02|14:51:00]     CheckForces: All force components are within the acceptable error!
[05.02|14:51:00]     CheckForces: Maximum deviation: 0.169 eV/angstrom
[05.02|14:51:00]     CheckForces:          Actual   Threshold
[05.02|14:51:00]     CheckForces: # > thr.        0        0  OK!
[05.02|14:51:00]     CheckForces: MAE         0.051     0.30  OK!
[05.02|14:51:00]     CheckForces: R^2         0.963     0.80  OK!
[05.02|14:51:00]     CheckForces: --------------------
[05.02|14:51:00]
[05.02|14:51:00] Adding results from step1_attempt2_reference_calc1 to training set
[05.02|14:51:00]     Current # training set entries: 20
[05.02|14:51:00]     Current # validation set entries: 10
[05.02|14:51:00]     Storing data in step1_attempt2_reference_data
[05.02|14:51:00]     Deleting step1_attempt1_reference_data
[05.02|14:51:00]     Deleting step1_attempt2_reference_calc1
[05.02|14:51:00]
[05.02|14:51:00] Current (cumulative) timings:
[05.02|14:51:00]                                           Time (s) Fraction
[05.02|14:51:00]     Ref. calcs                               10.30    0.048
[05.02|14:51:00]     ML training                             182.11    0.847
[05.02|14:51:00]     Simulations                              22.68    0.105
[05.02|14:51:00]
[05.02|14:51:00]
[05.02|14:51:00] Step 1 finished successfully!
[05.02|14:51:00]
[05.02|14:51:00] --- Begin summary ---
[05.02|14:51:00] Step  Attempt Status   Reason      finalframe_forces_max_delta
[05.02|14:51:00]     1      1 FAILED   Inaccurate                  2.7726
[05.02|14:51:00]     1      2 SUCCESS  Accurate                    0.1695
[05.02|14:51:00] --- End summary ---
[05.02|14:51:00]
[05.02|14:51:00] ##########################
[05.02|14:51:00] ### Step 2 / Attempt 1 ###
[05.02|14:51:00] ##########################
[05.02|14:51:00] MD Steps: 46 (cumulative: 56)
[05.02|14:51:00] Current engine settings:
[05.02|14:51:00]
Engine MLPotential
  Backend M3GNet
  MLDistanceUnit angstrom
  MLEnergyUnit eV
  Model Custom
  ParameterDir /path/plams_workdir_continuation.003/sal/step1_attempt1_training/results/optimization/m3gnet/m3gnet
EndEngine


[05.02|14:51:00]     Running step2_attempt1_simulation...
[05.02|14:51:12]     Job step2_attempt1_simulation finished
[05.02|14:51:12] Deleting files that are no longer needed...
[05.02|14:51:12]     Deleting step1_attempt1_simulation
[05.02|14:51:12] Launching reference calculation
[05.02|14:51:16]      Reference calculation finished!
[05.02|14:51:16] Checking success for step2_attempt1
[05.02|14:51:27]     CheckEnergy: Checking energy for MDStep56, n_atoms = 8
[05.02|14:51:27]     CheckEnergy: normalization coefficient = 8
[05.02|14:51:27]     CheckEnergy:                   Actual  Threshold
[05.02|14:51:27]     CheckEnergy: dE/8             -0.0226     0.2000 OK!
[05.02|14:51:27]     CheckEnergy: ddE/8            -0.0256     0.0050 Not OK!  (relative to step1_attempt2_simulation:MDStep10)
[05.02|14:51:27]
[05.02|14:51:27]     CheckForces: Comparing predicted forces to reference forces (eV/angstrom) on MD snapshot
[05.02|14:51:27]     CheckForces: ------------
[05.02|14:51:27]     CheckForces: Reference job from step2_attempt1_reference_calc1
[05.02|14:51:27]     CheckForces: Prediction job from final frame (MDStep56) of step2_attempt1_simulation
[05.02|14:51:27]     CheckForces: ------------
[05.02|14:51:27]     CheckForces: Histogram of forces
[05.02|14:51:27]     CheckForces: eV/Ang    Ref   Pred
[05.02|14:51:27]     CheckForces:     -2      0      0
[05.02|14:51:27]     CheckForces:     -1     10     13
[05.02|14:51:27]     CheckForces:      0     14     11
[05.02|14:51:27]     CheckForces:      1      0      0
[05.02|14:51:27]     CheckForces: Threshold for 0 force: 0.50 eV/angstrom
[05.02|14:51:27]     CheckForces: All force components are within the acceptable error!
[05.02|14:51:27]     CheckForces: Maximum deviation: 0.401 eV/angstrom
[05.02|14:51:27]     CheckForces:          Actual   Threshold
[05.02|14:51:27]     CheckForces: # > thr.        0        0  OK!
[05.02|14:51:27]     CheckForces: MAE         0.146     0.30  OK!
[05.02|14:51:27]     CheckForces: R^2         0.773     0.80  Not OK!
[05.02|14:51:27]     CheckForces: --------------------
[05.02|14:51:27]
[05.02|14:51:27] Adding results from step2_attempt1_reference_calc1 to training set
[05.02|14:51:27]     Current # training set entries: 21
[05.02|14:51:27]     Current # validation set entries: 10
[05.02|14:51:27]     Storing data in step2_attempt1_reference_data
[05.02|14:51:27]     Deleting step1_attempt2_reference_data
[05.02|14:51:27]     Deleting step2_attempt1_reference_calc1
[05.02|14:51:27]
[05.02|14:51:27] Current (cumulative) timings:
[05.02|14:51:27]                                           Time (s) Fraction
[05.02|14:51:27]     Ref. calcs                               14.07    0.061
[05.02|14:51:27]     ML training                             182.11    0.791
[05.02|14:51:27]     Simulations                              34.14    0.148
[05.02|14:51:27]
[05.02|14:51:27]
[05.02|14:51:27]
[05.02|14:51:27] --- Begin summary ---
[05.02|14:51:27] Step  Attempt Status   Reason      finalframe_forces_max_delta
[05.02|14:51:27]     1      1 FAILED   Inaccurate                  2.7726
[05.02|14:51:27]     1      2 SUCCESS  Accurate                    0.1695
[05.02|14:51:27]     2      1 FAILED   Inaccurate                  0.4006
[05.02|14:51:27] --- End summary ---
[05.02|14:51:27]
[05.02|14:51:27] Running more reference calculations....
[05.02|14:51:27]     Running reference calculations on frames [17] from step2_attempt1_simulation/ams.rkf
[05.02|14:51:27]     Calculating 1 frames in total
[05.02|14:51:27]     Running step2_attempt1_reference_calc2
[05.02|14:51:29]     Reference calculations finished!
[05.02|14:51:29] Adding results from step2_attempt1_reference_calc2 to validation set
[05.02|14:51:29]     Current # training set entries: 21
[05.02|14:51:29]     Current # validation set entries: 11
[05.02|14:51:29]     Storing data in step2_attempt1_reference_data
[05.02|14:51:30]     Deleting step2_attempt1_reference_calc2
[05.02|14:51:30] Launching reparametrization job: step2_attempt1_training
[05.02|14:51:33] JOB m3gnet STARTED
[05.02|14:51:33] Starting m3gnet.prerun()
[05.02|14:51:33] m3gnet.prerun() finished
[05.02|14:51:33] JOB m3gnet RUNNING
[05.02|14:51:33] Executing m3gnet.run
[05.02|14:52:19] training_set    Epoch:      0 Loss: 0.001661
[05.02|14:52:19] validation_set  Epoch:      0 Loss: 0.033320
[05.02|14:52:21] training_set    Epoch:     10 Loss: 0.000061
[05.02|14:52:21] validation_set  Epoch:     10 Loss: 0.004438
[05.02|14:52:23] training_set    Epoch:     20 Loss: 0.000032
[05.02|14:52:23] validation_set  Epoch:     20 Loss: 0.002625
[05.02|14:52:24] training_set    Epoch:     30 Loss: 0.000025
[05.02|14:52:24] validation_set  Epoch:     30 Loss: 0.002844
[05.02|14:52:26] training_set    Epoch:     40 Loss: 0.000258
[05.02|14:52:26] validation_set  Epoch:     40 Loss: 0.005287
[05.02|14:52:28] training_set    Epoch:     50 Loss: 0.000031
[05.02|14:52:28] validation_set  Epoch:     50 Loss: 0.003176
[05.02|14:52:30] training_set    Epoch:     60 Loss: 0.000018
[05.02|14:52:30] validation_set  Epoch:     60 Loss: 0.003694
[05.02|14:52:31] training_set    Epoch:     70 Loss: 0.000054
[05.02|14:52:31] validation_set  Epoch:     70 Loss: 0.004076
[05.02|14:52:33] training_set    Epoch:     80 Loss: 0.000024
[05.02|14:52:33] validation_set  Epoch:     80 Loss: 0.005321
[05.02|14:52:35] training_set    Epoch:     90 Loss: 0.000044
[05.02|14:52:35] validation_set  Epoch:     90 Loss: 0.003996
[05.02|14:52:36] training_set    Epoch:    100 Loss: 0.000012
[05.02|14:52:36] validation_set  Epoch:    100 Loss: 0.002008
[05.02|14:52:38] training_set    Epoch:    110 Loss: 0.000009
[05.02|14:52:38] validation_set  Epoch:    110 Loss: 0.002455
[05.02|14:52:40] training_set    Epoch:    120 Loss: 0.000018
[05.02|14:52:40] validation_set  Epoch:    120 Loss: 0.004525
[05.02|14:52:42] training_set    Epoch:    130 Loss: 0.000012
[05.02|14:52:42] validation_set  Epoch:    130 Loss: 0.002519
[05.02|14:52:43] training_set    Epoch:    140 Loss: 0.000010
[05.02|14:52:43] validation_set  Epoch:    140 Loss: 0.002135
[05.02|14:52:45] training_set    Epoch:    150 Loss: 0.000010
[05.02|14:52:45] validation_set  Epoch:    150 Loss: 0.002368
[05.02|14:52:47] training_set    Epoch:    160 Loss: 0.000010
[05.02|14:52:47] validation_set  Epoch:    160 Loss: 0.002642
[05.02|14:52:49] training_set    Epoch:    170 Loss: 0.000007
[05.02|14:52:49] validation_set  Epoch:    170 Loss: 0.002306
[05.02|14:52:50] training_set    Epoch:    180 Loss: 0.000012
[05.02|14:52:50] validation_set  Epoch:    180 Loss: 0.002507
[05.02|14:52:52] training_set    Epoch:    190 Loss: 0.000013
[05.02|14:52:52] validation_set  Epoch:    190 Loss: 0.002556
[05.02|14:52:55] Execution of m3gnet.run finished with returncode 0
[05.02|14:52:55] JOB m3gnet FINISHED
[05.02|14:52:55] Starting m3gnet.postrun()
[05.02|14:52:55] m3gnet.postrun() finished
[05.02|14:52:55] JOB m3gnet SUCCESSFUL
[05.02|14:53:07] Running all jobs through AMS....
[05.02|14:53:07] Storing results/optimization/training_set_results/latest
[05.02|14:53:07] Storing results/optimization/validation_set_results/latest
[05.02|14:53:07] PLAMS environment cleaned up successfully
[05.02|14:53:07] PLAMS run finished. Goodbye
[05.02|14:53:08]     ParAMSResults  training_set   validation_set
[05.02|14:53:08]     energy MAE     0.0180         0.0161          eV
[05.02|14:53:08]     forces MAE     0.0336         0.0750          eV/angstrom
[05.02|14:53:08]     Newly created parameter file/dir: step2_attempt1_training/results/optimization/m3gnet/m3gnet
[05.02|14:53:08]     Done!
[05.02|14:53:08]     Deleting step1_attempt1_training
[05.02|14:53:08] ##########################
[05.02|14:53:08] ### Step 2 / Attempt 2 ###
[05.02|14:53:08] ##########################
[05.02|14:53:08] MD Steps: 46 (cumulative: 56)
[05.02|14:53:08] Current engine settings:
[05.02|14:53:08]
Engine MLPotential
  Backend M3GNet
  MLDistanceUnit angstrom
  MLEnergyUnit eV
  Model Custom
  ParameterDir /path/plams_workdir_continuation.003/sal/step2_attempt1_training/results/optimization/m3gnet/m3gnet
EndEngine


[05.02|14:53:08]     Running step2_attempt2_simulation...
[05.02|14:53:20]     Job step2_attempt2_simulation finished
[05.02|14:53:20] Deleting files that are no longer needed...
[05.02|14:53:20] Launching reference calculation
[05.02|14:53:22]      Reference calculation finished!
[05.02|14:53:22] Checking success for step2_attempt2
[05.02|14:53:33]     CheckEnergy: Checking energy for MDStep56, n_atoms = 8
[05.02|14:53:33]     CheckEnergy: normalization coefficient = 8
[05.02|14:53:33]     CheckEnergy:                   Actual  Threshold
[05.02|14:53:33]     CheckEnergy: dE/8              0.0019     0.2000 OK!
[05.02|14:53:33]     CheckEnergy: ddE/8             0.0010     0.0050 OK!      (relative to step2_attempt1_simulation:MDStep56)
[05.02|14:53:33]
[05.02|14:53:33]     CheckForces: Comparing predicted forces to reference forces (eV/angstrom) on MD snapshot
[05.02|14:53:33]     CheckForces: ------------
[05.02|14:53:33]     CheckForces: Reference job from step2_attempt2_reference_calc1
[05.02|14:53:33]     CheckForces: Prediction job from final frame (MDStep56) of step2_attempt2_simulation
[05.02|14:53:33]     CheckForces: ------------
[05.02|14:53:33]     CheckForces: Histogram of forces
[05.02|14:53:33]     CheckForces: eV/Ang    Ref   Pred
[05.02|14:53:33]     CheckForces:     -2      0      0
[05.02|14:53:33]     CheckForces:     -1     11     13
[05.02|14:53:33]     CheckForces:      0     13     11
[05.02|14:53:33]     CheckForces:      1      0      0
[05.02|14:53:33]     CheckForces: Threshold for 0 force: 0.50 eV/angstrom
[05.02|14:53:33]     CheckForces: All force components are within the acceptable error!
[05.02|14:53:33]     CheckForces: Maximum deviation: 0.232 eV/angstrom
[05.02|14:53:33]     CheckForces:          Actual   Threshold
[05.02|14:53:33]     CheckForces: # > thr.        0        0  OK!
[05.02|14:53:33]     CheckForces: MAE         0.057     0.30  OK!
[05.02|14:53:33]     CheckForces: R^2         0.950     0.80  OK!
[05.02|14:53:33]     CheckForces: --------------------
[05.02|14:53:33]
[05.02|14:53:33] Adding results from step2_attempt2_reference_calc1 to validation set
[05.02|14:53:33]     Current # training set entries: 21
[05.02|14:53:33]     Current # validation set entries: 12
[05.02|14:53:33]     Storing data in step2_attempt2_reference_data
[05.02|14:53:33]     Deleting step2_attempt1_reference_data
[05.02|14:53:33]     Deleting step2_attempt2_reference_calc1
[05.02|14:53:33]
[05.02|14:53:33] Current (cumulative) timings:
[05.02|14:53:33]                                           Time (s) Fraction
[05.02|14:53:33]     Ref. calcs                               17.63    0.051
[05.02|14:53:33]     ML training                             280.42    0.814
[05.02|14:53:33]     Simulations                              46.31    0.134
[05.02|14:53:33]
[05.02|14:53:33]
[05.02|14:53:33] Step 2 finished successfully!
[05.02|14:53:33]
[05.02|14:53:33] --- Begin summary ---
[05.02|14:53:33] Step  Attempt Status   Reason      finalframe_forces_max_delta
[05.02|14:53:33]     1      1 FAILED   Inaccurate                  2.7726
[05.02|14:53:33]     1      2 SUCCESS  Accurate                    0.1695
[05.02|14:53:33]     2      1 FAILED   Inaccurate                  0.4006
[05.02|14:53:33]     2      2 SUCCESS  Accurate                    0.2324
[05.02|14:53:33] --- End summary ---
[05.02|14:53:33]
[05.02|14:53:33] ##########################
[05.02|14:53:33] ### Step 3 / Attempt 1 ###
[05.02|14:53:33] ##########################
[05.02|14:53:33] MD Steps: 260 (cumulative: 316)
[05.02|14:53:33] Current engine settings:
[05.02|14:53:33]
Engine MLPotential
  Backend M3GNet
  MLDistanceUnit angstrom
  MLEnergyUnit eV
  Model Custom
  ParameterDir /path/plams_workdir_continuation.003/sal/step2_attempt1_training/results/optimization/m3gnet/m3gnet
EndEngine


[05.02|14:53:33]     Running step3_attempt1_simulation...
[05.02|14:53:47]     Job step3_attempt1_simulation finished
[05.02|14:53:47] Deleting files that are no longer needed...
[05.02|14:53:47]     Deleting step1_attempt2_simulation
[05.02|14:53:47]     Deleting step2_attempt1_simulation
[05.02|14:53:47] Launching reference calculation
[05.02|14:53:49]      Reference calculation finished!
[05.02|14:53:49] Checking success for step3_attempt1
[05.02|14:54:00]     CheckEnergy: Checking energy for MDStep316, n_atoms = 8
[05.02|14:54:00]     CheckEnergy: normalization coefficient = 8
[05.02|14:54:00]     CheckEnergy:                   Actual  Threshold
[05.02|14:54:00]     CheckEnergy: dE/8              0.0006     0.2000 OK!
[05.02|14:54:00]     CheckEnergy: ddE/8            -0.0012     0.0050 OK!      (relative to step2_attempt2_simulation:MDStep56)
[05.02|14:54:00]
[05.02|14:54:00]     CheckForces: Comparing predicted forces to reference forces (eV/angstrom) on MD snapshot
[05.02|14:54:00]     CheckForces: ------------
[05.02|14:54:00]     CheckForces: Reference job from step3_attempt1_reference_calc1
[05.02|14:54:00]     CheckForces: Prediction job from final frame (MDStep316) of step3_attempt1_simulation
[05.02|14:54:00]     CheckForces: ------------
[05.02|14:54:00]     CheckForces: Histogram of forces
[05.02|14:54:00]     CheckForces: eV/Ang    Ref   Pred
[05.02|14:54:00]     CheckForces:     -2      0      0
[05.02|14:54:00]     CheckForces:     -1     12     11
[05.02|14:54:00]     CheckForces:      0     11     13
[05.02|14:54:00]     CheckForces:      1      1      0
[05.02|14:54:00]     CheckForces: Threshold for 0 force: 0.50 eV/angstrom
[05.02|14:54:00]     CheckForces: All force components are within the acceptable error!
[05.02|14:54:00]     CheckForces: Maximum deviation: 0.394 eV/angstrom
[05.02|14:54:00]     CheckForces:          Actual   Threshold
[05.02|14:54:00]     CheckForces: # > thr.        0        0  OK!
[05.02|14:54:00]     CheckForces: MAE         0.092     0.30  OK!
[05.02|14:54:00]     CheckForces: R^2         0.908     0.80  OK!
[05.02|14:54:00]     CheckForces: --------------------
[05.02|14:54:00]
[05.02|14:54:00] Adding results from step3_attempt1_reference_calc1 to validation set
[05.02|14:54:00]     Current # training set entries: 21
[05.02|14:54:00]     Current # validation set entries: 13
[05.02|14:54:00]     Storing data in step3_attempt1_reference_data
[05.02|14:54:00]     Deleting step2_attempt2_reference_data
[05.02|14:54:00]     Deleting step3_attempt1_reference_calc1
[05.02|14:54:00]
[05.02|14:54:00] Current (cumulative) timings:
[05.02|14:54:00]                                           Time (s) Fraction
[05.02|14:54:00]     Ref. calcs                               19.26    0.054
[05.02|14:54:00]     ML training                             280.42    0.780
[05.02|14:54:00]     Simulations                              59.63    0.166
[05.02|14:54:00]
[05.02|14:54:00]
[05.02|14:54:00] Step 3 finished successfully!
[05.02|14:54:00]
[05.02|14:54:00] --- Begin summary ---
[05.02|14:54:00] Step  Attempt Status   Reason      finalframe_forces_max_delta
[05.02|14:54:00]     1      1 FAILED   Inaccurate                  2.7726
[05.02|14:54:00]     1      2 SUCCESS  Accurate                    0.1695
[05.02|14:54:00]     2      1 FAILED   Inaccurate                  0.4006
[05.02|14:54:00]     2      2 SUCCESS  Accurate                    0.2324
[05.02|14:54:00]     3      1 SUCCESS  Accurate                    0.3938
[05.02|14:54:00] --- End summary ---
[05.02|14:54:00]
[05.02|14:54:00] ##########################
[05.02|14:54:00] ### Step 4 / Attempt 1 ###
[05.02|14:54:00] ##########################
[05.02|14:54:00] MD Steps: 1462 (cumulative: 1778)
[05.02|14:54:00] Current engine settings:
[05.02|14:54:00]
Engine MLPotential
  Backend M3GNet
  MLDistanceUnit angstrom
  MLEnergyUnit eV
  Model Custom
  ParameterDir /path/plams_workdir_continuation.003/sal/step2_attempt1_training/results/optimization/m3gnet/m3gnet
EndEngine


[05.02|14:54:00]     Running step4_attempt1_simulation...
[05.02|14:54:24]     Job step4_attempt1_simulation finished
[05.02|14:54:24] Deleting files that are no longer needed...
[05.02|14:54:24]     Deleting step2_attempt2_simulation
[05.02|14:54:24] Launching reference calculation
[05.02|14:54:26]      Reference calculation finished!
[05.02|14:54:26] Checking success for step4_attempt1
[05.02|14:54:37]     CheckEnergy: Checking energy for MDStep1778, n_atoms = 8
[05.02|14:54:37]     CheckEnergy: normalization coefficient = 8
[05.02|14:54:37]     CheckEnergy:                   Actual  Threshold
[05.02|14:54:37]     CheckEnergy: dE/8              0.0016     0.2000 OK!
[05.02|14:54:37]     CheckEnergy: ddE/8             0.0010     0.0050 OK!      (relative to step3_attempt1_simulation:MDStep316)
[05.02|14:54:37]
[05.02|14:54:37]     CheckForces: Comparing predicted forces to reference forces (eV/angstrom) on MD snapshot
[05.02|14:54:37]     CheckForces: ------------
[05.02|14:54:37]     CheckForces: Reference job from step4_attempt1_reference_calc1
[05.02|14:54:37]     CheckForces: Prediction job from final frame (MDStep1778) of step4_attempt1_simulation
[05.02|14:54:37]     CheckForces: ------------
[05.02|14:54:37]     CheckForces: Histogram of forces
[05.02|14:54:37]     CheckForces: eV/Ang    Ref   Pred
[05.02|14:54:37]     CheckForces:     -3      0      1
[05.02|14:54:37]     CheckForces:     -2      4      2
[05.02|14:54:37]     CheckForces:     -1      8      9
[05.02|14:54:37]     CheckForces:      0      7      7
[05.02|14:54:37]     CheckForces:      1      5      5
[05.02|14:54:37]     CheckForces:      2      0      0
[05.02|14:54:37]     CheckForces: Threshold for 0 force: 0.50 eV/angstrom
[05.02|14:54:37]     CheckForces: All force components are within the acceptable error!
[05.02|14:54:37]     CheckForces: Maximum deviation: 0.416 eV/angstrom
[05.02|14:54:37]     CheckForces:          Actual   Threshold
[05.02|14:54:37]     CheckForces: # > thr.        0        0  OK!
[05.02|14:54:37]     CheckForces: MAE         0.115     0.30  OK!
[05.02|14:54:37]     CheckForces: R^2         0.974     0.80  OK!
[05.02|14:54:37]     CheckForces: --------------------
[05.02|14:54:37]
[05.02|14:54:37] Adding results from step4_attempt1_reference_calc1 to training set
[05.02|14:54:37]     Current # training set entries: 22
[05.02|14:54:37]     Current # validation set entries: 13
[05.02|14:54:37]     Storing data in step4_attempt1_reference_data
[05.02|14:54:37]     Deleting step3_attempt1_reference_data
[05.02|14:54:37]     Deleting step4_attempt1_reference_calc1
[05.02|14:54:37]
[05.02|14:54:37] Current (cumulative) timings:
[05.02|14:54:37]                                           Time (s) Fraction
[05.02|14:54:37]     Ref. calcs                               20.70    0.054
[05.02|14:54:37]     ML training                             280.42    0.729
[05.02|14:54:37]     Simulations                              83.62    0.217
[05.02|14:54:37]
[05.02|14:54:37]
[05.02|14:54:37] Step 4 finished successfully!
[05.02|14:54:37]
[05.02|14:54:37] --- Begin summary ---
[05.02|14:54:37] Step  Attempt Status   Reason      finalframe_forces_max_delta
[05.02|14:54:37]     1      1 FAILED   Inaccurate                  2.7726
[05.02|14:54:37]     1      2 SUCCESS  Accurate                    0.1695
[05.02|14:54:37]     2      1 FAILED   Inaccurate                  0.4006
[05.02|14:54:37]     2      2 SUCCESS  Accurate                    0.2324
[05.02|14:54:37]     3      1 SUCCESS  Accurate                    0.3938
[05.02|14:54:37]     4      1 SUCCESS  Accurate                    0.4157
[05.02|14:54:37] --- End summary ---
[05.02|14:54:37]
[05.02|14:54:37] ##########################
[05.02|14:54:37] ### Step 5 / Attempt 1 ###
[05.02|14:54:37] ##########################
[05.02|14:54:37] MD Steps: 8222 (cumulative: 10000)
[05.02|14:54:37] Current engine settings:
[05.02|14:54:37]
Engine MLPotential
  Backend M3GNet
  MLDistanceUnit angstrom
  MLEnergyUnit eV
  Model Custom
  ParameterDir /path/plams_workdir_continuation.003/sal/step2_attempt1_training/results/optimization/m3gnet/m3gnet
EndEngine


[05.02|14:54:37]     Running step5_attempt1_simulation...
[05.02|14:56:00]     Job step5_attempt1_simulation finished
[05.02|14:56:00] Deleting files that are no longer needed...
[05.02|14:56:00]     Deleting step3_attempt1_simulation
[05.02|14:56:01] Launching reference calculation
[05.02|14:56:03]      Reference calculation finished!
[05.02|14:56:03] Checking success for step5_attempt1
[05.02|14:56:14]     CheckEnergy: Checking energy for MDStep10000, n_atoms = 8
[05.02|14:56:14]     CheckEnergy: normalization coefficient = 8
[05.02|14:56:14]     CheckEnergy:                   Actual  Threshold
[05.02|14:56:14]     CheckEnergy: dE/8              0.0002     0.2000 OK!
[05.02|14:56:14]     CheckEnergy: ddE/8            -0.0015     0.0050 OK!      (relative to step4_attempt1_simulation:MDStep1778)
[05.02|14:56:14]
[05.02|14:56:14]     CheckForces: Comparing predicted forces to reference forces (eV/angstrom) on MD snapshot
[05.02|14:56:14]     CheckForces: ------------
[05.02|14:56:14]     CheckForces: Reference job from step5_attempt1_reference_calc1
[05.02|14:56:14]     CheckForces: Prediction job from final frame (MDStep10000) of step5_attempt1_simulation
[05.02|14:56:14]     CheckForces: ------------
[05.02|14:56:14]     CheckForces: Histogram of forces
[05.02|14:56:14]     CheckForces: eV/Ang    Ref   Pred
[05.02|14:56:14]     CheckForces:     -4      0      0
[05.02|14:56:14]     CheckForces:     -3      1      1
[05.02|14:56:14]     CheckForces:     -2      2      1
[05.02|14:56:14]     CheckForces:     -1     12     14
[05.02|14:56:14]     CheckForces:      0      2      2
[05.02|14:56:14]     CheckForces:      1      4      5
[05.02|14:56:14]     CheckForces:      2      3      1
[05.02|14:56:14]     CheckForces: Threshold for 0 force: 0.50 eV/angstrom
[05.02|14:56:14]     CheckForces: All force components are within the acceptable error!
[05.02|14:56:14]     CheckForces: Maximum deviation: 0.425 eV/angstrom
[05.02|14:56:14]     CheckForces:          Actual   Threshold
[05.02|14:56:14]     CheckForces: # > thr.        0        0  OK!
[05.02|14:56:14]     CheckForces: MAE         0.126     0.30  OK!
[05.02|14:56:14]     CheckForces: R^2         0.988     0.80  OK!
[05.02|14:56:14]     CheckForces: --------------------
[05.02|14:56:14]
[05.02|14:56:14] Adding results from step5_attempt1_reference_calc1 to validation set
[05.02|14:56:14]     Current # training set entries: 22
[05.02|14:56:14]     Current # validation set entries: 14
[05.02|14:56:14]     Storing data in step5_attempt1_reference_data
[05.02|14:56:14]     Deleting step4_attempt1_reference_data
[05.02|14:56:14]     Deleting step5_attempt1_reference_calc1
[05.02|14:56:14]
[05.02|14:56:14] Current (cumulative) timings:
[05.02|14:56:14]                                           Time (s) Fraction
[05.02|14:56:14]     Ref. calcs                               23.02    0.049
[05.02|14:56:14]     ML training                             280.42    0.596
[05.02|14:56:14]     Simulations                             166.91    0.355
[05.02|14:56:14]
[05.02|14:56:14]
[05.02|14:56:14] Step 5 finished successfully!
[05.02|14:56:14]
[05.02|14:56:14] --- Begin summary ---
[05.02|14:56:14] Step  Attempt Status   Reason      finalframe_forces_max_delta
[05.02|14:56:14]     1      1 FAILED   Inaccurate                  2.7726
[05.02|14:56:14]     1      2 SUCCESS  Accurate                    0.1695
[05.02|14:56:14]     2      1 FAILED   Inaccurate                  0.4006
[05.02|14:56:14]     2      2 SUCCESS  Accurate                    0.2324
[05.02|14:56:14]     3      1 SUCCESS  Accurate                    0.3938
[05.02|14:56:14]     4      1 SUCCESS  Accurate                    0.4157
[05.02|14:56:14]     5      1 SUCCESS  Accurate                    0.4252
[05.02|14:56:14] --- End summary ---
[05.02|14:56:14]
[05.02|14:56:14] The engine settings for the final trained ML engine are:
[05.02|14:56:14]
Engine MLPotential
  Backend M3GNet
  MLDistanceUnit angstrom
  MLEnergyUnit eV
  Model Custom
  ParameterDir /path/plams_workdir_continuation.003/sal/step2_attempt1_training/results/optimization/m3gnet/m3gnet
EndEngine



[05.02|14:56:14] Active learning finished!
[05.02|14:56:14] Rerunning the simulation with the final parameters...
[05.02|14:57:51] Goodbye!
[05.02|14:57:51] JOB sal FINISHED
[05.02|14:57:51] JOB sal SUCCESSFUL
<scm.params.plams.simple_active_learning_job.SimpleActiveLearningResults at 0x7f3998ddc1f0>

Complete Python code

#!/usr/bin/env amspython
# coding: utf-8

# ## Initialization

from scm.simple_active_learning import SimpleActiveLearningJob
import scm.plams as plams
import matplotlib.pyplot as plt
import os

plams.init(folder="plams_workdir_continuation")


# Set the correct path to the previous Simple Active Learning job. The path should be a directory containing the file "simple_active_learning.rkf"

# replace the path with your own path !
previous_sal_job_path = os.path.expandvars("$AMSHOME/examples/SAL/Output/SingleMolecule/plams_workdir/sal")
previous_sal_job = SimpleActiveLearningJob.load_external(previous_sal_job_path)
previous_params_path = previous_sal_job.results.get_params_results_directory()


# ## Initial system, reference engine settings, MD settings
#
# These settings were explained in the first tutorial.
#
# Here we use a new molecule (acetic acid), but we could also have changed the temperature of the MD simulation, or any other setting.

mol = plams.from_smiles("CC(O)=O")
for at in mol:
    at.properties = {}
mol = plams.preoptimize(mol)
plams.plot_molecule(mol)


ref_s = plams.Settings()
ref_s.input.ForceField.Type = "UFF"
ref_s.runscript.nproc = 1


md_s = plams.AMSNVTJob(temperature=300, timestep=0.5, nsteps=10000).settings


# ## ParAMS ML training settings
# Here we set ``LoadModel = previous_params_path`` to load the model from the previous job.
#
# This will also automatically load the previous training and validation data, unless it's disabled in the Active Learning settings.

ml_s = plams.Settings()
ml_s.input.ams.MachineLearning.Backend = "M3GNet"
ml_s.input.ams.MachineLearning.CommitteeSize = 1
ml_s.input.ams.MachineLearning.LoadModel = os.path.abspath(previous_params_path)
ml_s.input.ams.MachineLearning.MaxEpochs = 200


# ## Active Learning settings
#
# Here we use the same settings as before, but if the system is similar (or even the same!) as before, you may consider increasing the ``Start`` to let the system evolve a bit more before the first reference calculation.
#
# You can also set the``ActiveLearning.InitialReferenceData.Load.Directory`` option instead of the ``MachineLearning.LoadModel`` option to load the data from the previous run. See the documentation for details about the difference between the two options.

al_s = plams.Settings()
al_s.input.ams.ActiveLearning.Steps.Type = "Geometric"
al_s.input.ams.ActiveLearning.Steps.Geometric.Start = 10  # 10 MD frames
al_s.input.ams.ActiveLearning.Steps.Geometric.NumSteps = 5  # 5 AL steps
# alternative to ml_s.input.ams.MacineLearning.LoadModel:
# al_s.input.ams.ActiveLearning.InitialReferenceData.Load.Directory = os.path.abspath(previous_params_path)
al_s.input.ams.ActiveLearning.InitialReferenceData.Generate.ReferenceMD.Enabled = "Yes"


# ## Simple Active Learning job
#
# We can run the active learning as before.
#
# Note that the training jobs now take longer than before since the training and validation sets are bigger.

settings = ref_s + md_s + ml_s + al_s
job = SimpleActiveLearningJob(settings=settings, molecule=mol, name="sal")
job.run(watch=True)