jace_fitting#
- autoplex.fitting.common.utils.jace_fitting(db_dir, path_to_hyperparameters=MLIP_RSS_DEFAULTS_FILE_PATH, isolated_atom_energies=None, ref_energy_name='REF_energy', ref_force_name='REF_forces', ref_virial_name='REF_virial', num_processes_fit=32, fit_kwargs=None)[source]#
Perform the ACE (Atomic Cluster Expansion) potential fitting.
This function sets up and executes a Julia script to perform ACE fitting using specified parameters and input data located in the provided directory. It handles the input/output of atomic configurations, sets up the ACE model, and calculates training and testing errors after fitting.
- Parameters:
db_dir (str or Path) – directory containing the training and testing data files.
path_to_hyperparameters (str or Path.) – Path to JSON file containing the J-ACE hyperparameters.
isolated_atom_energies (dict:) – mandatory dictionary mapping element numbers to isolated energies.
ref_energy_name (str, optional) – Reference energy name.
ref_force_name (str, optional) – Reference force name.
ref_virial_name (str, optional) – Reference virial name.
num_processes_fit (int) – number of processes to use for parallel computation.
fit_kwargs (dict.) – optional dictionary with parameters for ace fitting with keys same as mlip-rss-defaults.json.
- Keyword Arguments:
order (int) – order of ACE.
totaldegree (int) – total degree of the polynomial terms in the ACE model.
cutoff (float) – cutoff distance for atomic interactions in the ACE model.
solver (str) – solver to be used for fitting the ACE model. Default is “BLR” (Bayesian Linear Regression). For very large-scale parameter estimation problems, using “LSQR” solver.
- Returns:
A dictionary containing train_error, test_error, and the path to the fitted MLIP.
- Return type:
dict[str, float]
- Raises:
- ValueError – If the isolated_atom_energies dictionary is empty or not provided when required.: