Single molecule: setup and run

Note: This example requires AMS2024 or later.

To follow along, either

Initial imports

from scm.simple_active_learning import SimpleActiveLearningJob
import scm.plams as plams
from scm.external_engines.core import interface_is_installed

assert interface_is_installed(
    "m3gnet"
), "You must first install m3gnet with the AMS package manager"

Initialize PLAMS

plams.init()
PLAMS working folder: /path/plams_workdir

Input system

mol = plams.from_smiles("OCC=O")
for at in mol:
    at.properties = {}
plams.plot_molecule(mol)
../../../_images/sal_single_molecule_setup_run_5_0.png

Reference engine settings

For time reasons we use the UFF force field as the reference method. Typically you would instead train to DFT using ADF, BAND, or Quantum ESPRESSO.

ref_s = plams.Settings()
ref_s.input.ForceField.Type = "UFF"
ref_s.runscript.nproc = 1
print(plams.AMSJob(settings=ref_s).get_input())
Engine ForceField
  Type UFF
EndEngine

Molecular dynamics settings

Here, we use the convenient AMSNVTJob recipe to easily initialize sone MD settings.

md_s = plams.AMSNVTJob(temperature=300, timestep=0.5, nsteps=10000).settings
print(plams.AMSJob(settings=md_s).get_input())
MolecularDynamics
  BinLog
    DipoleMoment False
    PressureTensor False
    Time False
  End
  CalcPressure False
  Checkpoint
    Frequency 1000000
  End
  InitialVelocities
    Temperature 300
    Type Random
  End
  NSteps 10000
  Thermostat
    Tau 200.0
    Temperature 300
    Type NHC
  End
  TimeStep 0.5
  Trajectory
    SamplingFreq 100
    WriteBonds True
    WriteCharges True
    WriteEngineGradients False
    WriteMolecules True
    WriteVelocities True
  End
End

Task MolecularDynamics

ParAMS ML Training settings

(Technical note: When using SimpleActiveLearningJob the ParAMS settings go under input.ams. When using ParAMSJob the settings instead simply go under input. See the ParAMS Python tutorials.)

ml_s = plams.Settings()
ml_s.input.ams.MachineLearning.Backend = "M3GNet"
ml_s.input.ams.MachineLearning.CommitteeSize = 1
ml_s.input.ams.MachineLearning.M3GNet.Model = "UniversalPotential"
ml_s.input.ams.MachineLearning.MaxEpochs = 200
print(SimpleActiveLearningJob(settings=ml_s).get_input())
MachineLearning
  Backend M3GNet
  CommitteeSize 1
  M3GNet
    Model UniversalPotential
  End
  MaxEpochs 200
End

Active learning settings

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  # 10 AL steps
print(SimpleActiveLearningJob(settings=al_s).get_input())
ActiveLearning
  Steps
    Geometric
      NumSteps 5
      Start 10
    End
    Type Geometric
  End
End

Simple Active Learning Job

settings = ref_s + md_s + ml_s + al_s
job = SimpleActiveLearningJob(settings=settings, molecule=mol, name="sal")
print(job.get_input())
ActiveLearning
  Steps
    Geometric
      NumSteps 5
      Start 10
    End
    Type Geometric
  End
End
MachineLearning
  Backend M3GNet
  CommitteeSize 1
  M3GNet
    Model UniversalPotential
  End
  MaxEpochs 200
End
MolecularDynamics
  BinLog
    DipoleMoment False
    PressureTensor False
    Time False
  End
  CalcPressure False
  Checkpoint
    Frequency 1000000
  End
  InitialVelocities
    Temperature 300.0
    Type Random
  End
  NSteps 10000
  Thermostat
    Tau 200.0
    Temperature 300.0
    Type NHC
  End
  TimeStep 0.5
  Trajectory
    SamplingFreq 100
    WriteBonds True
    WriteCharges True
    WriteEngineGradients False
    WriteMolecules True
    WriteVelocities True
  End
End
Task MolecularDynamics

Engine ForceField
  Type UFF
EndEngine

System
  Atoms
              O       1.5185424677       1.2528427606      -0.3382346351
              C       1.0167107700       0.2231953999       0.1069866215
              C      -0.3341736669      -0.1931701775      -0.3199821682
              O      -1.3067693409       0.4447398660       0.4319048572
              H       1.6797677292      -0.4284512471       0.6676972986
              H      -0.4715138766       0.0855120883      -1.3968084763
              H      -0.4208687404      -1.2969328351      -0.3134514232
              H      -1.6816953421      -0.0877358551       1.1618879254
  End
  BondOrders
     1 2 2.0
     2 3 1.0
     3 4 1.0
     2 5 1.0
     3 6 1.0
     3 7 1.0
     4 8 1.0
  End
  Charge 0
End

Run the job

job.run(watch=True)
[31.01|17:43:33] JOB sal STARTED
[31.01|17:43:33] JOB sal RUNNING
[31.01|17:43:34] Simple Active Learning 2023.205,  Nodes: 1, Procs: 1
[31.01|17:43:36] Composition of main system: C2H4O2
[31.01|17:43:36] All REFERENCE calculations will be performed with the following ForceField engine:
[31.01|17:43:36]
Engine forcefield
  type UFF
EndEngine


[31.01|17:43:36] The following are the settings for the to-be-trained MACHINE LEARNING model:
[31.01|17:43:36]
MachineLearning
  Backend M3GNet
  CommitteeSize 1
  M3GNet
    Model UniversalPotential
  End
  MaxEpochs 200
End

[31.01|17:43:36] A single model will be trained (no committee).
[31.01|17:43:36] The ACTIVE LEARNING loop will contain 5 steps, using the following schema:
[31.01|17:43:36]    Active Learning Step   1:       10 MD Steps (cumulative:       10)
[31.01|17:43:36]    Active Learning Step   2:       46 MD Steps (cumulative:       56)
[31.01|17:43:36]    Active Learning Step   3:      260 MD Steps (cumulative:      316)
[31.01|17:43:36]    Active Learning Step   4:     1462 MD Steps (cumulative:     1778)
[31.01|17:43:36]    Active Learning Step   5:     8222 MD Steps (cumulative:    10000)
[31.01|17:43:36] Total number of MD Steps: 10000
[31.01|17:43:36] Max attempts per active learning step: 15
[31.01|17:43:36]
[31.01|17:43:36] Tip: create a file called SKIP_STEP to skip an active learning step and move on to the next!
[31.01|17:43:36]
[31.01|17:43:36] Running initial reference MD for constructing initial training set...
[31.01|17:43:37] Expanding training and validation sets....
[31.01|17:43:37]     Adding frames 2, 3, 4 from initial_reference_calculations/ams.rkf to training set.
[31.01|17:43:37]     Adding frames 1 from initial_reference_calculations/ams.rkf to validation set.
[31.01|17:43:37]     Current # training set entries: 3
[31.01|17:43:37]     Current # validation set entries: 1
[31.01|17:43:37]     Storing data in initial_reference_data
[31.01|17:43:37] Deleting initial_reference_calculations
[31.01|17:43:37]     Initial reference data has been created. Storing data in folder: initial_reference_data
[31.01|17:43:37] Running initial ParAMS training in folder: initial_training
[31.01|17:43:39] JOB m3gnet STARTED
[31.01|17:43:39] Starting m3gnet.prerun()
[31.01|17:43:39] m3gnet.prerun() finished
[31.01|17:43:39] JOB m3gnet RUNNING
[31.01|17:43:39] Executing m3gnet.run
[31.01|17:44:04] training_set    Epoch:      0 Loss: 0.001370
[31.01|17:44:04] validation_set  Epoch:      0 Loss: 0.069857
[31.01|17:44:04] training_set    Epoch:     10 Loss: 0.000821
[31.01|17:44:04] validation_set  Epoch:     10 Loss: 0.003661
[31.01|17:44:05] training_set    Epoch:     20 Loss: 0.000368
[31.01|17:44:05] validation_set  Epoch:     20 Loss: 0.004117
[31.01|17:44:05] training_set    Epoch:     30 Loss: 0.000160
[31.01|17:44:05] validation_set  Epoch:     30 Loss: 0.004883
[31.01|17:44:06] training_set    Epoch:     40 Loss: 0.000074
[31.01|17:44:06] validation_set  Epoch:     40 Loss: 0.002111
[31.01|17:44:06] training_set    Epoch:     50 Loss: 0.000040
[31.01|17:44:06] validation_set  Epoch:     50 Loss: 0.001035
[31.01|17:44:07] training_set    Epoch:     60 Loss: 0.000037
[31.01|17:44:07] validation_set  Epoch:     60 Loss: 0.001459
[31.01|17:44:07] training_set    Epoch:     70 Loss: 0.000030
[31.01|17:44:07] validation_set  Epoch:     70 Loss: 0.000749
[31.01|17:44:08] training_set    Epoch:     80 Loss: 0.000024
[31.01|17:44:08] validation_set  Epoch:     80 Loss: 0.001935
[31.01|17:44:08] training_set    Epoch:     90 Loss: 0.000021
[31.01|17:44:08] validation_set  Epoch:     90 Loss: 0.001082
[31.01|17:44:09] training_set    Epoch:    100 Loss: 0.000018
[31.01|17:44:09] validation_set  Epoch:    100 Loss: 0.000597
[31.01|17:44:09] training_set    Epoch:    110 Loss: 0.000015
[31.01|17:44:09] validation_set  Epoch:    110 Loss: 0.000949
[31.01|17:44:10] training_set    Epoch:    120 Loss: 0.000013
[31.01|17:44:10] validation_set  Epoch:    120 Loss: 0.000559
[31.01|17:44:10] training_set    Epoch:    130 Loss: 0.000012
[31.01|17:44:10] validation_set  Epoch:    130 Loss: 0.000625
[31.01|17:44:11] training_set    Epoch:    140 Loss: 0.000010
[31.01|17:44:11] validation_set  Epoch:    140 Loss: 0.000463
[31.01|17:44:11] training_set    Epoch:    150 Loss: 0.000009
[31.01|17:44:11] validation_set  Epoch:    150 Loss: 0.000463
[31.01|17:44:12] training_set    Epoch:    160 Loss: 0.000008
[31.01|17:44:12] validation_set  Epoch:    160 Loss: 0.000370
[31.01|17:44:12] training_set    Epoch:    170 Loss: 0.000007
[31.01|17:44:12] validation_set  Epoch:    170 Loss: 0.000337
[31.01|17:44:13] training_set    Epoch:    180 Loss: 0.000006
[31.01|17:44:13] validation_set  Epoch:    180 Loss: 0.000305
[31.01|17:44:13] training_set    Epoch:    190 Loss: 0.000006
[31.01|17:44:13] validation_set  Epoch:    190 Loss: 0.000270
[31.01|17:44:15] Execution of m3gnet.run finished with returncode 0
[31.01|17:44:15] JOB m3gnet FINISHED
[31.01|17:44:15] Starting m3gnet.postrun()
[31.01|17:44:15] m3gnet.postrun() finished
[31.01|17:44:15] JOB m3gnet SUCCESSFUL
[31.01|17:44:26] Running all jobs through AMS....
[31.01|17:44:26] Storing results/optimization/training_set_results/latest
[31.01|17:44:26] Storing results/optimization/validation_set_results/latest
[31.01|17:44:26] PLAMS environment cleaned up successfully
[31.01|17:44:26] PLAMS run finished. Goodbye
[31.01|17:44:26] Initial model has been trained!
[31.01|17:44:26]     ParAMSResults  training_set   validation_set
[31.01|17:44:26]     energy MAE     0.0006         0.0006          eV
[31.01|17:44:26]     forces MAE     0.0313         0.0527          eV/angstrom
[31.01|17:44:26]
[31.01|17:44:26] Starting active learning loop...
[31.01|17:44:26] ##########################
[31.01|17:44:26] ### Step 1 / Attempt 1 ###
[31.01|17:44:26] ##########################
[31.01|17:44:26] MD Steps: 10 (cumulative: 10)
[31.01|17:44:26] Current engine settings:
[31.01|17:44:26]
Engine MLPotential
  Backend M3GNet
  MLDistanceUnit angstrom
  MLEnergyUnit eV
  Model Custom
  ParameterDir /path/plams_workdir/sal/initial_training/results/optimization/m3gnet/m3gnet
EndEngine


[31.01|17:44:26]     Running step1_attempt1_simulation...
[31.01|17:44:37]     Job step1_attempt1_simulation finished
[31.01|17:44:37] Deleting files that are no longer needed...
[31.01|17:44:37] Launching reference calculation
[31.01|17:44:38]      Reference calculation finished!
[31.01|17:44:38] Checking success for step1_attempt1
[31.01|17:44:38]     CheckEnergy: Checking energy for MDStep10, n_atoms = 8
[31.01|17:44:38]     CheckEnergy: normalization coefficient = 8
[31.01|17:44:38]     CheckEnergy:                   Actual  Threshold
[31.01|17:44:38]     CheckEnergy: ΔE/8             -0.0180     0.2000 OK!
[31.01|17:44:38]
[31.01|17:44:38]     CheckForces: Comparing predicted forces to reference forces (eV/angstrom) on MD snapshot
[31.01|17:44:38]     CheckForces: ------------
[31.01|17:44:38]     CheckForces: Reference job from step1_attempt1_reference_calc1
[31.01|17:44:38]     CheckForces: Prediction job from final frame (MDStep10) of step1_attempt1_simulation
[31.01|17:44:38]     CheckForces: ------------
[31.01|17:44:38]     CheckForces: Histogram of forces
[31.01|17:44:38]     CheckForces: eV/Ang    Ref   Pred
[31.01|17:44:38]     CheckForces:     -3      1      0
[31.01|17:44:38]     CheckForces:     -2      3      1
[31.01|17:44:38]     CheckForces:     -1      9     11
[31.01|17:44:38]     CheckForces:      0      8     11
[31.01|17:44:38]     CheckForces:      1      2      1
[31.01|17:44:38]     CheckForces:      2      1      0
[31.01|17:44:38]     CheckForces: Threshold for 0 force: 0.50 eV/angstrom
[31.01|17:44:38]     CheckForces: Force components with an error exceeding the threshold:
[31.01|17:44:38]     CheckForces: Ref    Pred   Delta  Threshold
[31.01|17:44:38]     CheckForces:  -1.21  -0.50   0.71      0.57
[31.01|17:44:38]     CheckForces:   1.93   0.54   1.39      0.63
[31.01|17:44:38]     CheckForces:   0.98   0.20   0.78      0.55
[31.01|17:44:38]     CheckForces:  -1.85  -0.10   1.74      0.62
[31.01|17:44:38]     CheckForces:  -2.38  -0.78   1.60      0.68
[31.01|17:44:38]     CheckForces:  -0.84   0.09   0.93      0.54
[31.01|17:44:38]     CheckForces:   2.27   0.67   1.60      0.67
[31.01|17:44:38]     CheckForces:   0.13  -0.51   0.65      0.51
[31.01|17:44:38]     CheckForces: Maximum deviation: 1.742 eV/angstrom
[31.01|17:44:38]     CheckForces:          Actual   Threshold
[31.01|17:44:38]     CheckForces: # > thr.        8        0  Not OK!
[31.01|17:44:38]     CheckForces: MAE         0.543     0.30  Not OK!
[31.01|17:44:38]     CheckForces: R^2         0.592     0.80  Not OK!
[31.01|17:44:38]     CheckForces: --------------------
[31.01|17:44:38]
[31.01|17:44:38] Adding results from step1_attempt1_reference_calc1 to training set
[31.01|17:44:38]     Current # training set entries: 4
[31.01|17:44:38]     Current # validation set entries: 1
[31.01|17:44:38]     Storing data in step1_attempt1_reference_data
[31.01|17:44:38]     Deleting initial_reference_data
[31.01|17:44:38]     Deleting step1_attempt1_reference_calc1
[31.01|17:44:38]
[31.01|17:44:38] Current (cumulative) timings:
[31.01|17:44:38]                                           Time (s) Fraction
[31.01|17:44:38]     Ref. calcs                                2.04    0.033
[31.01|17:44:38]     ML training                              48.63    0.794
[31.01|17:44:38]     Simulations                              10.58    0.173
[31.01|17:44:38]
[31.01|17:44:38]
[31.01|17:44:38]
[31.01|17:44:38] --- Begin summary ---
[31.01|17:44:38] Step  Attempt Status   Reason      finalframe_forces_max_delta
[31.01|17:44:38]     1      1 FAILED   Inaccurate                  1.7423
[31.01|17:44:38] --- End summary ---
[31.01|17:44:38]
[31.01|17:44:38] Running more reference calculations....
[31.01|17:44:38]     Running reference calculations on frames [6] from step1_attempt1_simulation/ams.rkf
[31.01|17:44:38]     Calculating 1 frames in total
[31.01|17:44:38]     Running step1_attempt1_reference_calc2
[31.01|17:44:39]     Reference calculations finished!
[31.01|17:44:39] Adding results from step1_attempt1_reference_calc2 to validation set
[31.01|17:44:39]     Current # training set entries: 4
[31.01|17:44:39]     Current # validation set entries: 2
[31.01|17:44:39]     Storing data in step1_attempt1_reference_data
[31.01|17:44:39]     Deleting step1_attempt1_reference_calc2
[31.01|17:44:39] Launching reparametrization job: step1_attempt1_training
[31.01|17:44:40] JOB m3gnet STARTED
[31.01|17:44:40] Starting m3gnet.prerun()
[31.01|17:44:40] m3gnet.prerun() finished
[31.01|17:44:40] JOB m3gnet RUNNING
[31.01|17:44:40] Executing m3gnet.run
[31.01|17:45:05] training_set    Epoch:      0 Loss: 0.000565
[31.01|17:45:05] validation_set  Epoch:      0 Loss: 0.077548
[31.01|17:45:05] training_set    Epoch:     10 Loss: 0.001188
[31.01|17:45:05] validation_set  Epoch:     10 Loss: 0.012764
[31.01|17:45:06] training_set    Epoch:     20 Loss: 0.000858
[31.01|17:45:06] validation_set  Epoch:     20 Loss: 0.020567
[31.01|17:45:06] training_set    Epoch:     30 Loss: 0.000445
[31.01|17:45:06] validation_set  Epoch:     30 Loss: 0.014934
[31.01|17:45:07] training_set    Epoch:     40 Loss: 0.000296
[31.01|17:45:07] validation_set  Epoch:     40 Loss: 0.009303
[31.01|17:45:07] training_set    Epoch:     50 Loss: 0.000215
[31.01|17:45:07] validation_set  Epoch:     50 Loss: 0.007049
[31.01|17:45:08] training_set    Epoch:     60 Loss: 0.000145
[31.01|17:45:08] validation_set  Epoch:     60 Loss: 0.004677
[31.01|17:45:08] training_set    Epoch:     70 Loss: 0.000082
[31.01|17:45:08] validation_set  Epoch:     70 Loss: 0.001991
[31.01|17:45:09] training_set    Epoch:     80 Loss: 0.000051
[31.01|17:45:09] validation_set  Epoch:     80 Loss: 0.001933
[31.01|17:45:09] training_set    Epoch:     90 Loss: 0.000037
[31.01|17:45:09] validation_set  Epoch:     90 Loss: 0.001878
[31.01|17:45:10] training_set    Epoch:    100 Loss: 0.000031
[31.01|17:45:10] validation_set  Epoch:    100 Loss: 0.001710
[31.01|17:45:10] training_set    Epoch:    110 Loss: 0.000027
[31.01|17:45:10] validation_set  Epoch:    110 Loss: 0.001554
[31.01|17:45:11] training_set    Epoch:    120 Loss: 0.000025
[31.01|17:45:11] validation_set  Epoch:    120 Loss: 0.001411
[31.01|17:45:11] training_set    Epoch:    130 Loss: 0.000023
[31.01|17:45:11] validation_set  Epoch:    130 Loss: 0.001322
[31.01|17:45:12] training_set    Epoch:    140 Loss: 0.000022
[31.01|17:45:12] validation_set  Epoch:    140 Loss: 0.001259
[31.01|17:45:12] training_set    Epoch:    150 Loss: 0.000020
[31.01|17:45:12] validation_set  Epoch:    150 Loss: 0.001211
[31.01|17:45:13] training_set    Epoch:    160 Loss: 0.000019
[31.01|17:45:13] validation_set  Epoch:    160 Loss: 0.001169
[31.01|17:45:13] training_set    Epoch:    170 Loss: 0.000018
[31.01|17:45:13] validation_set  Epoch:    170 Loss: 0.001135
[31.01|17:45:14] training_set    Epoch:    180 Loss: 0.000017
[31.01|17:45:14] validation_set  Epoch:    180 Loss: 0.001105
[31.01|17:45:14] training_set    Epoch:    190 Loss: 0.000016
[31.01|17:45:14] validation_set  Epoch:    190 Loss: 0.001078
[31.01|17:45:16] Execution of m3gnet.run finished with returncode 0
[31.01|17:45:16] JOB m3gnet FINISHED
[31.01|17:45:16] Starting m3gnet.postrun()
[31.01|17:45:16] m3gnet.postrun() finished
[31.01|17:45:16] JOB m3gnet SUCCESSFUL
[31.01|17:45:27] Running all jobs through AMS....
[31.01|17:45:28] Storing results/optimization/training_set_results/latest
[31.01|17:45:28] Storing results/optimization/validation_set_results/latest
[31.01|17:45:28] PLAMS environment cleaned up successfully
[31.01|17:45:28] PLAMS run finished. Goodbye
[31.01|17:45:28]     ParAMSResults  training_set   validation_set
[31.01|17:45:28]     energy MAE     0.0042         0.0063          eV
[31.01|17:45:28]     forces MAE     0.0504         0.0809          eV/angstrom
[31.01|17:45:28]     Newly created parameter file/dir: step1_attempt1_training/results/optimization/m3gnet/m3gnet
[31.01|17:45:28]     Done!
[31.01|17:45:28]     Deleting initial_training
[31.01|17:45:28] ##########################
[31.01|17:45:28] ### Step 1 / Attempt 2 ###
[31.01|17:45:28] ##########################
[31.01|17:45:28] MD Steps: 10 (cumulative: 10)
[31.01|17:45:28] Current engine settings:
[31.01|17:45:28]
Engine MLPotential
  Backend M3GNet
  MLDistanceUnit angstrom
  MLEnergyUnit eV
  Model Custom
  ParameterDir /path/plams_workdir/sal/step1_attempt1_training/results/optimization/m3gnet/m3gnet
EndEngine


[31.01|17:45:28]     Running step1_attempt2_simulation...
[31.01|17:45:39]     Job step1_attempt2_simulation finished
[31.01|17:45:39] Deleting files that are no longer needed...
[31.01|17:45:39] Launching reference calculation
[31.01|17:45:40]      Reference calculation finished!
[31.01|17:45:40] Checking success for step1_attempt2
[31.01|17:45:50]     CheckEnergy: Checking energy for MDStep10, n_atoms = 8
[31.01|17:45:50]     CheckEnergy: normalization coefficient = 8
[31.01|17:45:50]     CheckEnergy:                   Actual  Threshold
[31.01|17:45:50]     CheckEnergy: ΔE/8             -0.0034     0.2000 OK!
[31.01|17:45:50]     CheckEnergy: ΔΔE/8            -0.0045     0.0050 OK!      (relative to step1_attempt1_simulation:MDStep10)
[31.01|17:45:50]
[31.01|17:45:50]     CheckForces: Comparing predicted forces to reference forces (eV/angstrom) on MD snapshot
[31.01|17:45:50]     CheckForces: ------------
[31.01|17:45:50]     CheckForces: Reference job from step1_attempt2_reference_calc1
[31.01|17:45:50]     CheckForces: Prediction job from final frame (MDStep10) of step1_attempt2_simulation
[31.01|17:45:50]     CheckForces: ------------
[31.01|17:45:50]     CheckForces: Histogram of forces
[31.01|17:45:50]     CheckForces: eV/Ang    Ref   Pred
[31.01|17:45:50]     CheckForces:     -2      1      0
[31.01|17:45:50]     CheckForces:     -1     13     15
[31.01|17:45:50]     CheckForces:      0      8      7
[31.01|17:45:50]     CheckForces:      1      2      2
[31.01|17:45:50]     CheckForces:      2      0      0
[31.01|17:45:50]     CheckForces: Threshold for 0 force: 0.50 eV/angstrom
[31.01|17:45:50]     CheckForces: All force components are within the acceptable error!
[31.01|17:45:50]     CheckForces: Maximum deviation: 0.573 eV/angstrom
[31.01|17:45:50]     CheckForces:          Actual   Threshold
[31.01|17:45:50]     CheckForces: # > thr.        0        0  OK!
[31.01|17:45:50]     CheckForces: MAE         0.157     0.30  OK!
[31.01|17:45:50]     CheckForces: R^2         0.929     0.80  OK!
[31.01|17:45:50]     CheckForces: --------------------
[31.01|17:45:50]
[31.01|17:45:50] Adding results from step1_attempt2_reference_calc1 to validation set
[31.01|17:45:50]     Current # training set entries: 4
[31.01|17:45:50]     Current # validation set entries: 3
[31.01|17:45:50]     Storing data in step1_attempt2_reference_data
[31.01|17:45:50]     Deleting step1_attempt1_reference_data
[31.01|17:45:50]     Deleting step1_attempt2_reference_calc1
[31.01|17:45:50]
[31.01|17:45:50] Current (cumulative) timings:
[31.01|17:45:50]                                           Time (s) Fraction
[31.01|17:45:50]     Ref. calcs                                3.86    0.031
[31.01|17:45:50]     ML training                              97.72    0.794
[31.01|17:45:50]     Simulations                              21.56    0.175
[31.01|17:45:50]
[31.01|17:45:50]
[31.01|17:45:50] Step 1 finished successfully!
[31.01|17:45:50]
[31.01|17:45:50] --- Begin summary ---
[31.01|17:45:50] Step  Attempt Status   Reason      finalframe_forces_max_delta
[31.01|17:45:50]     1      1 FAILED   Inaccurate                  1.7423
[31.01|17:45:50]     1      2 SUCCESS  Accurate                    0.5734
[31.01|17:45:50] --- End summary ---
[31.01|17:45:50]
[31.01|17:45:50] ##########################
[31.01|17:45:50] ### Step 2 / Attempt 1 ###
[31.01|17:45:50] ##########################
[31.01|17:45:50] MD Steps: 46 (cumulative: 56)
[31.01|17:45:50] Current engine settings:
[31.01|17:45:50]
Engine MLPotential
  Backend M3GNet
  MLDistanceUnit angstrom
  MLEnergyUnit eV
  Model Custom
  ParameterDir /path/plams_workdir/sal/step1_attempt1_training/results/optimization/m3gnet/m3gnet
EndEngine


[31.01|17:45:50]     Running step2_attempt1_simulation...
[31.01|17:46:01]     Job step2_attempt1_simulation finished
[31.01|17:46:01] Deleting files that are no longer needed...
[31.01|17:46:01]     Deleting step1_attempt1_simulation
[31.01|17:46:01] Launching reference calculation
[31.01|17:46:02]      Reference calculation finished!
[31.01|17:46:02] Checking success for step2_attempt1
[31.01|17:46:13]     CheckEnergy: Checking energy for MDStep56, n_atoms = 8
[31.01|17:46:13]     CheckEnergy: normalization coefficient = 8
[31.01|17:46:13]     CheckEnergy:                   Actual  Threshold
[31.01|17:46:13]     CheckEnergy: ΔE/8             -0.0163     0.2000 OK!
[31.01|17:46:13]     CheckEnergy: ΔΔE/8            -0.0129     0.0050 Not OK!  (relative to step1_attempt2_simulation:MDStep10)
[31.01|17:46:13]
[31.01|17:46:13]     CheckForces: Comparing predicted forces to reference forces (eV/angstrom) on MD snapshot
[31.01|17:46:13]     CheckForces: ------------
[31.01|17:46:13]     CheckForces: Reference job from step2_attempt1_reference_calc1
[31.01|17:46:13]     CheckForces: Prediction job from final frame (MDStep56) of step2_attempt1_simulation
[31.01|17:46:13]     CheckForces: ------------
[31.01|17:46:13]     CheckForces: Histogram of forces
[31.01|17:46:13]     CheckForces: eV/Ang    Ref   Pred
[31.01|17:46:13]     CheckForces:     -4      1      0
[31.01|17:46:13]     CheckForces:     -3      0      1
[31.01|17:46:13]     CheckForces:     -2      2      1
[31.01|17:46:13]     CheckForces:     -1     10      9
[31.01|17:46:13]     CheckForces:      0      7     10
[31.01|17:46:13]     CheckForces:      1      3      3
[31.01|17:46:13]     CheckForces:      2      1      0
[31.01|17:46:13]     CheckForces: Threshold for 0 force: 0.50 eV/angstrom
[31.01|17:46:13]     CheckForces: Force components with an error exceeding the threshold:
[31.01|17:46:13]     CheckForces: Ref    Pred   Delta  Threshold
[31.01|17:46:13]     CheckForces:   2.25   1.18   1.07      0.67
[31.01|17:46:13]     CheckForces:  -0.94  -0.37   0.57      0.55
[31.01|17:46:13]     CheckForces: Maximum deviation: 1.068 eV/angstrom
[31.01|17:46:13]     CheckForces:          Actual   Threshold
[31.01|17:46:13]     CheckForces: # > thr.        2        0  Not OK!
[31.01|17:46:13]     CheckForces: MAE         0.279     0.30  OK!
[31.01|17:46:13]     CheckForces: R^2         0.933     0.80  OK!
[31.01|17:46:13]     CheckForces: --------------------
[31.01|17:46:13]
[31.01|17:46:13] Adding results from step2_attempt1_reference_calc1 to training set
[31.01|17:46:13]     Current # training set entries: 5
[31.01|17:46:13]     Current # validation set entries: 3
[31.01|17:46:13]     Storing data in step2_attempt1_reference_data
[31.01|17:46:13]     Deleting step1_attempt2_reference_data
[31.01|17:46:13]     Deleting step2_attempt1_reference_calc1
[31.01|17:46:13]
[31.01|17:46:13] Current (cumulative) timings:
[31.01|17:46:13]                                           Time (s) Fraction
[31.01|17:46:13]     Ref. calcs                                4.64    0.034
[31.01|17:46:13]     ML training                              97.72    0.725
[31.01|17:46:13]     Simulations                              32.51    0.241
[31.01|17:46:13]
[31.01|17:46:13]
[31.01|17:46:13]
[31.01|17:46:13] --- Begin summary ---
[31.01|17:46:13] Step  Attempt Status   Reason      finalframe_forces_max_delta
[31.01|17:46:13]     1      1 FAILED   Inaccurate                  1.7423
[31.01|17:46:13]     1      2 SUCCESS  Accurate                    0.5734
[31.01|17:46:13]     2      1 FAILED   Inaccurate                  1.0679
[31.01|17:46:13] --- End summary ---
[31.01|17:46:13]
[31.01|17:46:13] Running more reference calculations....
[31.01|17:46:13]     Running reference calculations on frames [17] from step2_attempt1_simulation/ams.rkf
[31.01|17:46:13]     Calculating 1 frames in total
[31.01|17:46:13]     Running step2_attempt1_reference_calc2
[31.01|17:46:13]     Reference calculations finished!
[31.01|17:46:14] Adding results from step2_attempt1_reference_calc2 to validation set
[31.01|17:46:14]     Current # training set entries: 5
[31.01|17:46:14]     Current # validation set entries: 4
[31.01|17:46:14]     Storing data in step2_attempt1_reference_data
[31.01|17:46:14]     Deleting step2_attempt1_reference_calc2
[31.01|17:46:14] Launching reparametrization job: step2_attempt1_training
[31.01|17:46:15] JOB m3gnet STARTED
[31.01|17:46:15] Starting m3gnet.prerun()
[31.01|17:46:15] m3gnet.prerun() finished
[31.01|17:46:15] JOB m3gnet RUNNING
[31.01|17:46:15] Executing m3gnet.run
[31.01|17:46:39] training_set    Epoch:      0 Loss: 0.000139
[31.01|17:46:39] validation_set  Epoch:      0 Loss: 0.070191
[31.01|17:46:40] training_set    Epoch:     10 Loss: 0.000339
[31.01|17:46:40] validation_set  Epoch:     10 Loss: 0.011495
[31.01|17:46:40] training_set    Epoch:     20 Loss: 0.000375
[31.01|17:46:40] validation_set  Epoch:     20 Loss: 0.009220
[31.01|17:46:41] training_set    Epoch:     30 Loss: 0.000277
[31.01|17:46:41] validation_set  Epoch:     30 Loss: 0.010914
[31.01|17:46:41] training_set    Epoch:     40 Loss: 0.000153
[31.01|17:46:41] validation_set  Epoch:     40 Loss: 0.009465
[31.01|17:46:42] training_set    Epoch:     50 Loss: 0.000098
[31.01|17:46:42] validation_set  Epoch:     50 Loss: 0.007721
[31.01|17:46:42] training_set    Epoch:     60 Loss: 0.000070
[31.01|17:46:42] validation_set  Epoch:     60 Loss: 0.006123
[31.01|17:46:43] training_set    Epoch:     70 Loss: 0.000056
[31.01|17:46:43] validation_set  Epoch:     70 Loss: 0.006239
[31.01|17:46:43] training_set    Epoch:     80 Loss: 0.000051
[31.01|17:46:43] validation_set  Epoch:     80 Loss: 0.006012
[31.01|17:46:44] training_set    Epoch:     90 Loss: 0.000043
[31.01|17:46:44] validation_set  Epoch:     90 Loss: 0.005937
[31.01|17:46:44] training_set    Epoch:    100 Loss: 0.000038
[31.01|17:46:44] validation_set  Epoch:    100 Loss: 0.005861
[31.01|17:46:45] training_set    Epoch:    110 Loss: 0.000034
[31.01|17:46:45] validation_set  Epoch:    110 Loss: 0.005772
[31.01|17:46:45] training_set    Epoch:    120 Loss: 0.000030
[31.01|17:46:45] validation_set  Epoch:    120 Loss: 0.005683
[31.01|17:46:46] training_set    Epoch:    130 Loss: 0.000026
[31.01|17:46:46] validation_set  Epoch:    130 Loss: 0.005601
[31.01|17:46:46] training_set    Epoch:    140 Loss: 0.000023
[31.01|17:46:46] validation_set  Epoch:    140 Loss: 0.005525
[31.01|17:46:47] training_set    Epoch:    150 Loss: 0.000021
[31.01|17:46:47] validation_set  Epoch:    150 Loss: 0.005458
[31.01|17:46:47] training_set    Epoch:    160 Loss: 0.000019
[31.01|17:46:47] validation_set  Epoch:    160 Loss: 0.005396
[31.01|17:46:48] training_set    Epoch:    170 Loss: 0.000017
[31.01|17:46:48] validation_set  Epoch:    170 Loss: 0.005336
[31.01|17:46:48] training_set    Epoch:    180 Loss: 0.000015
[31.01|17:46:48] validation_set  Epoch:    180 Loss: 0.005280
[31.01|17:46:49] training_set    Epoch:    190 Loss: 0.000014
[31.01|17:46:49] validation_set  Epoch:    190 Loss: 0.005225
[31.01|17:46:50] Execution of m3gnet.run finished with returncode 0
[31.01|17:46:50] JOB m3gnet FINISHED
[31.01|17:46:50] Starting m3gnet.postrun()
[31.01|17:46:50] m3gnet.postrun() finished
[31.01|17:46:50] JOB m3gnet SUCCESSFUL
[31.01|17:47:01] Running all jobs through AMS....
[31.01|17:47:01] Storing results/optimization/training_set_results/latest
[31.01|17:47:01] Storing results/optimization/validation_set_results/latest
[31.01|17:47:01] PLAMS environment cleaned up successfully
[31.01|17:47:01] PLAMS run finished. Goodbye
[31.01|17:47:01]     ParAMSResults  training_set   validation_set
[31.01|17:47:01]     energy MAE     0.0067         0.0376          eV
[31.01|17:47:01]     forces MAE     0.0468         0.1445          eV/angstrom
[31.01|17:47:01]     Newly created parameter file/dir: step2_attempt1_training/results/optimization/m3gnet/m3gnet
[31.01|17:47:01]     Done!
[31.01|17:47:01]     Deleting step1_attempt1_training
[31.01|17:47:01] ##########################
[31.01|17:47:01] ### Step 2 / Attempt 2 ###
[31.01|17:47:01] ##########################
[31.01|17:47:01] MD Steps: 46 (cumulative: 56)
[31.01|17:47:01] Current engine settings:
[31.01|17:47:01]
Engine MLPotential
  Backend M3GNet
  MLDistanceUnit angstrom
  MLEnergyUnit eV
  Model Custom
  ParameterDir /path/plams_workdir/sal/step2_attempt1_training/results/optimization/m3gnet/m3gnet
EndEngine


[31.01|17:47:01]     Running step2_attempt2_simulation...
[31.01|17:47:13]     Job step2_attempt2_simulation finished
[31.01|17:47:13] Deleting files that are no longer needed...
[31.01|17:47:13] Launching reference calculation
[31.01|17:47:14]      Reference calculation finished!
[31.01|17:47:14] Checking success for step2_attempt2
[31.01|17:47:25]     CheckEnergy: Checking energy for MDStep56, n_atoms = 8
[31.01|17:47:25]     CheckEnergy: normalization coefficient = 8
[31.01|17:47:25]     CheckEnergy:                   Actual  Threshold
[31.01|17:47:25]     CheckEnergy: ΔE/8              0.0012     0.2000 OK!
[31.01|17:47:25]     CheckEnergy: ΔΔE/8             0.0017     0.0050 OK!      (relative to step2_attempt1_simulation:MDStep56)
[31.01|17:47:25]
[31.01|17:47:25]     CheckForces: Comparing predicted forces to reference forces (eV/angstrom) on MD snapshot
[31.01|17:47:25]     CheckForces: ------------
[31.01|17:47:25]     CheckForces: Reference job from step2_attempt2_reference_calc1
[31.01|17:47:25]     CheckForces: Prediction job from final frame (MDStep56) of step2_attempt2_simulation
[31.01|17:47:25]     CheckForces: ------------
[31.01|17:47:25]     CheckForces: Histogram of forces
[31.01|17:47:25]     CheckForces: eV/Ang    Ref   Pred
[31.01|17:47:25]     CheckForces:     -4      0      0
[31.01|17:47:25]     CheckForces:     -3      1      1
[31.01|17:47:25]     CheckForces:     -2      1      1
[31.01|17:47:25]     CheckForces:     -1     10     11
[31.01|17:47:25]     CheckForces:      0      9      8
[31.01|17:47:25]     CheckForces:      1      2      3
[31.01|17:47:25]     CheckForces:      2      1      0
[31.01|17:47:25]     CheckForces: Threshold for 0 force: 0.50 eV/angstrom
[31.01|17:47:25]     CheckForces: All force components are within the acceptable error!
[31.01|17:47:25]     CheckForces: Maximum deviation: 0.392 eV/angstrom
[31.01|17:47:25]     CheckForces:          Actual   Threshold
[31.01|17:47:25]     CheckForces: # > thr.        0        0  OK!
[31.01|17:47:25]     CheckForces: MAE         0.104     0.30  OK!
[31.01|17:47:25]     CheckForces: R^2         0.980     0.80  OK!
[31.01|17:47:25]     CheckForces: --------------------
[31.01|17:47:25]
[31.01|17:47:25] Adding results from step2_attempt2_reference_calc1 to training set
[31.01|17:47:25]     Current # training set entries: 6
[31.01|17:47:25]     Current # validation set entries: 4
[31.01|17:47:25]     Storing data in step2_attempt2_reference_data
[31.01|17:47:25]     Deleting step2_attempt1_reference_data
[31.01|17:47:25]     Deleting step2_attempt2_reference_calc1
[31.01|17:47:25]
[31.01|17:47:25] Current (cumulative) timings:
[31.01|17:47:25]                                           Time (s) Fraction
[31.01|17:47:25]     Ref. calcs                                7.06    0.036
[31.01|17:47:25]     ML training                             145.41    0.740
[31.01|17:47:25]     Simulations                              44.08    0.224
[31.01|17:47:25]
[31.01|17:47:25]
[31.01|17:47:25] Step 2 finished successfully!
[31.01|17:47:25]
[31.01|17:47:25] --- Begin summary ---
[31.01|17:47:25] Step  Attempt Status   Reason      finalframe_forces_max_delta
[31.01|17:47:25]     1      1 FAILED   Inaccurate                  1.7423
[31.01|17:47:25]     1      2 SUCCESS  Accurate                    0.5734
[31.01|17:47:25]     2      1 FAILED   Inaccurate                  1.0679
[31.01|17:47:25]     2      2 SUCCESS  Accurate                    0.3920
[31.01|17:47:25] --- End summary ---
[31.01|17:47:25]
[31.01|17:47:25] ##########################
[31.01|17:47:25] ### Step 3 / Attempt 1 ###
[31.01|17:47:25] ##########################
[31.01|17:47:25] MD Steps: 260 (cumulative: 316)
[31.01|17:47:25] Current engine settings:
[31.01|17:47:25]
Engine MLPotential
  Backend M3GNet
  MLDistanceUnit angstrom
  MLEnergyUnit eV
  Model Custom
  ParameterDir /path/plams_workdir/sal/step2_attempt1_training/results/optimization/m3gnet/m3gnet
EndEngine


[31.01|17:47:25]     Running step3_attempt1_simulation...
[31.01|17:47:39]     Job step3_attempt1_simulation finished
[31.01|17:47:39] Deleting files that are no longer needed...
[31.01|17:47:39]     Deleting step1_attempt2_simulation
[31.01|17:47:39]     Deleting step2_attempt1_simulation
[31.01|17:47:39] Launching reference calculation
[31.01|17:47:40]      Reference calculation finished!
[31.01|17:47:40] Checking success for step3_attempt1
[31.01|17:47:50]     CheckEnergy: Checking energy for MDStep316, n_atoms = 8
[31.01|17:47:50]     CheckEnergy: normalization coefficient = 8
[31.01|17:47:50]     CheckEnergy:                   Actual  Threshold
[31.01|17:47:50]     CheckEnergy: ΔE/8              0.0014     0.2000 OK!
[31.01|17:47:50]     CheckEnergy: ΔΔE/8             0.0002     0.0050 OK!      (relative to step2_attempt2_simulation:MDStep56)
[31.01|17:47:50]
[31.01|17:47:50]     CheckForces: Comparing predicted forces to reference forces (eV/angstrom) on MD snapshot
[31.01|17:47:50]     CheckForces: ------------
[31.01|17:47:50]     CheckForces: Reference job from step3_attempt1_reference_calc1
[31.01|17:47:50]     CheckForces: Prediction job from final frame (MDStep316) of step3_attempt1_simulation
[31.01|17:47:50]     CheckForces: ------------
[31.01|17:47:50]     CheckForces: Histogram of forces
[31.01|17:47:50]     CheckForces: eV/Ang    Ref   Pred
[31.01|17:47:50]     CheckForces:     -3      0      0
[31.01|17:47:50]     CheckForces:     -2      2      1
[31.01|17:47:50]     CheckForces:     -1      8     10
[31.01|17:47:50]     CheckForces:      0     13     11
[31.01|17:47:50]     CheckForces:      1      1      2
[31.01|17:47:50]     CheckForces: Threshold for 0 force: 0.50 eV/angstrom
[31.01|17:47:50]     CheckForces: Force components with an error exceeding the threshold:
[31.01|17:47:50]     CheckForces: Ref    Pred   Delta  Threshold
[31.01|17:47:50]     CheckForces:   0.14   1.11   0.98      0.51
[31.01|17:47:50]     CheckForces: Maximum deviation: 0.976 eV/angstrom
[31.01|17:47:50]     CheckForces:          Actual   Threshold
[31.01|17:47:50]     CheckForces: # > thr.        1        0  Not OK!
[31.01|17:47:50]     CheckForces: MAE         0.171     0.30  OK!
[31.01|17:47:50]     CheckForces: R^2         0.856     0.80  OK!
[31.01|17:47:50]     CheckForces: --------------------
[31.01|17:47:50]
[31.01|17:47:50] Adding results from step3_attempt1_reference_calc1 to training set
[31.01|17:47:50]     Current # training set entries: 7
[31.01|17:47:50]     Current # validation set entries: 4
[31.01|17:47:50]     Storing data in step3_attempt1_reference_data
[31.01|17:47:50]     Deleting step2_attempt2_reference_data
[31.01|17:47:50]     Deleting step3_attempt1_reference_calc1
[31.01|17:47:50]
[31.01|17:47:50] Current (cumulative) timings:
[31.01|17:47:50]                                           Time (s) Fraction
[31.01|17:47:50]     Ref. calcs                                7.84    0.037
[31.01|17:47:50]     ML training                             145.41    0.690
[31.01|17:47:50]     Simulations                              57.37    0.272
[31.01|17:47:50]
[31.01|17:47:50]
[31.01|17:47:51]
[31.01|17:47:51] --- Begin summary ---
[31.01|17:47:51] Step  Attempt Status   Reason      finalframe_forces_max_delta
[31.01|17:47:51]     1      1 FAILED   Inaccurate                  1.7423
[31.01|17:47:51]     1      2 SUCCESS  Accurate                    0.5734
[31.01|17:47:51]     2      1 FAILED   Inaccurate                  1.0679
[31.01|17:47:51]     2      2 SUCCESS  Accurate                    0.3920
[31.01|17:47:51]     3      1 FAILED   Inaccurate                  0.9762
[31.01|17:47:51] --- End summary ---
[31.01|17:47:51]
[31.01|17:47:51] Running more reference calculations....
[31.01|17:47:51]     Running reference calculations on frames [26, 28, 30] from step3_attempt1_simulation/ams.rkf
[31.01|17:47:51]     Calculating 3 frames in total
[31.01|17:47:51]     Running step3_attempt1_reference_calc2
[31.01|17:47:51]     Running step3_attempt1_reference_calc3
[31.01|17:47:52]     Running step3_attempt1_reference_calc4
[31.01|17:47:53]     Reference calculations finished!
[31.01|17:47:53] Adding results from step3_attempt1_reference_calc2 to validation set
[31.01|17:47:53] Adding results from step3_attempt1_reference_calc3 to training set
[31.01|17:47:53] Adding results from step3_attempt1_reference_calc4 to training set
[31.01|17:47:53]     Current # training set entries: 9
[31.01|17:47:53]     Current # validation set entries: 5
[31.01|17:47:53]     Storing data in step3_attempt1_reference_data
[31.01|17:47:53]     Deleting step3_attempt1_reference_calc2
[31.01|17:47:53]     Deleting step3_attempt1_reference_calc3
[31.01|17:47:53]     Deleting step3_attempt1_reference_calc4
[31.01|17:47:53] Launching reparametrization job: step3_attempt1_training
[31.01|17:47:54] JOB m3gnet STARTED
[31.01|17:47:54] Starting m3gnet.prerun()
[31.01|17:47:54] m3gnet.prerun() finished
[31.01|17:47:54] JOB m3gnet RUNNING
[31.01|17:47:54] Executing m3gnet.run
[31.01|17:48:39] training_set    Epoch:      0 Loss: 0.003587
[31.01|17:48:39] validation_set  Epoch:      0 Loss: 0.009850
[31.01|17:48:40] training_set    Epoch:     10 Loss: 0.000570
[31.01|17:48:40] validation_set  Epoch:     10 Loss: 0.010250
[31.01|17:48:41] training_set    Epoch:     20 Loss: 0.000092
[31.01|17:48:41] validation_set  Epoch:     20 Loss: 0.006772
[31.01|17:48:41] training_set    Epoch:     30 Loss: 0.000063
[31.01|17:48:41] validation_set  Epoch:     30 Loss: 0.005755
[31.01|17:48:42] training_set    Epoch:     40 Loss: 0.000053
[31.01|17:48:42] validation_set  Epoch:     40 Loss: 0.005245
[31.01|17:48:43] training_set    Epoch:     50 Loss: 0.000044
[31.01|17:48:43] validation_set  Epoch:     50 Loss: 0.005616
[31.01|17:48:44] training_set    Epoch:     60 Loss: 0.000041
[31.01|17:48:44] validation_set  Epoch:     60 Loss: 0.005354
[31.01|17:48:45] training_set    Epoch:     70 Loss: 0.000035
[31.01|17:48:45] validation_set  Epoch:     70 Loss: 0.005564
[31.01|17:48:45] training_set    Epoch:     80 Loss: 0.000032
[31.01|17:48:45] validation_set  Epoch:     80 Loss: 0.004750
[31.01|17:48:46] training_set    Epoch:     90 Loss: 0.000030
[31.01|17:48:46] validation_set  Epoch:     90 Loss: 0.004704
[31.01|17:48:47] training_set    Epoch:    100 Loss: 0.000028
[31.01|17:48:47] validation_set  Epoch:    100 Loss: 0.003894
[31.01|17:48:48] training_set    Epoch:    110 Loss: 0.000025
[31.01|17:48:48] validation_set  Epoch:    110 Loss: 0.004790
[31.01|17:48:49] training_set    Epoch:    120 Loss: 0.000022
[31.01|17:48:49] validation_set  Epoch:    120 Loss: 0.003588
[31.01|17:48:50] training_set    Epoch:    130 Loss: 0.000022
[31.01|17:48:50] validation_set  Epoch:    130 Loss: 0.004835
[31.01|17:48:50] training_set    Epoch:    140 Loss: 0.000018
[31.01|17:48:50] validation_set  Epoch:    140 Loss: 0.003450
[31.01|17:48:51] training_set    Epoch:    150 Loss: 0.000018
[31.01|17:48:51] validation_set  Epoch:    150 Loss: 0.003629
[31.01|17:48:52] training_set    Epoch:    160 Loss: 0.000016
[31.01|17:48:52] validation_set  Epoch:    160 Loss: 0.003157
[31.01|17:48:53] training_set    Epoch:    170 Loss: 0.000016
[31.01|17:48:53] validation_set  Epoch:    170 Loss: 0.003054
[31.01|17:48:54] training_set    Epoch:    180 Loss: 0.000021
[31.01|17:48:54] validation_set  Epoch:    180 Loss: 0.003291
[31.01|17:48:55] training_set    Epoch:    190 Loss: 0.000015
[31.01|17:48:55] validation_set  Epoch:    190 Loss: 0.004234
[31.01|17:48:57] Execution of m3gnet.run finished with returncode 0
[31.01|17:48:57] JOB m3gnet FINISHED
[31.01|17:48:57] Starting m3gnet.postrun()
[31.01|17:48:57] m3gnet.postrun() finished
[31.01|17:48:57] JOB m3gnet SUCCESSFUL
[31.01|17:49:08] Running all jobs through AMS....
[31.01|17:49:08] Storing results/optimization/training_set_results/latest
[31.01|17:49:08] Storing results/optimization/validation_set_results/latest
[31.01|17:49:08] PLAMS environment cleaned up successfully
[31.01|17:49:08] PLAMS run finished. Goodbye
[31.01|17:49:08]     ParAMSResults  training_set   validation_set
[31.01|17:49:08]     energy MAE     0.0069         0.0241          eV
[31.01|17:49:08]     forces MAE     0.0433         0.1210          eV/angstrom
[31.01|17:49:08]     Newly created parameter file/dir: step3_attempt1_training/results/optimization/m3gnet/m3gnet
[31.01|17:49:08]     Done!
[31.01|17:49:08]     Deleting step2_attempt1_training
[31.01|17:49:08] ##########################
[31.01|17:49:08] ### Step 3 / Attempt 2 ###
[31.01|17:49:08] ##########################
[31.01|17:49:08] MD Steps: 260 (cumulative: 316)
[31.01|17:49:08] Current engine settings:
[31.01|17:49:08]
Engine MLPotential
  Backend M3GNet
  MLDistanceUnit angstrom
  MLEnergyUnit eV
  Model Custom
  ParameterDir /path/plams_workdir/sal/step3_attempt1_training/results/optimization/m3gnet/m3gnet
EndEngine


[31.01|17:49:08]     Running step3_attempt2_simulation...
[31.01|17:49:22]     Job step3_attempt2_simulation finished
[31.01|17:49:22] Deleting files that are no longer needed...
[31.01|17:49:22] Launching reference calculation
[31.01|17:49:23]      Reference calculation finished!
[31.01|17:49:23] Checking success for step3_attempt2
[31.01|17:49:34]     CheckEnergy: Checking energy for MDStep316, n_atoms = 8
[31.01|17:49:34]     CheckEnergy: normalization coefficient = 8
[31.01|17:49:34]     CheckEnergy:                   Actual  Threshold
[31.01|17:49:34]     CheckEnergy: ΔE/8             -0.0065     0.2000 OK!
[31.01|17:49:34]     CheckEnergy: ΔΔE/8            -0.0059     0.0050 Not OK!  (relative to step3_attempt1_simulation:MDStep316)
[31.01|17:49:34]
[31.01|17:49:34]     CheckForces: Comparing predicted forces to reference forces (eV/angstrom) on MD snapshot
[31.01|17:49:34]     CheckForces: ------------
[31.01|17:49:34]     CheckForces: Reference job from step3_attempt2_reference_calc1
[31.01|17:49:34]     CheckForces: Prediction job from final frame (MDStep316) of step3_attempt2_simulation
[31.01|17:49:34]     CheckForces: ------------
[31.01|17:49:34]     CheckForces: Histogram of forces
[31.01|17:49:34]     CheckForces: eV/Ang    Ref   Pred
[31.01|17:49:34]     CheckForces:     -4      0      0
[31.01|17:49:34]     CheckForces:     -3      1      1
[31.01|17:49:34]     CheckForces:     -2      2      2
[31.01|17:49:34]     CheckForces:     -1      9      9
[31.01|17:49:34]     CheckForces:      0     10      9
[31.01|17:49:34]     CheckForces:      1      1      3
[31.01|17:49:34]     CheckForces:      2      1      0
[31.01|17:49:34]     CheckForces: Threshold for 0 force: 0.50 eV/angstrom
[31.01|17:49:34]     CheckForces: Force components with an error exceeding the threshold:
[31.01|17:49:34]     CheckForces: Ref    Pred   Delta  Threshold
[31.01|17:49:34]     CheckForces:   2.31   1.56   0.76      0.67
[31.01|17:49:34]     CheckForces: Maximum deviation: 0.756 eV/angstrom
[31.01|17:49:34]     CheckForces:          Actual   Threshold
[31.01|17:49:34]     CheckForces: # > thr.        1        0  Not OK!
[31.01|17:49:34]     CheckForces: MAE         0.177     0.30  OK!
[31.01|17:49:34]     CheckForces: R^2         0.969     0.80  OK!
[31.01|17:49:34]     CheckForces: --------------------
[31.01|17:49:34]
[31.01|17:49:34] Adding results from step3_attempt2_reference_calc1 to training set
[31.01|17:49:34]     Current # training set entries: 10
[31.01|17:49:34]     Current # validation set entries: 5
[31.01|17:49:34]     Storing data in step3_attempt2_reference_data
[31.01|17:49:34]     Deleting step3_attempt1_reference_data
[31.01|17:49:34]     Deleting step3_attempt2_reference_calc1
[31.01|17:49:34]
[31.01|17:49:34] Current (cumulative) timings:
[31.01|17:49:34]                                           Time (s) Fraction
[31.01|17:49:34]     Ref. calcs                               11.64    0.038
[31.01|17:49:34]     ML training                             220.84    0.728
[31.01|17:49:34]     Simulations                              70.76    0.233
[31.01|17:49:34]
[31.01|17:49:34]
[31.01|17:49:34]
[31.01|17:49:34] --- Begin summary ---
[31.01|17:49:34] Step  Attempt Status   Reason      finalframe_forces_max_delta
[31.01|17:49:34]     1      1 FAILED   Inaccurate                  1.7423
[31.01|17:49:34]     1      2 SUCCESS  Accurate                    0.5734
[31.01|17:49:34]     2      1 FAILED   Inaccurate                  1.0679
[31.01|17:49:34]     2      2 SUCCESS  Accurate                    0.3920
[31.01|17:49:34]     3      1 FAILED   Inaccurate                  0.9762
[31.01|17:49:34]     3      2 FAILED   Inaccurate                  0.7560
[31.01|17:49:34] --- End summary ---
[31.01|17:49:34]
[31.01|17:49:34] Running more reference calculations....
[31.01|17:49:34]     Running reference calculations on frames [26, 28, 30] from step3_attempt2_simulation/ams.rkf
[31.01|17:49:34]     Calculating 3 frames in total
[31.01|17:49:34]     Running step3_attempt2_reference_calc2
[31.01|17:49:35]     Running step3_attempt2_reference_calc3
[31.01|17:49:36]     Running step3_attempt2_reference_calc4
[31.01|17:49:36]     Reference calculations finished!
[31.01|17:49:36] Adding results from step3_attempt2_reference_calc2 to validation set
[31.01|17:49:36] Adding results from step3_attempt2_reference_calc3 to training set
[31.01|17:49:36] Adding results from step3_attempt2_reference_calc4 to training set
[31.01|17:49:36]     Current # training set entries: 12
[31.01|17:49:36]     Current # validation set entries: 6
[31.01|17:49:36]     Storing data in step3_attempt2_reference_data
[31.01|17:49:36]     Deleting step3_attempt2_reference_calc2
[31.01|17:49:36]     Deleting step3_attempt2_reference_calc3
[31.01|17:49:36]     Deleting step3_attempt2_reference_calc4
[31.01|17:49:36] Launching reparametrization job: step3_attempt2_training
[31.01|17:49:38] JOB m3gnet STARTED
[31.01|17:49:38] Starting m3gnet.prerun()
[31.01|17:49:38] m3gnet.prerun() finished
[31.01|17:49:38] JOB m3gnet RUNNING
[31.01|17:49:38] Executing m3gnet.run
[31.01|17:50:24] training_set    Epoch:      0 Loss: 0.002272
[31.01|17:50:24] validation_set  Epoch:      0 Loss: 0.056426
[31.01|17:50:25] training_set    Epoch:     10 Loss: 0.000177
[31.01|17:50:25] validation_set  Epoch:     10 Loss: 0.007855
[31.01|17:50:27] training_set    Epoch:     20 Loss: 0.000050
[31.01|17:50:27] validation_set  Epoch:     20 Loss: 0.002337
[31.01|17:50:28] training_set    Epoch:     30 Loss: 0.000040
[31.01|17:50:28] validation_set  Epoch:     30 Loss: 0.003837
[31.01|17:50:29] training_set    Epoch:     40 Loss: 0.000031
[31.01|17:50:29] validation_set  Epoch:     40 Loss: 0.003990
[31.01|17:50:30] training_set    Epoch:     50 Loss: 0.000025
[31.01|17:50:30] validation_set  Epoch:     50 Loss: 0.002706
[31.01|17:50:31] training_set    Epoch:     60 Loss: 0.000031
[31.01|17:50:31] validation_set  Epoch:     60 Loss: 0.002047
[31.01|17:50:32] training_set    Epoch:     70 Loss: 0.000022
[31.01|17:50:32] validation_set  Epoch:     70 Loss: 0.003074
[31.01|17:50:34] training_set    Epoch:     80 Loss: 0.000023
[31.01|17:50:34] validation_set  Epoch:     80 Loss: 0.001971
[31.01|17:50:35] training_set    Epoch:     90 Loss: 0.000016
[31.01|17:50:35] validation_set  Epoch:     90 Loss: 0.001933
[31.01|17:50:36] training_set    Epoch:    100 Loss: 0.000018
[31.01|17:50:36] validation_set  Epoch:    100 Loss: 0.002079
[31.01|17:50:37] training_set    Epoch:    110 Loss: 0.000016
[31.01|17:50:37] validation_set  Epoch:    110 Loss: 0.002864
[31.01|17:50:38] training_set    Epoch:    120 Loss: 0.000016
[31.01|17:50:38] validation_set  Epoch:    120 Loss: 0.001923
[31.01|17:50:39] training_set    Epoch:    130 Loss: 0.000018
[31.01|17:50:39] validation_set  Epoch:    130 Loss: 0.002417
[31.01|17:50:41] training_set    Epoch:    140 Loss: 0.000014
[31.01|17:50:41] validation_set  Epoch:    140 Loss: 0.002699
[31.01|17:50:42] training_set    Epoch:    150 Loss: 0.000016
[31.01|17:50:42] validation_set  Epoch:    150 Loss: 0.002029
[31.01|17:50:43] training_set    Epoch:    160 Loss: 0.000012
[31.01|17:50:43] validation_set  Epoch:    160 Loss: 0.001256
[31.01|17:50:44] training_set    Epoch:    170 Loss: 0.000011
[31.01|17:50:44] validation_set  Epoch:    170 Loss: 0.001377
[31.01|17:50:45] training_set    Epoch:    180 Loss: 0.000016
[31.01|17:50:45] validation_set  Epoch:    180 Loss: 0.003710
[31.01|17:50:46] training_set    Epoch:    190 Loss: 0.000010
[31.01|17:50:46] validation_set  Epoch:    190 Loss: 0.003736
[31.01|17:50:49] Execution of m3gnet.run finished with returncode 0
[31.01|17:50:49] JOB m3gnet FINISHED
[31.01|17:50:49] Starting m3gnet.postrun()
[31.01|17:50:49] m3gnet.postrun() finished
[31.01|17:50:49] JOB m3gnet SUCCESSFUL
[31.01|17:51:00] Running all jobs through AMS....
[31.01|17:51:00] Storing results/optimization/training_set_results/latest
[31.01|17:51:00] Storing results/optimization/validation_set_results/latest
[31.01|17:51:00] PLAMS environment cleaned up successfully
[31.01|17:51:00] PLAMS run finished. Goodbye
[31.01|17:51:01]     ParAMSResults  training_set   validation_set
[31.01|17:51:01]     energy MAE     0.0095         0.0107          eV
[31.01|17:51:01]     forces MAE     0.0399         0.1005          eV/angstrom
[31.01|17:51:01]     Newly created parameter file/dir: step3_attempt2_training/results/optimization/m3gnet/m3gnet
[31.01|17:51:01]     Done!
[31.01|17:51:01]     Deleting step3_attempt1_training
[31.01|17:51:01] ##########################
[31.01|17:51:01] ### Step 3 / Attempt 3 ###
[31.01|17:51:01] ##########################
[31.01|17:51:01] MD Steps: 260 (cumulative: 316)
[31.01|17:51:01] Current engine settings:
[31.01|17:51:01]
Engine MLPotential
  Backend M3GNet
  MLDistanceUnit angstrom
  MLEnergyUnit eV
  Model Custom
  ParameterDir /path/plams_workdir/sal/step3_attempt2_training/results/optimization/m3gnet/m3gnet
EndEngine


[31.01|17:51:01]     Running step3_attempt3_simulation...
[31.01|17:51:14]     Job step3_attempt3_simulation finished
[31.01|17:51:14] Deleting files that are no longer needed...
[31.01|17:51:14] Launching reference calculation
[31.01|17:51:16]      Reference calculation finished!
[31.01|17:51:16] Checking success for step3_attempt3
[31.01|17:51:28]     CheckEnergy: Checking energy for MDStep316, n_atoms = 8
[31.01|17:51:28]     CheckEnergy: normalization coefficient = 8
[31.01|17:51:28]     CheckEnergy:                   Actual  Threshold
[31.01|17:51:28]     CheckEnergy: ΔE/8             -0.0014     0.2000 OK!
[31.01|17:51:28]     CheckEnergy: ΔΔE/8            -0.0005     0.0050 OK!      (relative to step3_attempt2_simulation:MDStep316)
[31.01|17:51:28]
[31.01|17:51:28]     CheckForces: Comparing predicted forces to reference forces (eV/angstrom) on MD snapshot
[31.01|17:51:28]     CheckForces: ------------
[31.01|17:51:28]     CheckForces: Reference job from step3_attempt3_reference_calc1
[31.01|17:51:28]     CheckForces: Prediction job from final frame (MDStep316) of step3_attempt3_simulation
[31.01|17:51:28]     CheckForces: ------------
[31.01|17:51:28]     CheckForces: Histogram of forces
[31.01|17:51:28]     CheckForces: eV/Ang    Ref   Pred
[31.01|17:51:28]     CheckForces:     -3      0      0
[31.01|17:51:28]     CheckForces:     -2      5      5
[31.01|17:51:28]     CheckForces:     -1      8      8
[31.01|17:51:28]     CheckForces:      0      8      8
[31.01|17:51:28]     CheckForces:      1      1      1
[31.01|17:51:28]     CheckForces:      2      2      2
[31.01|17:51:28]     CheckForces:      3      0      0
[31.01|17:51:28]     CheckForces: Threshold for 0 force: 0.50 eV/angstrom
[31.01|17:51:28]     CheckForces: All force components are within the acceptable error!
[31.01|17:51:28]     CheckForces: Maximum deviation: 0.178 eV/angstrom
[31.01|17:51:28]     CheckForces:          Actual   Threshold
[31.01|17:51:28]     CheckForces: # > thr.        0        0  OK!
[31.01|17:51:28]     CheckForces: MAE         0.058     0.30  OK!
[31.01|17:51:28]     CheckForces: R^2         0.995     0.80  OK!
[31.01|17:51:28]     CheckForces: --------------------
[31.01|17:51:28]
[31.01|17:51:28] Adding results from step3_attempt3_reference_calc1 to validation set
[31.01|17:51:28]     Current # training set entries: 12
[31.01|17:51:28]     Current # validation set entries: 7
[31.01|17:51:28]     Storing data in step3_attempt3_reference_data
[31.01|17:51:28]     Deleting step3_attempt2_reference_data
[31.01|17:51:28]     Deleting step3_attempt3_reference_calc1
[31.01|17:51:28]
[31.01|17:51:28] Current (cumulative) timings:
[31.01|17:51:28]                                           Time (s) Fraction
[31.01|17:51:28]     Ref. calcs                               15.87    0.039
[31.01|17:51:28]     ML training                             305.05    0.753
[31.01|17:51:28]     Simulations                              84.44    0.208
[31.01|17:51:28]
[31.01|17:51:28]
[31.01|17:51:28] Step 3 finished successfully!
[31.01|17:51:28]
[31.01|17:51:28] --- Begin summary ---
[31.01|17:51:28] Step  Attempt Status   Reason      finalframe_forces_max_delta
[31.01|17:51:28]     1      1 FAILED   Inaccurate                  1.7423
[31.01|17:51:28]     1      2 SUCCESS  Accurate                    0.5734
[31.01|17:51:28]     2      1 FAILED   Inaccurate                  1.0679
[31.01|17:51:28]     2      2 SUCCESS  Accurate                    0.3920
[31.01|17:51:28]     3      1 FAILED   Inaccurate                  0.9762
[31.01|17:51:28]     3      2 FAILED   Inaccurate                  0.7560
[31.01|17:51:28]     3      3 SUCCESS  Accurate                    0.1781
[31.01|17:51:28] --- End summary ---
[31.01|17:51:28]
[31.01|17:51:28] ##########################
[31.01|17:51:28] ### Step 4 / Attempt 1 ###
[31.01|17:51:28] ##########################
[31.01|17:51:28] MD Steps: 1462 (cumulative: 1778)
[31.01|17:51:28] Current engine settings:
[31.01|17:51:28]
Engine MLPotential
  Backend M3GNet
  MLDistanceUnit angstrom
  MLEnergyUnit eV
  Model Custom
  ParameterDir /path/plams_workdir/sal/step3_attempt2_training/results/optimization/m3gnet/m3gnet
EndEngine


[31.01|17:51:28]     Running step4_attempt1_simulation...
[31.01|17:51:54]     Job step4_attempt1_simulation finished
[31.01|17:51:54] Deleting files that are no longer needed...
[31.01|17:51:54]     Deleting step2_attempt2_simulation
[31.01|17:51:54]     Deleting step3_attempt1_simulation
[31.01|17:51:54]     Deleting step3_attempt2_simulation
[31.01|17:51:55] Launching reference calculation
[31.01|17:51:56]      Reference calculation finished!
[31.01|17:51:56] Checking success for step4_attempt1
[31.01|17:52:06]     CheckEnergy: Checking energy for MDStep1778, n_atoms = 8
[31.01|17:52:06]     CheckEnergy: normalization coefficient = 8
[31.01|17:52:06]     CheckEnergy:                   Actual  Threshold
[31.01|17:52:06]     CheckEnergy: ΔE/8              0.0055     0.2000 OK!
[31.01|17:52:06]     CheckEnergy: ΔΔE/8             0.0069     0.0050 Not OK!  (relative to step3_attempt3_simulation:MDStep316)
[31.01|17:52:06]
[31.01|17:52:06]     CheckForces: Comparing predicted forces to reference forces (eV/angstrom) on MD snapshot
[31.01|17:52:06]     CheckForces: ------------
[31.01|17:52:06]     CheckForces: Reference job from step4_attempt1_reference_calc1
[31.01|17:52:06]     CheckForces: Prediction job from final frame (MDStep1778) of step4_attempt1_simulation
[31.01|17:52:06]     CheckForces: ------------
[31.01|17:52:06]     CheckForces: Histogram of forces
[31.01|17:52:06]     CheckForces: eV/Ang    Ref   Pred
[31.01|17:52:06]     CheckForces:     -4      1      1
[31.01|17:52:06]     CheckForces:     -3      0      0
[31.01|17:52:06]     CheckForces:     -2      0      2
[31.01|17:52:06]     CheckForces:     -1     13     10
[31.01|17:52:06]     CheckForces:      0      5      6
[31.01|17:52:06]     CheckForces:      1      5      4
[31.01|17:52:06]     CheckForces:      2      0      1
[31.01|17:52:06]     CheckForces: Threshold for 0 force: 0.50 eV/angstrom
[31.01|17:52:06]     CheckForces: All force components are within the acceptable error!
[31.01|17:52:06]     CheckForces: Maximum deviation: 0.339 eV/angstrom
[31.01|17:52:06]     CheckForces:          Actual   Threshold
[31.01|17:52:06]     CheckForces: # > thr.        0        0  OK!
[31.01|17:52:06]     CheckForces: MAE         0.169     0.30  OK!
[31.01|17:52:06]     CheckForces: R^2         0.983     0.80  OK!
[31.01|17:52:06]     CheckForces: --------------------
[31.01|17:52:06]
[31.01|17:52:06] Adding results from step4_attempt1_reference_calc1 to training set
[31.01|17:52:06]     Current # training set entries: 13
[31.01|17:52:06]     Current # validation set entries: 7
[31.01|17:52:06]     Storing data in step4_attempt1_reference_data
[31.01|17:52:06]     Deleting step3_attempt3_reference_data
[31.01|17:52:06]     Deleting step4_attempt1_reference_calc1
[31.01|17:52:06]
[31.01|17:52:06] Current (cumulative) timings:
[31.01|17:52:06]                                           Time (s) Fraction
[31.01|17:52:06]     Ref. calcs                               16.71    0.039
[31.01|17:52:06]     ML training                             305.05    0.705
[31.01|17:52:06]     Simulations                             111.11    0.257
[31.01|17:52:06]
[31.01|17:52:06]
[31.01|17:52:06]
[31.01|17:52:06] --- Begin summary ---
[31.01|17:52:06] Step  Attempt Status   Reason      finalframe_forces_max_delta
[31.01|17:52:06]     1      1 FAILED   Inaccurate                  1.7423
[31.01|17:52:06]     1      2 SUCCESS  Accurate                    0.5734
[31.01|17:52:06]     2      1 FAILED   Inaccurate                  1.0679
[31.01|17:52:06]     2      2 SUCCESS  Accurate                    0.3920
[31.01|17:52:06]     3      1 FAILED   Inaccurate                  0.9762
[31.01|17:52:06]     3      2 FAILED   Inaccurate                  0.7560
[31.01|17:52:06]     3      3 SUCCESS  Accurate                    0.1781
[31.01|17:52:06]     4      1 FAILED   Inaccurate                  0.3389
[31.01|17:52:06] --- End summary ---
[31.01|17:52:06]
[31.01|17:52:06] Running more reference calculations....
[31.01|17:52:06]     Running reference calculations on frames [37, 40, 43] from step4_attempt1_simulation/ams.rkf
[31.01|17:52:06]     Calculating 3 frames in total
[31.01|17:52:06]     Running step4_attempt1_reference_calc2
[31.01|17:52:07]     Running step4_attempt1_reference_calc3
[31.01|17:52:08]     Running step4_attempt1_reference_calc4
[31.01|17:52:08]     Reference calculations finished!
[31.01|17:52:08] Adding results from step4_attempt1_reference_calc2 to validation set
[31.01|17:52:08] Adding results from step4_attempt1_reference_calc3 to training set
[31.01|17:52:08] Adding results from step4_attempt1_reference_calc4 to training set
[31.01|17:52:08]     Current # training set entries: 15
[31.01|17:52:08]     Current # validation set entries: 8
[31.01|17:52:08]     Storing data in step4_attempt1_reference_data
[31.01|17:52:08]     Deleting step4_attempt1_reference_calc2
[31.01|17:52:08]     Deleting step4_attempt1_reference_calc3
[31.01|17:52:08]     Deleting step4_attempt1_reference_calc4
[31.01|17:52:08] Launching reparametrization job: step4_attempt1_training
[31.01|17:52:10] JOB m3gnet STARTED
[31.01|17:52:10] Starting m3gnet.prerun()
[31.01|17:52:10] m3gnet.prerun() finished
[31.01|17:52:10] JOB m3gnet RUNNING
[31.01|17:52:10] Executing m3gnet.run
[31.01|17:52:35] training_set    Epoch:      0 Loss: 0.002138
[31.01|17:52:35] validation_set  Epoch:      0 Loss: 0.050272
[31.01|17:52:36] training_set    Epoch:     10 Loss: 0.000159
[31.01|17:52:36] validation_set  Epoch:     10 Loss: 0.012682
[31.01|17:52:37] training_set    Epoch:     20 Loss: 0.000028
[31.01|17:52:37] validation_set  Epoch:     20 Loss: 0.004910
[31.01|17:52:38] training_set    Epoch:     30 Loss: 0.000023
[31.01|17:52:38] validation_set  Epoch:     30 Loss: 0.002643
[31.01|17:52:39] training_set    Epoch:     40 Loss: 0.000019
[31.01|17:52:39] validation_set  Epoch:     40 Loss: 0.002616
[31.01|17:52:40] training_set    Epoch:     50 Loss: 0.000017
[31.01|17:52:40] validation_set  Epoch:     50 Loss: 0.002715
[31.01|17:52:41] training_set    Epoch:     60 Loss: 0.000016
[31.01|17:52:41] validation_set  Epoch:     60 Loss: 0.002266
[31.01|17:52:42] training_set    Epoch:     70 Loss: 0.000018
[31.01|17:52:42] validation_set  Epoch:     70 Loss: 0.002155
[31.01|17:52:43] training_set    Epoch:     80 Loss: 0.000014
[31.01|17:52:43] validation_set  Epoch:     80 Loss: 0.003127
[31.01|17:52:45] training_set    Epoch:     90 Loss: 0.000013
[31.01|17:52:45] validation_set  Epoch:     90 Loss: 0.002371
[31.01|17:52:46] training_set    Epoch:    100 Loss: 0.000013
[31.01|17:52:46] validation_set  Epoch:    100 Loss: 0.002530
[31.01|17:52:47] training_set    Epoch:    110 Loss: 0.000013
[31.01|17:52:47] validation_set  Epoch:    110 Loss: 0.002451
[31.01|17:52:48] training_set    Epoch:    120 Loss: 0.000011
[31.01|17:52:48] validation_set  Epoch:    120 Loss: 0.001932
[31.01|17:52:49] training_set    Epoch:    130 Loss: 0.000010
[31.01|17:52:49] validation_set  Epoch:    130 Loss: 0.001957
[31.01|17:52:50] training_set    Epoch:    140 Loss: 0.000011
[31.01|17:52:50] validation_set  Epoch:    140 Loss: 0.003718
[31.01|17:52:51] training_set    Epoch:    150 Loss: 0.000009
[31.01|17:52:51] validation_set  Epoch:    150 Loss: 0.002412
[31.01|17:52:52] training_set    Epoch:    160 Loss: 0.000009
[31.01|17:52:52] validation_set  Epoch:    160 Loss: 0.001933
[31.01|17:52:53] training_set    Epoch:    170 Loss: 0.000009
[31.01|17:52:53] validation_set  Epoch:    170 Loss: 0.002816
[31.01|17:52:54] training_set    Epoch:    180 Loss: 0.000008
[31.01|17:52:54] validation_set  Epoch:    180 Loss: 0.001849
[31.01|17:52:55] training_set    Epoch:    190 Loss: 0.000008
[31.01|17:52:55] validation_set  Epoch:    190 Loss: 0.002113
[31.01|17:52:57] Execution of m3gnet.run finished with returncode 0
[31.01|17:52:57] JOB m3gnet FINISHED
[31.01|17:52:57] Starting m3gnet.postrun()
[31.01|17:52:57] m3gnet.postrun() finished
[31.01|17:52:57] JOB m3gnet SUCCESSFUL
[31.01|17:53:09] Running all jobs through AMS....
[31.01|17:53:09] Storing results/optimization/training_set_results/latest
[31.01|17:53:09] Storing results/optimization/validation_set_results/latest
[31.01|17:53:09] PLAMS environment cleaned up successfully
[31.01|17:53:09] PLAMS run finished. Goodbye
[31.01|17:53:09]     ParAMSResults  training_set   validation_set
[31.01|17:53:09]     energy MAE     0.0132         0.0119          eV
[31.01|17:53:09]     forces MAE     0.0337         0.0857          eV/angstrom
[31.01|17:53:09]     Newly created parameter file/dir: step4_attempt1_training/results/optimization/m3gnet/m3gnet
[31.01|17:53:09]     Done!
[31.01|17:53:09]     Deleting step3_attempt2_training
[31.01|17:53:09] ##########################
[31.01|17:53:09] ### Step 4 / Attempt 2 ###
[31.01|17:53:09] ##########################
[31.01|17:53:09] MD Steps: 1462 (cumulative: 1778)
[31.01|17:53:09] Current engine settings:
[31.01|17:53:09]
Engine MLPotential
  Backend M3GNet
  MLDistanceUnit angstrom
  MLEnergyUnit eV
  Model Custom
  ParameterDir /path/plams_workdir/sal/step4_attempt1_training/results/optimization/m3gnet/m3gnet
EndEngine


[31.01|17:53:09]     Running step4_attempt2_simulation...
[31.01|17:53:32]     Job step4_attempt2_simulation finished
[31.01|17:53:32] Deleting files that are no longer needed...
[31.01|17:53:32] Launching reference calculation
[31.01|17:53:33]      Reference calculation finished!
[31.01|17:53:33] Checking success for step4_attempt2
[31.01|17:53:43]     CheckEnergy: Checking energy for MDStep1778, n_atoms = 8
[31.01|17:53:43]     CheckEnergy: normalization coefficient = 8
[31.01|17:53:43]     CheckEnergy:                   Actual  Threshold
[31.01|17:53:43]     CheckEnergy: ΔE/8              0.0006     0.2000 OK!
[31.01|17:53:43]     CheckEnergy: ΔΔE/8            -0.0015     0.0050 OK!      (relative to step4_attempt1_simulation:MDStep1778)
[31.01|17:53:43]
[31.01|17:53:43]     CheckForces: Comparing predicted forces to reference forces (eV/angstrom) on MD snapshot
[31.01|17:53:43]     CheckForces: ------------
[31.01|17:53:43]     CheckForces: Reference job from step4_attempt2_reference_calc1
[31.01|17:53:43]     CheckForces: Prediction job from final frame (MDStep1778) of step4_attempt2_simulation
[31.01|17:53:43]     CheckForces: ------------
[31.01|17:53:43]     CheckForces: Histogram of forces
[31.01|17:53:43]     CheckForces: eV/Ang    Ref   Pred
[31.01|17:53:43]     CheckForces:     -5      1      1
[31.01|17:53:43]     CheckForces:     -4      0      0
[31.01|17:53:43]     CheckForces:     -3      1      1
[31.01|17:53:43]     CheckForces:     -2      2      2
[31.01|17:53:43]     CheckForces:     -1      6      6
[31.01|17:53:43]     CheckForces:      0      9      9
[31.01|17:53:43]     CheckForces:      1      3      3
[31.01|17:53:43]     CheckForces:      2      2      2
[31.01|17:53:43]     CheckForces: Threshold for 0 force: 0.50 eV/angstrom
[31.01|17:53:43]     CheckForces: All force components are within the acceptable error!
[31.01|17:53:43]     CheckForces: Maximum deviation: 0.283 eV/angstrom
[31.01|17:53:43]     CheckForces:          Actual   Threshold
[31.01|17:53:43]     CheckForces: # > thr.        0        0  OK!
[31.01|17:53:43]     CheckForces: MAE         0.077     0.30  OK!
[31.01|17:53:43]     CheckForces: R^2         0.995     0.80  OK!
[31.01|17:53:43]     CheckForces: --------------------
[31.01|17:53:43]
[31.01|17:53:43] Adding results from step4_attempt2_reference_calc1 to training set
[31.01|17:53:43]     Current # training set entries: 16
[31.01|17:53:43]     Current # validation set entries: 8
[31.01|17:53:43]     Storing data in step4_attempt2_reference_data
[31.01|17:53:43]     Deleting step4_attempt1_reference_data
[31.01|17:53:43]     Deleting step4_attempt2_reference_calc1
[31.01|17:53:43]
[31.01|17:53:43] Current (cumulative) timings:
[31.01|17:53:43]                                           Time (s) Fraction
[31.01|17:53:43]     Ref. calcs                               19.71    0.038
[31.01|17:53:43]     ML training                             365.82    0.704
[31.01|17:53:43]     Simulations                             134.03    0.258
[31.01|17:53:43]
[31.01|17:53:43]
[31.01|17:53:44] Step 4 finished successfully!
[31.01|17:53:44]
[31.01|17:53:44] --- Begin summary ---
[31.01|17:53:44] Step  Attempt Status   Reason      finalframe_forces_max_delta
[31.01|17:53:44]     1      1 FAILED   Inaccurate                  1.7423
[31.01|17:53:44]     1      2 SUCCESS  Accurate                    0.5734
[31.01|17:53:44]     2      1 FAILED   Inaccurate                  1.0679
[31.01|17:53:44]     2      2 SUCCESS  Accurate                    0.3920
[31.01|17:53:44]     3      1 FAILED   Inaccurate                  0.9762
[31.01|17:53:44]     3      2 FAILED   Inaccurate                  0.7560
[31.01|17:53:44]     3      3 SUCCESS  Accurate                    0.1781
[31.01|17:53:44]     4      1 FAILED   Inaccurate                  0.3389
[31.01|17:53:44]     4      2 SUCCESS  Accurate                    0.2827
[31.01|17:53:44] --- End summary ---
[31.01|17:53:44]
[31.01|17:53:44] ##########################
[31.01|17:53:44] ### Step 5 / Attempt 1 ###
[31.01|17:53:44] ##########################
[31.01|17:53:44] MD Steps: 8222 (cumulative: 10000)
[31.01|17:53:44] Current engine settings:
[31.01|17:53:44]
Engine MLPotential
  Backend M3GNet
  MLDistanceUnit angstrom
  MLEnergyUnit eV
  Model Custom
  ParameterDir /path/plams_workdir/sal/step4_attempt1_training/results/optimization/m3gnet/m3gnet
EndEngine


[31.01|17:53:44]     Running step5_attempt1_simulation...
[31.01|17:55:05]     Job step5_attempt1_simulation finished
[31.01|17:55:05] Deleting files that are no longer needed...
[31.01|17:55:05]     Deleting step3_attempt3_simulation
[31.01|17:55:05]     Deleting step4_attempt1_simulation
[31.01|17:55:05] Launching reference calculation
[31.01|17:55:06]      Reference calculation finished!
[31.01|17:55:06] Checking success for step5_attempt1
[31.01|17:55:16]     CheckEnergy: Checking energy for MDStep10000, n_atoms = 8
[31.01|17:55:16]     CheckEnergy: normalization coefficient = 8
[31.01|17:55:16]     CheckEnergy:                   Actual  Threshold
[31.01|17:55:16]     CheckEnergy: ΔE/8             -0.0008     0.2000 OK!
[31.01|17:55:16]     CheckEnergy: ΔΔE/8            -0.0014     0.0050 OK!      (relative to step4_attempt2_simulation:MDStep1778)
[31.01|17:55:16]
[31.01|17:55:16]     CheckForces: Comparing predicted forces to reference forces (eV/angstrom) on MD snapshot
[31.01|17:55:16]     CheckForces: ------------
[31.01|17:55:16]     CheckForces: Reference job from step5_attempt1_reference_calc1
[31.01|17:55:16]     CheckForces: Prediction job from final frame (MDStep10000) of step5_attempt1_simulation
[31.01|17:55:16]     CheckForces: ------------
[31.01|17:55:16]     CheckForces: Histogram of forces
[31.01|17:55:16]     CheckForces: eV/Ang    Ref   Pred
[31.01|17:55:16]     CheckForces:     -4      0      0
[31.01|17:55:16]     CheckForces:     -3      1      1
[31.01|17:55:16]     CheckForces:     -2      1      1
[31.01|17:55:16]     CheckForces:     -1     12     11
[31.01|17:55:16]     CheckForces:      0      7      8
[31.01|17:55:16]     CheckForces:      1      2      2
[31.01|17:55:16]     CheckForces:      2      1      1
[31.01|17:55:16]     CheckForces:      3      0      0
[31.01|17:55:16]     CheckForces: Threshold for 0 force: 0.50 eV/angstrom
[31.01|17:55:16]     CheckForces: All force components are within the acceptable error!
[31.01|17:55:16]     CheckForces: Maximum deviation: 0.530 eV/angstrom
[31.01|17:55:16]     CheckForces:          Actual   Threshold
[31.01|17:55:16]     CheckForces: # > thr.        0        0  OK!
[31.01|17:55:16]     CheckForces: MAE         0.138     0.30  OK!
[31.01|17:55:16]     CheckForces: R^2         0.975     0.80  OK!
[31.01|17:55:16]     CheckForces: --------------------
[31.01|17:55:16]
[31.01|17:55:16] Adding results from step5_attempt1_reference_calc1 to training set
[31.01|17:55:16]     Current # training set entries: 17
[31.01|17:55:16]     Current # validation set entries: 8
[31.01|17:55:16]     Storing data in step5_attempt1_reference_data
[31.01|17:55:16]     Deleting step4_attempt2_reference_data
[31.01|17:55:16]     Deleting step5_attempt1_reference_calc1
[31.01|17:55:16]
[31.01|17:55:16] Current (cumulative) timings:
[31.01|17:55:16]                                           Time (s) Fraction
[31.01|17:55:16]     Ref. calcs                               20.44    0.034
[31.01|17:55:16]     ML training                             365.82    0.608
[31.01|17:55:16]     Simulations                             215.21    0.358
[31.01|17:55:16]
[31.01|17:55:16]
[31.01|17:55:16] Step 5 finished successfully!
[31.01|17:55:16]
[31.01|17:55:16] --- Begin summary ---
[31.01|17:55:16] Step  Attempt Status   Reason      finalframe_forces_max_delta
[31.01|17:55:16]     1      1 FAILED   Inaccurate                  1.7423
[31.01|17:55:16]     1      2 SUCCESS  Accurate                    0.5734
[31.01|17:55:16]     2      1 FAILED   Inaccurate                  1.0679
[31.01|17:55:16]     2      2 SUCCESS  Accurate                    0.3920
[31.01|17:55:16]     3      1 FAILED   Inaccurate                  0.9762
[31.01|17:55:16]     3      2 FAILED   Inaccurate                  0.7560
[31.01|17:55:16]     3      3 SUCCESS  Accurate                    0.1781
[31.01|17:55:16]     4      1 FAILED   Inaccurate                  0.3389
[31.01|17:55:16]     4      2 SUCCESS  Accurate                    0.2827
[31.01|17:55:16]     5      1 SUCCESS  Accurate                    0.5300
[31.01|17:55:16] --- End summary ---
[31.01|17:55:16]
[31.01|17:55:16] The engine settings for the final trained ML engine are:
[31.01|17:55:16]
Engine MLPotential
  Backend M3GNet
  MLDistanceUnit angstrom
  MLEnergyUnit eV
  Model Custom
  ParameterDir /path/plams_workdir/sal/step4_attempt1_training/results/optimization/m3gnet/m3gnet
EndEngine



[31.01|17:55:16] Active learning finished!
[31.01|17:55:16] Rerunning the simulation with the final parameters...
[31.01|17:56:52] Goodbye!
[31.01|17:56:52] JOB sal FINISHED
[31.01|17:56:52] JOB sal SUCCESSFUL
<scm.params.plams.simple_active_learning_job.SimpleActiveLearningResults at 0x7fd4176eaa90>

Complete Python code

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

# ## Initial imports

from scm.simple_active_learning import SimpleActiveLearningJob
import scm.plams as plams
from scm.external_engines.core import interface_is_installed

assert interface_is_installed("m3gnet"), "You must first install m3gnet with the AMS package manager"


# ## Initialize PLAMS

plams.init()


# ## Input system

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


# ## Reference engine settings
# For time reasons we use the UFF force field as the reference method. Typically you would instead train to DFT using ADF, BAND, or Quantum ESPRESSO.

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


print(plams.AMSJob(settings=ref_s).get_input())


# ## Molecular dynamics settings
# Here, we use the convenient ``AMSNVTJob`` recipe to easily initialize sone MD settings.

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


print(plams.AMSJob(settings=md_s).get_input())


# ## ParAMS ML Training settings
#
# (Technical note: When using ``SimpleActiveLearningJob`` the ParAMS settings go under ``input.ams``. When using ``ParAMSJob`` the settings instead simply go under ``input``. See the ParAMS Python tutorials.)

ml_s = plams.Settings()
ml_s.input.ams.MachineLearning.Backend = "M3GNet"
ml_s.input.ams.MachineLearning.CommitteeSize = 1
ml_s.input.ams.MachineLearning.M3GNet.Model = "UniversalPotential"
ml_s.input.ams.MachineLearning.MaxEpochs = 200
print(SimpleActiveLearningJob(settings=ml_s).get_input())


# ## Active learning settings

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  # 10 AL steps
print(SimpleActiveLearningJob(settings=al_s).get_input())


# ## Simple Active Learning Job

settings = ref_s + md_s + ml_s + al_s
job = SimpleActiveLearningJob(settings=settings, molecule=mol, name="sal")
print(job.get_input())


# ## Run the job

job.run(watch=True)