diff --git a/previews/PR74/.documenter-siteinfo.json b/previews/PR74/.documenter-siteinfo.json index deee7cd2..8551784a 100644 --- a/previews/PR74/.documenter-siteinfo.json +++ b/previews/PR74/.documenter-siteinfo.json @@ -1 +1 @@ -{"documenter":{"julia_version":"1.10.4","generation_timestamp":"2024-06-18T00:11:24","documenter_version":"1.4.1"}} \ No newline at end of file +{"documenter":{"julia_version":"1.10.4","generation_timestamp":"2024-06-18T00:12:49","documenter_version":"1.4.1"}} \ No newline at end of file diff --git a/previews/PR74/api/index.html b/previews/PR74/api/index.html index cbe1da27..d14170c2 100644 --- a/previews/PR74/api/index.html +++ b/previews/PR74/api/index.html @@ -2,59 +2,59 @@ API · PotentialLearning.jl

API Reference

This page provides a list of all documented types and functions and in PotentialLearning.jl.

PotentialLearning.ActiveSubspaceType
ActiveSubspace{T<:Real} <: DimensionReducer
     Q :: Function 
     ∇Q :: Function (gradient of Q)
-    tol :: T

Use the theory of active subspaces, with a given quantity of interest (expressed as the function Q) which takes a Configuration as an input and outputs a real scalar. ∇Q should input a Configuration and output an appropriate gradient. If tol is a float then the number of components to keep is determined by the smallest n such that relative percentage of variance explained by keeping the leading n principle components is greater than 1 - tol. If tol is an int, then we return the components corresponding to the tol largest eigenvalues.

source
PotentialLearning.AtomicDataType
AtomicData <: Data

Abstract type declaring the type of information that is unique to a particular atom (instead of a whole configuration).

source
PotentialLearning.ConfigurationMethod
Configuration(data::Union{AtomsBase.FlexibleSystem, ConfigurationData} )

A Configuration is a data struct that contains information unique to a particular configuration of atoms (Energy, LocalDescriptors, ForceDescriptors, and a FlexibleSystem) in a dictionary. Example: '''julia e = Energy(-0.57, u"eV") ld = LocalDescriptors(...) c = Configuration(e, ld) '''

Configurations can be added together, which merges the data dictionaries '''julia c1 = Configuration(e) # Contains energy c2 = Configuration(f) # contains forces c = c1 + c2 # c <: Configuration, contains energy and forces '''

source
PotentialLearning.CorrelationMatrixType
CorrelationMatrix 
-    α :: Vector{Float64} # weights

CorrelationMatrix produces a global descriptor that is the correlation matrix of the local descriptors. In other words, it is mean(bi'*bi for bi in B).

source
PotentialLearning.CovariateLinearProblemType

struct CovariateLinearProblem{T<:Real} <: LinearProblem{T} e::Vector f::Vector{Vector{T}} B::Vector{Vector{T}} dB::Vector{Matrix{T}} β::Vector{T} β0::Vector{T} σe::Vector{T} σf::Vector{T} Σ::Symmetric{T,Matrix{T}} end

A CovariateLinearProblem is a linear problem in which we are fitting energies and forces using both descriptors and their gradients (B and dB, respectively). When this is the case, the solution is not available analytically and must be solved using some iterative optimization proceedure. In the end, we fit the model coefficients, β, standard deviations corresponding to energies and forces, σe and σf, and the covariance Σ.

source
PotentialLearning.DBSCANSelectorType
struct DBSCANSelector <: SubsetSelector
+    tol :: T

Use the theory of active subspaces, with a given quantity of interest (expressed as the function Q) which takes a Configuration as an input and outputs a real scalar. ∇Q should input a Configuration and output an appropriate gradient. If tol is a float then the number of components to keep is determined by the smallest n such that relative percentage of variance explained by keeping the leading n principle components is greater than 1 - tol. If tol is an int, then we return the components corresponding to the tol largest eigenvalues.

source
PotentialLearning.AtomicDataType
AtomicData <: Data

Abstract type declaring the type of information that is unique to a particular atom (instead of a whole configuration).

source
PotentialLearning.ConfigurationMethod
Configuration(data::Union{AtomsBase.FlexibleSystem, ConfigurationData} )

A Configuration is a data struct that contains information unique to a particular configuration of atoms (Energy, LocalDescriptors, ForceDescriptors, and a FlexibleSystem) in a dictionary. Example: '''julia e = Energy(-0.57, u"eV") ld = LocalDescriptors(...) c = Configuration(e, ld) '''

Configurations can be added together, which merges the data dictionaries '''julia c1 = Configuration(e) # Contains energy c2 = Configuration(f) # contains forces c = c1 + c2 # c <: Configuration, contains energy and forces '''

source
PotentialLearning.CorrelationMatrixType
CorrelationMatrix 
+    α :: Vector{Float64} # weights

CorrelationMatrix produces a global descriptor that is the correlation matrix of the local descriptors. In other words, it is mean(bi'*bi for bi in B).

source
PotentialLearning.CovariateLinearProblemType

struct CovariateLinearProblem{T<:Real} <: LinearProblem{T} e::Vector f::Vector{Vector{T}} B::Vector{Vector{T}} dB::Vector{Matrix{T}} β::Vector{T} β0::Vector{T} σe::Vector{T} σf::Vector{T} Σ::Symmetric{T,Matrix{T}} end

A CovariateLinearProblem is a linear problem in which we are fitting energies and forces using both descriptors and their gradients (B and dB, respectively). When this is the case, the solution is not available analytically and must be solved using some iterative optimization proceedure. In the end, we fit the model coefficients, β, standard deviations corresponding to energies and forces, σe and σf, and the covariance Σ.

source
PotentialLearning.DBSCANSelectorType
struct DBSCANSelector <: SubsetSelector
     clusters
     eps
     minpts
     sample_size
-end

Definition of the type DBSCANSelector, a subselector based on the clustering method DBSCAN.

source
PotentialLearning.DBSCANSelectorMethod
function DBSCANSelector(
     ds::DataSet,
     eps,
     minpts,
     sample_size
-)

Constructor of DBSCANSelector based on the atomic configurations in ds, the DBSCAN params eps and minpts, and the sample size sample_size.

source
PotentialLearning.DataSetType
DataSet

Struct that holds vector of configuration. Most operations in PotentialLearning are built around the DataSet structure.

source
PotentialLearning.DistanceType
Distance
+)

Constructor of DBSCANSelector based on the atomic configurations in ds, the DBSCAN params eps and minpts, and the sample size sample_size.

source
PotentialLearning.DataSetType
DataSet

Struct that holds vector of configuration. Most operations in PotentialLearning are built around the DataSet structure.

source
PotentialLearning.DistanceType
Distance
 
-A struct of abstract type Distance produces the distance between two `global` descriptors, or features. Not all distances might be compatible with all types of features.
source
PotentialLearning.DivergenceType
Divergence
+A struct of abstract type Distance produces the distance between two `global` descriptors, or features. Not all distances might be compatible with all types of features.
source
PotentialLearning.DivergenceType
Divergence
 
-A struct of abstract type Divergence produces a measure of discrepancy between two probability distributions. Discepancies may take as argument analytical distributions or sets of samples representing empirical distributions.
source
PotentialLearning.DotProductType
DotProduct <: Kernel 
+A struct of abstract type Divergence produces a measure of discrepancy between two probability distributions. Discepancies may take as argument analytical distributions or sets of samples representing empirical distributions.
source
PotentialLearning.DotProductType
DotProduct <: Kernel 
     α :: Power of DotProduct kernel 
 
 
 Computes the dot product kernel between two features, i.e.,
 
-cos(θ) = ( A ⋅ B / (||A||^2||B||^2) )^α
source
PotentialLearning.EnergyType
Energy <: ConfigurationData
     d :: Real
-    u :: Unitful.FreeUnits

Convenience struct that holds energy information (and corresponding units). Default unit is eV

source
PotentialLearning.EuclideanType
Euclidean <: Distance 
+    u :: Unitful.FreeUnits

Convenience struct that holds energy information (and corresponding units). Default unit is eV

source
PotentialLearning.EuclideanType
Euclidean <: Distance 
     Cinv :: Covariance Matrix 
 
-Computes the squared euclidean distance with weight matrix Cinv, the inverse of some covariance matrix.
source
PotentialLearning.FeatureType
Feature

A struct of abstract type Feature represents a function that takes in a set of local descriptors corresponding to some atomic environment and produce a global descriptor.

source
PotentialLearning.ForceType
Force <: AtomicData 
+Computes the squared euclidean distance with weight matrix Cinv, the inverse of some covariance matrix.
source
PotentialLearning.FeatureType
Feature

A struct of abstract type Feature represents a function that takes in a set of local descriptors corresponding to some atomic environment and produce a global descriptor.

source
PotentialLearning.ForceType
Force <: AtomicData 
     f :: Vector{<:Real}
-    u :: Unitful.FreeUnits

Contains the force with (x,y,z)-components in f with units u. Default unit is "eV/Å".

source
PotentialLearning.ForcesType
Forces <: ConfigurationData
-    f :: Vector{force}

Forces is a struct that contains all force information in a configuration.

source
PotentialLearning.ForstnerType
Forstner <: Distance 
+    u :: Unitful.FreeUnits

Contains the force with (x,y,z)-components in f with units u. Default unit is "eV/Å".

source
PotentialLearning.ForcesType
Forces <: ConfigurationData
+    f :: Vector{force}

Forces is a struct that contains all force information in a configuration.

source
PotentialLearning.ForstnerType
Forstner <: Distance 
     α :: Regularization parameter
 
-Computes the squared Forstner distance between two positive semi-definite matrices.
source
PotentialLearning.InverseMultiquadricType
InverseMultiquadric <: Kernel 
     d :: Distance function 
     c2 :: Squared constant parameter
     ℓ :: Length-scale parameter
 
 Computes the inverse multiquadric (IMQ) kernel, i.e.,
 
- k(A, B) = (c^2 + d(A,B)/β^2)^{-1/2}
source
PotentialLearning.KernelType
Kernel
 
-A struct of abstract type Kernel is function that takes in two features and produces a semi-definite scalar representing the similarity between the two features.
source
PotentialLearning.KernelSteinDiscrepancyType
KernelSteinDiscrepancy <: Divergence
+A struct of abstract type Kernel is function that takes in two features and produces a semi-definite scalar representing the similarity between the two features.
source
PotentialLearning.KernelSteinDiscrepancyType
KernelSteinDiscrepancy <: Divergence
     score :: Function
     knl :: Kernel
 
-Computes the kernel Stein discrepancy between distributions p (from which samples are provided) and q (for which the score is provided) based on the RKHS defined by kernel k.
source
PotentialLearning.LAMMPSType
struct LAMMPS <: IO
+Computes the kernel Stein discrepancy between distributions p (from which samples are provided) and q (for which the score is provided) based on the RKHS defined by kernel k.
source
PotentialLearning.LearningProblemType

struct LearningProblem{T<:Real} <: AbstractLearningProblem ds::DataSet logprob::Function ∇logprob::Function params::Vector{T} end

Generic LearningProblem that allows the user to pass a logprob(y::params, ds::DataSet) function and its gradient. The gradient should return a vector of logprob with respect to it's params. If the user does not have a gradient function available, then Flux can provide one for it (provided that logprob is of the form above).

source
PotentialLearning.LinearProblemMethod

function LinearProblem( ds::DataSet; T = Float64 )

Construct a LinearProblem by detecting if there are energy descriptors and/or force descriptors and construct the appropriate LinearProblem (either Univariate, if only a single type of descriptor, or Covariate, if there are both types).

source
PotentialLearning.PCAType
PCA <: DimensionReducer
-    tol :: Float64

Use SVD to compute the PCA of the design matrix of descriptors. (using Force descriptors TBA)

If tol is a float then the number of components to keep is determined by the smallest n such that relative percentage of variance explained by keeping the leading n principle components is greater than 1 - tol. If tol is an int, then we return the components corresponding to the tol largest eigenvalues.

source
PotentialLearning.PCAStateType
PCAState <: DimensionReducer
-    tol :: Float64

Use SVD to compute the PCA of the design matrix of descriptors.

If tol is a float then the number of components to keep is determined by the smallest n such that relative percentage of variance explained by keeping the leading n principle components is greater than 1 - tol. If tol is an int, then we return the components corresponding to the tol largest eigenvalues.

source
PotentialLearning.LearningProblemType

struct LearningProblem{T<:Real} <: AbstractLearningProblem ds::DataSet logprob::Function ∇logprob::Function params::Vector{T} end

Generic LearningProblem that allows the user to pass a logprob(y::params, ds::DataSet) function and its gradient. The gradient should return a vector of logprob with respect to it's params. If the user does not have a gradient function available, then Flux can provide one for it (provided that logprob is of the form above).

source
PotentialLearning.LinearProblemMethod

function LinearProblem( ds::DataSet; T = Float64 )

Construct a LinearProblem by detecting if there are energy descriptors and/or force descriptors and construct the appropriate LinearProblem (either Univariate, if only a single type of descriptor, or Covariate, if there are both types).

source
PotentialLearning.PCAType
PCA <: DimensionReducer
+    tol :: Float64

Use SVD to compute the PCA of the design matrix of descriptors. (using Force descriptors TBA)

If tol is a float then the number of components to keep is determined by the smallest n such that relative percentage of variance explained by keeping the leading n principle components is greater than 1 - tol. If tol is an int, then we return the components corresponding to the tol largest eigenvalues.

source
PotentialLearning.PCAStateType
PCAState <: DimensionReducer
+    tol :: Float64

Use SVD to compute the PCA of the design matrix of descriptors.

If tol is a float then the number of components to keep is determined by the smallest n such that relative percentage of variance explained by keeping the leading n principle components is greater than 1 - tol. If tol is an int, then we return the components corresponding to the tol largest eigenvalues.

source
PotentialLearning.RBFType
RBF <: Kernel 
     d :: Distance function 
     α :: Regularization parameter 
     ℓ :: Length-scale parameter
@@ -63,64 +63,64 @@
 
 Computes the squared exponential kernel, i.e.,
 
- k(A, B) = β xp( -rac{1}{2} d(A,B)/ℓ^2 ) + α δ(A, B)
source
PotentialLearning.RandomSelectorType
struct Random
     num_configs :: Int 
     batch_size  :: Int 
-end

A convenience function that allows the user to randomly select indices uniformly over [1, num_configs].

source
PotentialLearning.UnivariateLinearProblemType

struct UnivariateLinearProblem{T<:Real} <: LinearProblem{T} ivdata::Vector dvdata::Vector β::Vector{T} β0::Vector{T} σ::Vector{T} Σ::Symmetric{T,Matrix{T}} end

A UnivariateLinearProblem is a linear problem in which there is only 1 type of independent variable / dependent variable. Typically, that means we are either only fitting energies or only fitting forces. When this is the case, the solution is available analytically and the standard deviation, σ, and covariance, Σ, of the coefficients, β, are computable.

source
PotentialLearning.YAMLType
YAML <: IO
+end

A convenience function that allows the user to randomly select indices uniformly over [1, num_configs].

source
PotentialLearning.UnivariateLinearProblemType

struct UnivariateLinearProblem{T<:Real} <: LinearProblem{T} ivdata::Vector dvdata::Vector β::Vector{T} β0::Vector{T} σ::Vector{T} Σ::Symmetric{T,Matrix{T}} end

A UnivariateLinearProblem is a linear problem in which there is only 1 type of independent variable / dependent variable. Typically, that means we are either only fitting energies or only fitting forces. When this is the case, the solution is available analytically and the standard deviation, σ, and covariance, Σ, of the coefficients, β, are computable.

source
PotentialLearning.kDPPType
struct kDPP
     K :: EllEnsemble
-end

A convenience function that allows the user access to a k-Determinantal Point Process through Determinantal.jl. All that is required to construct a kDPP is a similarity kernel, for which the user must provide a LinearProblem and two functions to compute descriptor (1) diversity and (2) quality.

source
PotentialLearning.kDPPMethod
kDPP(ds::Dataset, f::Feature, k::Kernel)

A convenience function that allows the user access to a k-Determinantal Point Process through Determinantal.jl. All that is required to construct a kDPP is a dataset, a method to compute features, and a kernel. Optional arguments include batch size and type of descriptor (default LocalDescriptors).

source
PotentialLearning.kDPPMethod
kDPP(features::Union{Vector{Vector{T}}, Vector{Symmetric{T, Matrix{T}}}}, k::Kernel)

A convenience function that allows the user access to a k-Determinantal Point Process through Determinantaljl. All that is required to construct a kDPP are features (either a vector of vector features or a vector of symmetric matrix features) and a kernel. Optional argument is batch_size (default length(features)).

source
InteratomicPotentials.compute_local_descriptorsMethod

function computelocaldescriptors( ds::DataSet, basis::BasisSystem; pbar = true )

ds: dataset. basis: basis system (e.g. ACE) pbar: progress bar

Compute local descriptors of a basis system and dataset using threads.

source
PotentialLearning.KernelMatrixMethod
KernelMatrix(ds1::DataSet, ds2::DataSet, F::Feature, k::Kernel)
+end

A convenience function that allows the user access to a k-Determinantal Point Process through Determinantal.jl. All that is required to construct a kDPP is a similarity kernel, for which the user must provide a LinearProblem and two functions to compute descriptor (1) diversity and (2) quality.

source
PotentialLearning.kDPPMethod
kDPP(ds::Dataset, f::Feature, k::Kernel)

A convenience function that allows the user access to a k-Determinantal Point Process through Determinantal.jl. All that is required to construct a kDPP is a dataset, a method to compute features, and a kernel. Optional arguments include batch size and type of descriptor (default LocalDescriptors).

source
PotentialLearning.kDPPMethod
kDPP(features::Union{Vector{Vector{T}}, Vector{Symmetric{T, Matrix{T}}}}, k::Kernel)

A convenience function that allows the user access to a k-Determinantal Point Process through Determinantaljl. All that is required to construct a kDPP are features (either a vector of vector features or a vector of symmetric matrix features) and a kernel. Optional argument is batch_size (default length(features)).

source
InteratomicPotentials.compute_local_descriptorsMethod

function computelocaldescriptors( ds::DataSet, basis::BasisSystem; pbar = true )

ds: dataset. basis: basis system (e.g. ACE) pbar: progress bar

Compute local descriptors of a basis system and dataset using threads.

source
PotentialLearning.KernelMatrixMethod
KernelMatrix(ds1::DataSet, ds2::DataSet, F::Feature, k::Kernel)
 
-Compute nonsymmetric kernel matrix K using features of the datasets ds1 and ds2 calculated using the Feature method F.
source
PotentialLearning.KernelMatrixMethod
KernelMatrix(ds::DataSet, F::Feature, k::Kernel)

Compute symmetric kernel matrix K using features of the dataset ds calculated using the Feature method F.

source
PotentialLearning.calc_centroidMethod
function calc_centroid(
+Compute nonsymmetric kernel matrix K using features of the datasets ds1 and ds2 calculated using the Feature method F.
source
PotentialLearning.KernelMatrixMethod
KernelMatrix(ds::DataSet, F::Feature, k::Kernel)

Compute symmetric kernel matrix K using features of the dataset ds calculated using the Feature method F.

source
PotentialLearning.calc_metricsMethod
calc_metrics(x_pred, x)

x_pred: vector of predicted values of a variable. E.g. energy. x: vector of true values of a variable. E.g. energy.

Returns MAE, RMSE, and RSQ.

source
PotentialLearning.compute_featuresMethod
compute_feature(ds::DataSet, f::Feature; dt = LocalDescriptors)

Computes features of the dataset ds using the feature method F on descriptors dt (default option are the LocalDescriptors, if available).

source
PotentialLearning.calc_metricsMethod
calc_metrics(x_pred, x)

x_pred: vector of predicted values of a variable. E.g. energy. x: vector of true values of a variable. E.g. energy.

Returns MAE, RMSE, and RSQ.

source
PotentialLearning.compute_featuresMethod
compute_feature(ds::DataSet, f::Feature; dt = LocalDescriptors)

Computes features of the dataset ds using the feature method F on descriptors dt (default option are the LocalDescriptors, if available).

source
PotentialLearning.fitFunction
fit(ds::DataSet, dr::DimensionReducer)

Fits a linear dimension reduction routine using information from DataSet. See individual types of DimensionReducers for specific details.

source
PotentialLearning.fitMethod
fit(ds::DataSet, as::ActiveSubspace)

Fits a linear dimension reduction routine using the eigendirections of the uncentered covariance of the function ∇Q(c::Configuration) over the configurations in ds. Primarily used to reduce the dimension of the descriptors.

source
PotentialLearning.fitMethod
fit(ds::DataSet, pca::PCA)

Fits a linear dimension reduction routine using PCA on the global descriptors in the dataset ds.

source
PotentialLearning.fit_transformMethod
fit_transform(ds::DataSet, dr::DimensionReducer)

Fits a linear dimension reduction routine using information from DataSet and performs dimension reduction on descriptors and force_descriptors (whichever are available). See individual types of DimensionReducers for specific details.

source
PotentialLearning.forceMethod

function force( c::Configuration, nnbp::NNBasisPotential )

c: atomic configuration. nnbp: neural network basis potential.

source
PotentialLearning.fitFunction
fit(ds::DataSet, dr::DimensionReducer)

Fits a linear dimension reduction routine using information from DataSet. See individual types of DimensionReducers for specific details.

source
PotentialLearning.fitMethod
fit(ds::DataSet, as::ActiveSubspace)

Fits a linear dimension reduction routine using the eigendirections of the uncentered covariance of the function ∇Q(c::Configuration) over the configurations in ds. Primarily used to reduce the dimension of the descriptors.

source
PotentialLearning.fitMethod
fit(ds::DataSet, pca::PCA)

Fits a linear dimension reduction routine using PCA on the global descriptors in the dataset ds.

source
PotentialLearning.fit_transformMethod
fit_transform(ds::DataSet, dr::DimensionReducer)

Fits a linear dimension reduction routine using information from DataSet and performs dimension reduction on descriptors and force_descriptors (whichever are available). See individual types of DimensionReducers for specific details.

source
PotentialLearning.forceMethod

function force( c::Configuration, nnbp::NNBasisPotential )

c: atomic configuration. nnbp: neural network basis potential.

source
PotentialLearning.get_batchesMethod
get_batches(n_batches, B_train, B_train_ext, e_train, dB_train, f_train,
-            B_test, B_test_ext, e_test, dB_test, f_test)

n_batches: no. of batches per dataset. B_train: descriptors of the energies used in training. B_train_ext: extendended descriptors of the energies used in training. Requiered to compute forces. e_train: energies used in training. dB_train: derivatives of the energy descritors used in training. f_train: forces used in training. B_test: descriptors of the energies used in test. B_test_ext: extendended descriptors of the energies used in test. Requiered to compute forces. e_test: energies used in test. dB_test: derivatives of the energy descritors used in test. f_test: forces used in test.

Returns the data loaders for training and test of energies and forces.

source
PotentialLearning.get_batchesMethod
get_batches(n_batches, B_train, B_train_ext, e_train, dB_train, f_train,
+            B_test, B_test_ext, e_test, dB_test, f_test)

n_batches: no. of batches per dataset. B_train: descriptors of the energies used in training. B_train_ext: extendended descriptors of the energies used in training. Requiered to compute forces. e_train: energies used in training. dB_train: derivatives of the energy descritors used in training. f_train: forces used in training. B_test: descriptors of the energies used in test. B_test_ext: extendended descriptors of the energies used in test. Requiered to compute forces. e_test: energies used in test. dB_test: derivatives of the energy descritors used in test. f_test: forces used in test.

Returns the data loaders for training and test of energies and forces.

source
PotentialLearning.get_clustersMethod
function get_clusters(
     ds,
     eps,
     minpts
-)

Computes clusters from the configurations in ds using DBSCAN with parameters eps and minpts.

source
PotentialLearning.get_dpp_modeMethod
get_dpp_mode(dpp::kDPP, batch_size::Int) <: Vector{Int64}

Access an approximate mode of the k-DPP as calculated by a greedy subset algorithm. See Determinantal.jl for details.

source
PotentialLearning.get_inclusion_probMethod
get_inclusion_prob(dpp::kDPP) <: Vector{Float64}

Access an approximation to the inclusion probabilities as calculated by Determinantal.jl (see package for details).

source
PotentialLearning.get_inputMethod
get_input(args)

args: vector of arguments (strings)

Returns an OrderedDict with the arguments. See https://github.com/cesmix-mit/AtomisticComposableWorkflows documentation for information about how to define the input arguments.

source
PotentialLearning.get_metricsMethod
get_metrics( e_train_pred, e_train, f_train_pred, f_train,
+)

Computes clusters from the configurations in ds using DBSCAN with parameters eps and minpts.

source
PotentialLearning.get_dpp_modeMethod
get_dpp_mode(dpp::kDPP, batch_size::Int) <: Vector{Int64}

Access an approximate mode of the k-DPP as calculated by a greedy subset algorithm. See Determinantal.jl for details.

source
PotentialLearning.get_inclusion_probMethod
get_inclusion_prob(dpp::kDPP) <: Vector{Float64}

Access an approximation to the inclusion probabilities as calculated by Determinantal.jl (see package for details).

source
PotentialLearning.get_inputMethod
get_input(args)

args: vector of arguments (strings)

Returns an OrderedDict with the arguments. See https://github.com/cesmix-mit/AtomisticComposableWorkflows documentation for information about how to define the input arguments.

source
PotentialLearning.get_metricsMethod
get_metrics( e_train_pred, e_train, f_train_pred, f_train,
              e_test_pred, e_test, f_test_pred, f_test,
-             B_time, dB_time, time_fitting)

e_train_pred: vector of predicted training energy values. e_train: vector of true training energy values. f_train_pred: vector of predicted training force values. f_train: vector of true training force values. e_test_pred: vector of predicted test energy values. e_test: vector of true test energy values. f_test_pred: vector of predicted test force values. f_test: vector of true test force values. B_time: elapsed time consumed by descriptors calculation. dB_time: elapsed time consumed by descriptor derivatives calculation. time_fitting: elapsed time consumed by fitting process.

Computes MAE, RMSE, and RSQ for training and testing energies and forces. Also add elapsed times about descriptors and fitting calculations. Returns an OrderedDict with the information above.

source
PotentialLearning.get_metricsMethod
get_metrics( e_train_pred, e_train, e_test_pred, e_test)

e_train_pred: vector of predicted training energy values. e_train: vector of true training energy values. e_test_pred: vector of predicted test energy values. e_test: vector of true test energy values.

Computes MAE, RMSE, and RSQ for training and testing energies. Returns an OrderedDict with the information above.

source
PotentialLearning.get_metricsMethod
get_metrics(
+             B_time, dB_time, time_fitting)

e_train_pred: vector of predicted training energy values. e_train: vector of true training energy values. f_train_pred: vector of predicted training force values. f_train: vector of true training force values. e_test_pred: vector of predicted test energy values. e_test: vector of true test energy values. f_test_pred: vector of predicted test force values. f_test: vector of true test force values. B_time: elapsed time consumed by descriptors calculation. dB_time: elapsed time consumed by descriptor derivatives calculation. time_fitting: elapsed time consumed by fitting process.

Computes MAE, RMSE, and RSQ for training and testing energies and forces. Also add elapsed times about descriptors and fitting calculations. Returns an OrderedDict with the information above.

source
PotentialLearning.get_metricsMethod
get_metrics( e_train_pred, e_train, e_test_pred, e_test)

e_train_pred: vector of predicted training energy values. e_train: vector of true training energy values. e_test_pred: vector of predicted test energy values. e_test: vector of true test energy values.

Computes MAE, RMSE, and RSQ for training and testing energies. Returns an OrderedDict with the information above.

source
PotentialLearning.get_metricsMethod
get_metrics(
     x_pred,
     x;
     metrics = [mae, rmse, rsq],
     label = "x"
-)

x_pred: vector of predicted forces, x: vector of true forces. metrics: vector of metrics. label: label used as prefix in dictionary keys.

Returns and OrderedDict with different metrics.

source
PotentialLearning.get_random_subsetFunction
get_random_subset(r::Random, batch_size :: Int) <: Vector{Int64}

Access a random subset of the data as sampled from the provided k-DPP. Returns the indices of the random subset and the subset itself.

source
PotentialLearning.get_random_subsetFunction
function get_random_subset(
+)

x_pred: vector of predicted forces, x: vector of true forces. metrics: vector of metrics. label: label used as prefix in dictionary keys.

Returns and OrderedDict with different metrics.

source
PotentialLearning.get_random_subsetFunction
get_random_subset(r::Random, batch_size :: Int) <: Vector{Int64}

Access a random subset of the data as sampled from the provided k-DPP. Returns the indices of the random subset and the subset itself.

source
PotentialLearning.get_random_subsetFunction
function get_random_subset(
     s::DBSCANSelector,
     batch_size = s.sample_size
-)

Returns a random subset of indexes composed of samples of size batch_size ÷ length(s.clusters) from each cluster in s.

source
PotentialLearning.get_random_subsetMethod
get_random_subset(dpp::kDPP, batch_size :: Int) <: Vector{Int64}

Access a random subset of the data as sampled from the provided k-DPP. Returns the indices of the random subset and the subset itself.

source
PotentialLearning.get_systemMethod
get_system(c::Configuration) <: AtomsBase.AbstractSystem

Retrieves the AtomsBase system (if available) in the Configuration c.

source
PotentialLearning.kabschMethod
function kabsch(
+)

Returns a random subset of indexes composed of samples of size batch_size ÷ length(s.clusters) from each cluster in s.

source
PotentialLearning.get_random_subsetMethod
get_random_subset(dpp::kDPP, batch_size :: Int) <: Vector{Int64}

Access a random subset of the data as sampled from the provided k-DPP. Returns the indices of the random subset and the subset itself.

source
PotentialLearning.get_systemMethod
get_system(c::Configuration) <: AtomsBase.AbstractSystem

Retrieves the AtomsBase system (if available) in the Configuration c.

source
PotentialLearning.kabschMethod
function kabsch(
     reference::Array{Float64,2},
     coords::Array{Float64,2}
-)

Input: two sets of points: reference, coords as Nx3 Matrices (so) Returns optimally rotated matrix

source
PotentialLearning.learn!Method

function learn!( iap::InteratomicPotentials.LinearBasisPotential, ds::DataSet, args... )

Learning dispatch function, common to ordinary and weghted least squares implementations.

source
PotentialLearning.learn!Method

function learn!( lp::CovariateLinearProblem, α::Real )

Fit a Gaussian distribution by finding the MLE of the following log probability: ℓ(β, σe, σf) = -0.5(e - A_e *β)'(e - Ae * β) / σe - 0.5*(f - Af β)'(f - A_f * β) / σf - log(σe) - log(σf)

through an optimization procedure.

source
PotentialLearning.learn!Method

function learn!( lp::CovariateLinearProblem, ss::SubsetSelector, α::Real; num_steps=100, opt=Flux.Optimise.Adam() )

Fit a Gaussian distribution by finding the MLE of the following log probability: ℓ(β, σe, σf) = -0.5(e - A_e *β)'(e - Ae * β) / σe - 0.5*(f - Af β)'(f - A_f * β) / σf - log(σe) - log(σf)

through an iterative batch gradient descent optimization proceedure where the batches are provided by the subset selector.

source
PotentialLearning.learn!Method

function learn!( lp::CovariateLinearProblem, ws::Vector, int::Bool )

Fit energies and forces using weighted least squares.

source
PotentialLearning.learn!Method

function learn!( lp::LearningProblem, ss::SubsetSelector; num_steps = 100::Int, opt = Flux.Optimisers.Adam() )

Attempts to fit the parameters lp.params in the learning problem lp using batch gradient descent with the optimizer opt and num_steps number of iterations. Batching is provided by the passed ss::SubsetSelector.

source
PotentialLearning.learn!Method

function learn!( lp::LearningProblem; num_steps=100::Int, opt=Flux.Optimisers.Adam() )

Attempts to fit the parameters lp.params in the learning problem lp using gradient descent with the optimizer opt and num_steps number of iterations.

source
PotentialLearning.learn!Method

function learn!( lp::UnivariateLinearProblem, α::Real )

Fit a univariate Gaussian distribution for the equation y = Aβ + ϵ, where β are model coefficients and ϵ ∼ N(0, σ). Fitting is done via SVD on the design matrix, A'*A (formed iteratively), where eigenvalues less than α are cut-off.

source
PotentialLearning.learn!Method

function learn!( lp::UnivariateLinearProblem, ss::SubsetSelector, α::Real; num_steps = 100, opt = Flux.Optimise.Adam() )

Fit a univariate Gaussian distribution for the equation y = Aβ + ϵ, where β are model coefficients and ϵ ∼ N(0, σ). Fitting is done via batched gradient descent with batches provided by the subset selector and the gradients are calculated using Flux.

source
PotentialLearning.learn!Method

function learn!( lp::UnivariateLinearProblem, ws::Vector, int::Bool )

Fit energies using weighted least squares.

source
PotentialLearning.learn!Method

function learn!( iap::InteratomicPotentials.LinearBasisPotential, ds::DataSet, args... )

Learning dispatch function, common to ordinary and weghted least squares implementations.

source
PotentialLearning.learn!Method

function learn!( lp::CovariateLinearProblem, α::Real )

Fit a Gaussian distribution by finding the MLE of the following log probability: ℓ(β, σe, σf) = -0.5(e - A_e *β)'(e - Ae * β) / σe - 0.5*(f - Af β)'(f - A_f * β) / σf - log(σe) - log(σf)

through an optimization procedure.

source
PotentialLearning.learn!Method

function learn!( lp::CovariateLinearProblem, ss::SubsetSelector, α::Real; num_steps=100, opt=Flux.Optimise.Adam() )

Fit a Gaussian distribution by finding the MLE of the following log probability: ℓ(β, σe, σf) = -0.5(e - A_e *β)'(e - Ae * β) / σe - 0.5*(f - Af β)'(f - A_f * β) / σf - log(σe) - log(σf)

through an iterative batch gradient descent optimization proceedure where the batches are provided by the subset selector.

source
PotentialLearning.learn!Method

function learn!( lp::CovariateLinearProblem, ws::Vector, int::Bool )

Fit energies and forces using weighted least squares.

source
PotentialLearning.learn!Method

function learn!( lp::LearningProblem, ss::SubsetSelector; num_steps = 100::Int, opt = Flux.Optimisers.Adam() )

Attempts to fit the parameters lp.params in the learning problem lp using batch gradient descent with the optimizer opt and num_steps number of iterations. Batching is provided by the passed ss::SubsetSelector.

source
PotentialLearning.learn!Method

function learn!( lp::LearningProblem; num_steps=100::Int, opt=Flux.Optimisers.Adam() )

Attempts to fit the parameters lp.params in the learning problem lp using gradient descent with the optimizer opt and num_steps number of iterations.

source
PotentialLearning.learn!Method

function learn!( lp::UnivariateLinearProblem, α::Real )

Fit a univariate Gaussian distribution for the equation y = Aβ + ϵ, where β are model coefficients and ϵ ∼ N(0, σ). Fitting is done via SVD on the design matrix, A'*A (formed iteratively), where eigenvalues less than α are cut-off.

source
PotentialLearning.learn!Method

function learn!( lp::UnivariateLinearProblem, ss::SubsetSelector, α::Real; num_steps = 100, opt = Flux.Optimise.Adam() )

Fit a univariate Gaussian distribution for the equation y = Aβ + ϵ, where β are model coefficients and ϵ ∼ N(0, σ). Fitting is done via batched gradient descent with batches provided by the subset selector and the gradients are calculated using Flux.

source
PotentialLearning.learn!Method

function learn!( lp::UnivariateLinearProblem, ws::Vector, int::Bool )

Fit energies using weighted least squares.

source
PotentialLearning.load_dataMethod
load_data(file::string, yaml::YAML)
 
 Load configurations from a yaml file into a Vector of Flexible Systems, with Energies and Force.
 Returns 
     ds - DataSet
-    t = Vector{Dict} (any miscellaneous info from yaml file)
source
PotentialLearning.load_datasetsMethod
load_datasets(input)

input: OrderedDict with input arguments. See get_defaults_args().

Returns training and test systems, energies, forces, and stresses.

source
PotentialLearning.maeMethod
mae(x_pred, x)

x_pred: vector of predicted values. E.g. predicted energies. x: vector of true values. E.g. DFT energies.

Returns mean absolute error.

source
PotentialLearning.load_datasetsMethod
load_datasets(input)

input: OrderedDict with input arguments. See get_defaults_args().

Returns training and test systems, energies, forces, and stresses.

source
PotentialLearning.maeMethod
mae(x_pred, x)

x_pred: vector of predicted values. E.g. predicted energies. x: vector of true values. E.g. DFT energies.

Returns mean absolute error.

source
PotentialLearning.periodic_rmsdMethod
function periodic_rmsd(
     p1::Array{Float64,2},
     p2::Array{Float64,2},
     box_lengths::Array{Float64,1}
-)

Calculates the RMSD between atom positions of two configurations taking into account the periodic boundaries.

source
PotentialLearning.rmsdMethod
function rmsd(
+)

Calculates the RMSD between atom positions of two configurations taking into account the periodic boundaries.

source
PotentialLearning.rmsdMethod
function rmsd(
     A::Array{Float64,2},
     B::Array{Float64,2}
-)

Calculate root mean square deviation of two matrices A, B. See http://en.wikipedia.org/wiki/Root-mean-squaredeviationofatomicpositions

source
PotentialLearning.rmseMethod
rmse(x_pred, x)

x_pred: vector of predicted values. E.g. predicted energies. x: vector of true values. E.g. DFT energies.

Returns mean root mean square error.

source
PotentialLearning.rsqMethod
rsq(x_pred, x)

x_pred: vector of predicted values. E.g. predicted energies. x: vector of true values. E.g. DFT energies.

Returns R-squared.

source
PotentialLearning.sampleMethod
function sample(
+)

Calculate root mean square deviation of two matrices A, B. See http://en.wikipedia.org/wiki/Root-mean-squaredeviationofatomicpositions

source
PotentialLearning.rmseMethod
rmse(x_pred, x)

x_pred: vector of predicted values. E.g. predicted energies. x: vector of true values. E.g. DFT energies.

Returns mean root mean square error.

source
PotentialLearning.rsqMethod
rsq(x_pred, x)

x_pred: vector of predicted values. E.g. predicted energies. x: vector of true values. E.g. DFT energies.

Returns R-squared.

source
PotentialLearning.translate_pointsMethod
function translate_points(
     P::Array{Float64,2},
     Q::Array{Float64,2}
-)

Translate P, Q so centroids are equal to the origin of the coordinate system Translation der Massenzentren, so dass beide Zentren im Ursprung des Koordinatensystems liegen

source
+)

Translate P, Q so centroids are equal to the origin of the coordinate system Translation der Massenzentren, so dass beide Zentren im Ursprung des Koordinatensystems liegen

source diff --git a/previews/PR74/generated/ACE-aHfO2/fit-ace-aHfO2/00e0e860.png b/previews/PR74/generated/ACE-aHfO2/fit-ace-aHfO2/00e0e860.png deleted file mode 100644 index 0244a59a..00000000 Binary files a/previews/PR74/generated/ACE-aHfO2/fit-ace-aHfO2/00e0e860.png and /dev/null differ diff --git a/previews/PR74/generated/ACE-aHfO2/fit-ace-aHfO2/2873f23b.png b/previews/PR74/generated/ACE-aHfO2/fit-ace-aHfO2/2873f23b.png new file mode 100644 index 00000000..b4dee5c7 Binary files /dev/null and b/previews/PR74/generated/ACE-aHfO2/fit-ace-aHfO2/2873f23b.png differ diff --git a/previews/PR74/generated/ACE-aHfO2/fit-ace-aHfO2/41ef9c1a.png b/previews/PR74/generated/ACE-aHfO2/fit-ace-aHfO2/41ef9c1a.png deleted file mode 100644 index 090e3321..00000000 Binary files a/previews/PR74/generated/ACE-aHfO2/fit-ace-aHfO2/41ef9c1a.png and /dev/null differ diff --git a/previews/PR74/generated/ACE-aHfO2/fit-ace-aHfO2/4ff52569.png b/previews/PR74/generated/ACE-aHfO2/fit-ace-aHfO2/4ff52569.png deleted file mode 100644 index 8e912c17..00000000 Binary files a/previews/PR74/generated/ACE-aHfO2/fit-ace-aHfO2/4ff52569.png and /dev/null differ diff --git a/previews/PR74/generated/ACE-aHfO2/fit-ace-aHfO2/a51f7e86.png b/previews/PR74/generated/ACE-aHfO2/fit-ace-aHfO2/a51f7e86.png new file mode 100644 index 00000000..5a6189cc Binary files /dev/null and b/previews/PR74/generated/ACE-aHfO2/fit-ace-aHfO2/a51f7e86.png differ diff --git a/previews/PR74/generated/ACE-aHfO2/fit-ace-aHfO2/bc2326e0.png b/previews/PR74/generated/ACE-aHfO2/fit-ace-aHfO2/bc2326e0.png new file mode 100644 index 00000000..c6c9c7ad Binary files /dev/null and b/previews/PR74/generated/ACE-aHfO2/fit-ace-aHfO2/bc2326e0.png differ diff --git a/previews/PR74/generated/ACE-aHfO2/fit-ace-aHfO2/e3cff8d1.png b/previews/PR74/generated/ACE-aHfO2/fit-ace-aHfO2/e3cff8d1.png new file mode 100644 index 00000000..b93ea64e Binary files /dev/null and b/previews/PR74/generated/ACE-aHfO2/fit-ace-aHfO2/e3cff8d1.png differ diff --git a/previews/PR74/generated/ACE-aHfO2/fit-ace-aHfO2/e6b6f6ef.png b/previews/PR74/generated/ACE-aHfO2/fit-ace-aHfO2/e6b6f6ef.png deleted file mode 100644 index 2605ac3a..00000000 Binary files a/previews/PR74/generated/ACE-aHfO2/fit-ace-aHfO2/e6b6f6ef.png and /dev/null differ diff --git a/previews/PR74/generated/ACE-aHfO2/fit-ace-aHfO2/index.html b/previews/PR74/generated/ACE-aHfO2/fit-ace-aHfO2/index.html index 2a1e037a..5dcbd73c 100644 --- a/previews/PR74/generated/ACE-aHfO2/fit-ace-aHfO2/index.html +++ b/previews/PR74/generated/ACE-aHfO2/fit-ace-aHfO2/index.html @@ -4,26 +4,26 @@ using LinearAlgebra, Random, DisplayAs

Define paths.

path = joinpath(dirname(pathof(PotentialLearning)), "../examples/ACE-aHfO2")
 ds_path =  "$path/../data/a-HfO2/a-HfO2-300K-NVT-6000.extxyz"
 res_path = "$path/results/"
"/home/runner/work/PotentialLearning.jl/PotentialLearning.jl/src/../examples/ACE-aHfO2/results/"

Load utility functions.

include("$path/../utils/utils.jl")

Create experiment folder.

run(`mkdir -p $res_path`)
Process(`mkdir -p /home/runner/work/PotentialLearning.jl/PotentialLearning.jl/src/../examples/ACE-aHfO2/results/`, ProcessExited(0))

Load atomistic dataset and split it into training and test.

Load atomistic dataset: atomistic configurations (atom positions, geometry, etc.) + DFT data (energies, forces, etc.)

ds = load_data(ds_path, uparse("eV"), uparse("Å"))
DataSet{num_configs = 6000} 
-	 Configuration{S, Energy, Forces, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}}
-	 Configuration{S, Energy, Forces, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}}
+	 Configuration{S, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}, Energy, Forces}
+	 Configuration{S, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}, Energy, Forces}
 	 ⋮
-	 Configuration{S, Energy, Forces, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}}

Split atomistic dataset into training and test

n_train, n_test = 50, 50 # only 50 samples per dataset are used in this example.
+	 Configuration{S, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}, Energy, Forces}

Split atomistic dataset into training and test

n_train, n_test = 50, 50 # only 50 samples per dataset are used in this example.
 conf_train, conf_test = split(ds[1:1000], n_train, n_test)
(DataSet{num_configs = 50} 
-	 Configuration{S, Energy, Forces, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}}
-	 Configuration{S, Energy, Forces, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}}
+	 Configuration{S, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}, Energy, Forces}
+	 Configuration{S, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}, Energy, Forces}
 	 ⋮
-	 Configuration{S, Energy, Forces, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}}, DataSet{num_configs = 50} 
-	 Configuration{S, Energy, Forces, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}}
-	 Configuration{S, Energy, Forces, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}}
+	 Configuration{S, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}, Energy, Forces}, DataSet{num_configs = 50} 
+	 Configuration{S, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}, Energy, Forces}
+	 Configuration{S, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}, Energy, Forces}
 	 ⋮
-	 Configuration{S, Energy, Forces, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}})

Create ACE basis, compute descriptors and add them to the dataset.

Create ACE basis

basis = ACE(species           = [:Hf, :O],
+	 Configuration{S, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}, Energy, Forces})

Create ACE basis, compute descriptors and add them to the dataset.

Create ACE basis

basis = ACE(species           = [:Hf, :O],
             body_order        = 3,
             polynomial_degree = 4,
             rcutoff           = 5.0,
             wL                = 1.0,
             csp               = 1.0,
             r0                = 1.0)
-@save_var res_path basis
43247

Compute ACE descriptors for energy and forces based on the atomistic training configurations.

println("Computing energy descriptors of training dataset...")
+@save_var res_path basis
43286

Compute ACE descriptors for energy and forces based on the atomistic training configurations.

println("Computing energy descriptors of training dataset...")
 e_descr_train = compute_local_descriptors(conf_train, basis;
                                           pbar=false)
 println("Computing force descriptors of training dataset...")
@@ -49,16 +49,16 @@
  ForceDescriptors{n = 96, d = 3}
  ForceDescriptors{n = 96, d = 3}
  ForceDescriptors{n = 96, d = 3}

Update training dataset by adding energy and force descriptors.

ds_train = DataSet(conf_train .+ e_descr_train .+ f_descr_train)
DataSet{num_configs = 50} 
-	 Configuration{S, Energy, LocalDescriptors, Forces, ForceDescriptors, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}}
-	 Configuration{S, Energy, LocalDescriptors, Forces, ForceDescriptors, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}}
+	 Configuration{S, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}, Energy, ForceDescriptors, Forces, LocalDescriptors}
+	 Configuration{S, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}, Energy, ForceDescriptors, Forces, LocalDescriptors}
 	 ⋮
-	 Configuration{S, Energy, LocalDescriptors, Forces, ForceDescriptors, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}}

Learn ACE coefficients based on ACE descriptors and DFT data.

println("Learning energies and forces...")
+	 Configuration{S, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}, Energy, ForceDescriptors, Forces, LocalDescriptors}

Learn ACE coefficients based on ACE descriptors and DFT data.

println("Learning energies and forces...")
 lb = LBasisPotential(basis)
 ws, int = [1.0, 1.0], false
 learn!(lb, ds_train, ws, int)
 @save_var res_path lb.β
 @save_var res_path lb.β0
-lb.β, lb.β0
([625.0527511959623, 356.61261257206877, 143.4469321774342, 28.6836500597129, -33308.12725138809, 1157.869144601784, 769.3158673825897, -869.2708626562646, 14348.542885912166, 7824.094588240002  …  160.59662873779095, 80.52119559522535, -11219.744886519304, -2285.8481195263867, 58.34771713582161, 1.31942903475911e6, 662869.8291733279, 42407.628768862945, -1031.566525497214, 24931.631305117], [0.0])

Post-process output: calculate metrics, create plots, and save results.

Compute ACE descriptors for energy and forces based on the atomistic test configurations.

println("Computing energy descriptors of test dataset...")
+lb.β, lb.β0
([574.8007246833678, 337.864903493894, 139.93234146938036, 28.566973908453207, 23578.981384417937, -6793.81088067536, 917.495338993809, -1854.468852459093, 13974.187052329858, 7638.994317436092  …  143.03764989510867, 74.85147923381507, -9572.068470237386, -2033.1625508016837, 134.55220860915503, 989632.7995614565, 505812.88889535813, 27383.82829679325, -1072.6042114022275, 21577.399566902488], [0.0])

Post-process output: calculate metrics, create plots, and save results.

Compute ACE descriptors for energy and forces based on the atomistic test configurations.

println("Computing energy descriptors of test dataset...")
 e_descr_test = compute_local_descriptors(conf_test, basis;
                                          pbar = false)
 println("Computing force descriptors of test dataset...")
@@ -84,10 +84,10 @@
  ForceDescriptors{n = 96, d = 3}
  ForceDescriptors{n = 96, d = 3}
  ForceDescriptors{n = 96, d = 3}

Update test dataset by adding energy and force descriptors.

ds_test = DataSet(conf_test .+ e_descr_test .+ f_descr_test)
DataSet{num_configs = 50} 
-	 Configuration{S, Energy, LocalDescriptors, Forces, ForceDescriptors, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}}
-	 Configuration{S, Energy, LocalDescriptors, Forces, ForceDescriptors, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}}
+	 Configuration{S, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}, Energy, ForceDescriptors, Forces, LocalDescriptors}
+	 Configuration{S, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}, Energy, ForceDescriptors, Forces, LocalDescriptors}
 	 ⋮
-	 Configuration{S, Energy, LocalDescriptors, Forces, ForceDescriptors, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}}

Get true and predicted values for energies and forces.

n_atoms_train = length.(get_system.(ds_train))
+	 Configuration{S, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}, Energy, ForceDescriptors, Forces, LocalDescriptors}

Get true and predicted values for energies and forces.

n_atoms_train = length.(get_system.(ds_train))
 n_atoms_test = length.(get_system.(ds_test))
 
 e_train, e_train_pred = get_all_energies(ds_train) ./ n_atoms_train,
@@ -106,7 +106,7 @@
 @save_var res_path e_test
 @save_var res_path e_test_pred
 @save_var res_path f_test
-@save_var res_path f_test_pred
300731

Compute training metrics

e_train_metrics = get_metrics(e_train, e_train_pred,
+@save_var res_path f_test_pred
300805

Compute training metrics

e_train_metrics = get_metrics(e_train, e_train_pred,
                               metrics = [mae, rmse, rsq],
                               label = "e_train")
 f_train_metrics = get_metrics(f_train, f_train_pred,
@@ -115,13 +115,13 @@
 train_metrics = merge(e_train_metrics, f_train_metrics)
 @save_dict res_path train_metrics
 train_metrics
OrderedCollections.OrderedDict{String, Float64} with 7 entries:
-  "e_train_mae"      => 0.00188063
-  "e_train_rmse"     => 0.0022856
-  "e_train_rsq"      => 0.38679
-  "f_train_mae"      => 0.171207
-  "f_train_rmse"     => 0.219619
-  "f_train_rsq"      => 0.850629
-  "f_train_mean_cos" => 0.890424

Compute test metrics

e_test_metrics = get_metrics(e_test, e_test_pred,
+  "e_train_mae"      => 0.00172987
+  "e_train_rmse"     => 0.00212409
+  "e_train_rsq"      => 0.511448
+  "f_train_mae"      => 0.171598
+  "f_train_rmse"     => 0.219488
+  "f_train_rsq"      => 0.848634
+  "f_train_mean_cos" => 0.891496

Compute test metrics

e_test_metrics = get_metrics(e_test, e_test_pred,
                              metrics = [mae, rmse, rsq],
                              label = "e_test")
 f_test_metrics = get_metrics(f_test, f_test_pred,
@@ -130,28 +130,28 @@
 test_metrics = merge(e_test_metrics, f_test_metrics)
 @save_dict res_path test_metrics
 test_metrics
OrderedCollections.OrderedDict{String, Float64} with 7 entries:
-  "e_test_mae"      => 0.000691581
-  "e_test_rmse"     => 0.000838176
-  "e_test_rsq"      => 0.917802
-  "f_test_mae"      => 0.172699
-  "f_test_rmse"     => 0.216854
-  "f_test_rsq"      => 0.853623
-  "f_test_mean_cos" => 0.889588

Plot and save energy results

e_plot = plot_energy(e_train, e_train_pred,
+  "e_test_mae"      => 0.000701571
+  "e_test_rmse"     => 0.000871864
+  "e_test_rsq"      => 0.909608
+  "f_test_mae"      => 0.174048
+  "f_test_rmse"     => 0.218486
+  "f_test_rsq"      => 0.851541
+  "f_test_mean_cos" => 0.888581

Plot and save energy results

e_plot = plot_energy(e_train, e_train_pred,
                      e_test, e_test_pred)
 @save_fig res_path e_plot
-DisplayAs.PNG(e_plot)
Example block output

Plot and save force results

f_plot = plot_forces(f_train, f_train_pred,
+DisplayAs.PNG(e_plot)
Example block output

Plot and save force results

f_plot = plot_forces(f_train, f_train_pred,
                      f_test, f_test_pred)
 @save_fig res_path f_plot
-DisplayAs.PNG(f_plot)
Example block output

Plot and save training force cosine

e_train_plot = plot_energy(e_train, e_train_pred)
+DisplayAs.PNG(f_plot)
Example block output

Plot and save training force cosine

e_train_plot = plot_energy(e_train, e_train_pred)
 f_train_plot = plot_forces(f_train, f_train_pred)
 f_train_cos  = plot_cos(f_train, f_train_pred)
 @save_fig res_path e_train_plot
 @save_fig res_path f_train_plot
 @save_fig res_path f_train_cos
-DisplayAs.PNG(f_train_cos)
Example block output

Plot and save test force cosine

e_test_plot = plot_energy(e_test, e_test_pred)
+DisplayAs.PNG(f_train_cos)
Example block output

Plot and save test force cosine

e_test_plot = plot_energy(e_test, e_test_pred)
 f_test_plot = plot_forces(f_test, f_test_pred)
 f_test_cos  = plot_cos(f_test, f_test_pred)
 @save_fig res_path e_test_plot
 @save_fig res_path f_test_plot
 @save_fig res_path f_test_cos
-DisplayAs.PNG(f_test_cos)
Example block output

This page was generated using Literate.jl.

+DisplayAs.PNG(f_test_cos)Example block output

This page was generated using Literate.jl.

diff --git a/previews/PR74/generated/DPP-ACE-Na/fit-dpp-ace-na/a67ddf32.svg b/previews/PR74/generated/DPP-ACE-Na/fit-dpp-ace-na/a67ddf32.svg deleted file mode 100644 index dedf6864..00000000 --- a/previews/PR74/generated/DPP-ACE-Na/fit-dpp-ace-na/a67ddf32.svg +++ /dev/null @@ -1,2155 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/previews/PR74/generated/DPP-ACE-Na/fit-dpp-ace-na/e9840659.svg b/previews/PR74/generated/DPP-ACE-Na/fit-dpp-ace-na/e9840659.svg new file mode 100644 index 00000000..28ea8b47 --- /dev/null +++ b/previews/PR74/generated/DPP-ACE-Na/fit-dpp-ace-na/e9840659.svg @@ -0,0 +1,2161 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/previews/PR74/generated/DPP-ACE-Na/fit-dpp-ace-na/index.html b/previews/PR74/generated/DPP-ACE-Na/fit-dpp-ace-na/index.html index 775fcb42..8e2eaaa2 100644 --- a/previews/PR74/generated/DPP-ACE-Na/fit-dpp-ace-na/index.html +++ b/previews/PR74/generated/DPP-ACE-Na/fit-dpp-ace-na/index.html @@ -4,24 +4,24 @@ using LinearAlgebra, Plots

Define paths.

path = joinpath(dirname(pathof(PotentialLearning)), "../examples/DPP-ACE-Na")
 ds_path = "$path/../data/Na/liquify_sodium.yaml"
"/home/runner/work/PotentialLearning.jl/PotentialLearning.jl/src/../examples/DPP-ACE-Na/../data/Na/liquify_sodium.yaml"

Load atomistic dataset and split it into training and test.

Load atomistic dataset: atomistic configurations (atom positions, geometry, etc.) + DFT data (energies, forces, etc.).

confs, thermo = load_data(ds_path, YAML(:Na, u"eV", u"Å"))
 confs, thermo = confs[220:end], thermo[220:end]
(DataSet{num_configs = 2092} 
-	 Configuration{S, AtomsBase.FlexibleSystem{3, AtomsBase.Atom{3, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}, Unitful.Quantity{Float64, 𝐋 𝐓^-1, Unitful.FreeUnits{(a₀, s^-1), 𝐋 𝐓^-1, nothing}}, Unitful.Quantity{Float64, 𝐌, Unitful.FreeUnits{(u,), 𝐌, nothing}}}, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}, Energy, Forces}
-	 Configuration{S, AtomsBase.FlexibleSystem{3, AtomsBase.Atom{3, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}, Unitful.Quantity{Float64, 𝐋 𝐓^-1, Unitful.FreeUnits{(a₀, s^-1), 𝐋 𝐓^-1, nothing}}, Unitful.Quantity{Float64, 𝐌, Unitful.FreeUnits{(u,), 𝐌, nothing}}}, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}, Energy, Forces}
+	 Configuration{S, Energy, AtomsBase.FlexibleSystem{3, AtomsBase.Atom{3, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}, Unitful.Quantity{Float64, 𝐋 𝐓^-1, Unitful.FreeUnits{(a₀, s^-1), 𝐋 𝐓^-1, nothing}}, Unitful.Quantity{Float64, 𝐌, Unitful.FreeUnits{(u,), 𝐌, nothing}}}, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}, Forces}
+	 Configuration{S, Energy, AtomsBase.FlexibleSystem{3, AtomsBase.Atom{3, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}, Unitful.Quantity{Float64, 𝐋 𝐓^-1, Unitful.FreeUnits{(a₀, s^-1), 𝐋 𝐓^-1, nothing}}, Unitful.Quantity{Float64, 𝐌, Unitful.FreeUnits{(u,), 𝐌, nothing}}}, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}, Forces}
 	 ⋮
-	 Configuration{S, AtomsBase.FlexibleSystem{3, AtomsBase.Atom{3, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}, Unitful.Quantity{Float64, 𝐋 𝐓^-1, Unitful.FreeUnits{(a₀, s^-1), 𝐋 𝐓^-1, nothing}}, Unitful.Quantity{Float64, 𝐌, Unitful.FreeUnits{(u,), 𝐌, nothing}}}, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}, Energy, Forces}, Vector{Dict}[[Dict{Any, Any}("keywords" => ["Step", "PotEng", "KinEng", "TotEng", "Temp", "Volume", "Xlo", "Xhi", "Ylo", "Yhi", "Zlo", "Zhi"]), Dict{Any, Any}("data" => Real[109500, -118.56754033566662, 1.2468911443758697, -117.32064919129076, 90.1529877225114, 4481.320775643779, -8.243380533904219, 8.243380533904219, -8.243380533904219, 8.243380533904219, -8.243380533904219, 8.243380533904219])], [Dict{Any, Any}("keywords" => ["Step", "PotEng", "KinEng", "TotEng", "Temp", "Volume", "Xlo", "Xhi", "Ylo", "Yhi", "Zlo", "Zhi"]), Dict{Any, Any}("data" => Real[110000, -118.8191048880354, 1.3088999144548927, -117.5102049735805, 94.63635895570786, 4445.796913398657, -8.22154069868183, 8.22154069868183, -8.22154069868183, 8.22154069868183, -8.22154069868183, 8.22154069868183])], [Dict{Any, Any}("keywords" => ["Step", "PotEng", "KinEng", "TotEng", "Temp", "Volume", "Xlo", "Xhi", "Ylo", "Yhi", "Zlo", "Zhi"]), Dict{Any, Any}("data" => Real[110500, -118.66706916398354, 1.1040005887840023, -117.56306857519954, 79.82168449524809, 4443.609994398957, -8.220192399538881, 8.220192399538881, -8.220192399538881, 8.220192399538881, -8.220192399538881, 8.220192399538881])], [Dict{Any, Any}("keywords" => ["Step", "PotEng", "KinEng", "TotEng", "Temp", "Volume", "Xlo", "Xhi", "Ylo", "Yhi", "Zlo", "Zhi"]), Dict{Any, Any}("data" => Real[111000, -118.5424954601734, 1.253547941582279, -117.28894751859112, 90.63428888462772, 4457.032418979577, -8.228460752349738, 8.228460752349738, -8.228460752349738, 8.228460752349738, -8.228460752349738, 8.228460752349738])], [Dict{Any, Any}("keywords" => ["Step", "PotEng", "KinEng", "TotEng", "Temp", "Volume", "Xlo", "Xhi", "Ylo", "Yhi", "Zlo", "Zhi"]), Dict{Any, Any}("data" => Real[111500, -118.60598321165922, 1.2766945282051063, -117.32928868345411, 92.30783829512603, 4472.0581396906955, -8.23769708292504, 8.23769708292504, -8.23769708292504, 8.23769708292504, -8.23769708292504, 8.23769708292504])], [Dict{Any, Any}("keywords" => ["Step", "PotEng", "KinEng", "TotEng", "Temp", "Volume", "Xlo", "Xhi", "Ylo", "Yhi", "Zlo", "Zhi"]), Dict{Any, Any}("data" => Real[112000, -118.85324930143875, 1.3425751052444483, -117.5106741961943, 97.0711497355587, 4466.470566415444, -8.234264813932816, 8.234264813932816, -8.234264813932816, 8.234264813932816, -8.234264813932816, 8.234264813932816])], [Dict{Any, Any}("keywords" => ["Step", "PotEng", "KinEng", "TotEng", "Temp", "Volume", "Xlo", "Xhi", "Ylo", "Yhi", "Zlo", "Zhi"]), Dict{Any, Any}("data" => Real[112500, -118.71245699254627, 1.1670894723589, -117.54536752018737, 84.38315032328688, 4468.368033253137, -8.235430688433015, 8.235430688433015, -8.235430688433015, 8.235430688433015, -8.235430688433015, 8.235430688433015])], [Dict{Any, Any}("keywords" => ["Step", "PotEng", "KinEng", "TotEng", "Temp", "Volume", "Xlo", "Xhi", "Ylo", "Yhi", "Zlo", "Zhi"]), Dict{Any, Any}("data" => Real[113000, -118.76694882093753, 1.2319510396827227, -117.5349977812548, 89.07278510735168, 4446.342141937924, -8.221876779064969, 8.221876779064969, -8.221876779064969, 8.221876779064969, -8.221876779064969, 8.221876779064969])], [Dict{Any, Any}("keywords" => ["Step", "PotEng", "KinEng", "TotEng", "Temp", "Volume", "Xlo", "Xhi", "Ylo", "Yhi", "Zlo", "Zhi"]), Dict{Any, Any}("data" => Real[113500, -118.51709527877453, 1.3207562411255773, -117.19633903764895, 95.49359759887054, 4437.23245692403, -8.216257934441625, 8.216257934441625, -8.216257934441625, 8.216257934441625, -8.216257934441625, 8.216257934441625])], [Dict{Any, Any}("keywords" => ["Step", "PotEng", "KinEng", "TotEng", "Temp", "Volume", "Xlo", "Xhi", "Ylo", "Yhi", "Zlo", "Zhi"]), Dict{Any, Any}("data" => Real[114000, -118.72667005007821, 1.2772963700128563, -117.44937368006535, 92.35135278903331, 4410.550998548226, -8.199756461230859, 8.199756461230859, -8.199756461230859, 8.199756461230859, -8.199756461230859, 8.199756461230859])]  …  [Dict{Any, Any}("keywords" => ["Step", "PotEng", "KinEng", "TotEng", "Temp", "Volume", "Xlo", "Xhi", "Ylo", "Yhi", "Zlo", "Zhi"]), Dict{Any, Any}("data" => Real[1150500, -111.33274572565541, 4.329760927088277, -107.00298479856714, 313.05129197672164, 4881.2260943202855, -8.481636303280883, 8.481636303280883, -8.481636303280883, 8.481636303280883, -8.481636303280883, 8.481636303280883])], [Dict{Any, Any}("keywords" => ["Step", "PotEng", "KinEng", "TotEng", "Temp", "Volume", "Xlo", "Xhi", "Ylo", "Yhi", "Zlo", "Zhi"]), Dict{Any, Any}("data" => Real[1151000, -112.05085995319563, 4.005480215432024, -108.0453797377636, 289.60507925120993, 4881.2260943202855, -8.481636303280883, 8.481636303280883, -8.481636303280883, 8.481636303280883, -8.481636303280883, 8.481636303280883])], [Dict{Any, Any}("keywords" => ["Step", "PotEng", "KinEng", "TotEng", "Temp", "Volume", "Xlo", "Xhi", "Ylo", "Yhi", "Zlo", "Zhi"]), Dict{Any, Any}("data" => Real[1151500, -111.93748415461936, 4.854075903442631, -107.08340825117672, 350.9604244933883, 4881.2260943202855, -8.481636303280883, 8.481636303280883, -8.481636303280883, 8.481636303280883, -8.481636303280883, 8.481636303280883])], [Dict{Any, Any}("keywords" => ["Step", "PotEng", "KinEng", "TotEng", "Temp", "Volume", "Xlo", "Xhi", "Ylo", "Yhi", "Zlo", "Zhi"]), Dict{Any, Any}("data" => Real[1152000, -113.07999770701338, 4.265828336045448, -108.81416937096793, 308.4288242325647, 4881.2260943202855, -8.481636303280883, 8.481636303280883, -8.481636303280883, 8.481636303280883, -8.481636303280883, 8.481636303280883])], [Dict{Any, Any}("keywords" => ["Step", "PotEng", "KinEng", "TotEng", "Temp", "Volume", "Xlo", "Xhi", "Ylo", "Yhi", "Zlo", "Zhi"]), Dict{Any, Any}("data" => Real[1152500, -112.41525332679798, 4.987262862658069, -107.42799046413991, 360.5901362393629, 4881.2260943202855, -8.481636303280883, 8.481636303280883, -8.481636303280883, 8.481636303280883, -8.481636303280883, 8.481636303280883])], [Dict{Any, Any}("keywords" => ["Step", "PotEng", "KinEng", "TotEng", "Temp", "Volume", "Xlo", "Xhi", "Ylo", "Yhi", "Zlo", "Zhi"]), Dict{Any, Any}("data" => Real[1153000, -111.8906050438705, 4.365236171743513, -107.52536887212698, 315.61623063257963, 4881.2260943202855, -8.481636303280883, 8.481636303280883, -8.481636303280883, 8.481636303280883, -8.481636303280883, 8.481636303280883])], [Dict{Any, Any}("keywords" => ["Step", "PotEng", "KinEng", "TotEng", "Temp", "Volume", "Xlo", "Xhi", "Ylo", "Yhi", "Zlo", "Zhi"]), Dict{Any, Any}("data" => Real[1153500, -111.78815670229865, 4.611141339238888, -107.17701536305977, 333.395718157298, 4881.2260943202855, -8.481636303280883, 8.481636303280883, -8.481636303280883, 8.481636303280883, -8.481636303280883, 8.481636303280883])], [Dict{Any, Any}("keywords" => ["Step", "PotEng", "KinEng", "TotEng", "Temp", "Volume", "Xlo", "Xhi", "Ylo", "Yhi", "Zlo", "Zhi"]), Dict{Any, Any}("data" => Real[1154000, -112.488679423801, 4.081705353887927, -108.40697406991308, 295.11632536307604, 4881.2260943202855, -8.481636303280883, 8.481636303280883, -8.481636303280883, 8.481636303280883, -8.481636303280883, 8.481636303280883])], [Dict{Any, Any}("keywords" => ["Step", "PotEng", "KinEng", "TotEng", "Temp", "Volume", "Xlo", "Xhi", "Ylo", "Yhi", "Zlo", "Zhi"]), Dict{Any, Any}("data" => Real[1154500, -111.6431739577287, 3.906342818047219, -107.73683113968148, 282.43722613942305, 4881.2260943202855, -8.481636303280883, 8.481636303280883, -8.481636303280883, 8.481636303280883, -8.481636303280883, 8.481636303280883])], [Dict{Any, Any}("keywords" => ["Step", "PotEng", "KinEng", "TotEng", "Temp", "Volume", "Xlo", "Xhi", "Ylo", "Yhi", "Zlo", "Zhi"]), Dict{Any, Any}("data" => Real[1155000, -111.57970314361862, 4.291823239871932, -107.28787990374668, 310.3083132770473, 4881.2260943202855, -8.481636303280883, 8.481636303280883, -8.481636303280883, 8.481636303280883, -8.481636303280883, 8.481636303280883])]])

Split atomistic dataset into training and test.

conf_train, conf_test = confs[1:1000], confs[1001:end]
(DataSet{num_configs = 1000} 
-	 Configuration{S, AtomsBase.FlexibleSystem{3, AtomsBase.Atom{3, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}, Unitful.Quantity{Float64, 𝐋 𝐓^-1, Unitful.FreeUnits{(a₀, s^-1), 𝐋 𝐓^-1, nothing}}, Unitful.Quantity{Float64, 𝐌, Unitful.FreeUnits{(u,), 𝐌, nothing}}}, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}, Energy, Forces}
-	 Configuration{S, AtomsBase.FlexibleSystem{3, AtomsBase.Atom{3, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}, Unitful.Quantity{Float64, 𝐋 𝐓^-1, Unitful.FreeUnits{(a₀, s^-1), 𝐋 𝐓^-1, nothing}}, Unitful.Quantity{Float64, 𝐌, Unitful.FreeUnits{(u,), 𝐌, nothing}}}, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}, Energy, Forces}
+	 Configuration{S, Energy, AtomsBase.FlexibleSystem{3, AtomsBase.Atom{3, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}, Unitful.Quantity{Float64, 𝐋 𝐓^-1, Unitful.FreeUnits{(a₀, s^-1), 𝐋 𝐓^-1, nothing}}, Unitful.Quantity{Float64, 𝐌, Unitful.FreeUnits{(u,), 𝐌, nothing}}}, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}, Forces}, Vector{Dict}[[Dict{Any, Any}("keywords" => ["Step", "PotEng", "KinEng", "TotEng", "Temp", "Volume", "Xlo", "Xhi", "Ylo", "Yhi", "Zlo", "Zhi"]), Dict{Any, Any}("data" => Real[109500, -118.56754033566662, 1.2468911443758697, -117.32064919129076, 90.1529877225114, 4481.320775643779, -8.243380533904219, 8.243380533904219, -8.243380533904219, 8.243380533904219, -8.243380533904219, 8.243380533904219])], [Dict{Any, Any}("keywords" => ["Step", "PotEng", "KinEng", "TotEng", "Temp", "Volume", "Xlo", "Xhi", "Ylo", "Yhi", "Zlo", "Zhi"]), Dict{Any, Any}("data" => Real[110000, -118.8191048880354, 1.3088999144548927, -117.5102049735805, 94.63635895570786, 4445.796913398657, -8.22154069868183, 8.22154069868183, -8.22154069868183, 8.22154069868183, -8.22154069868183, 8.22154069868183])], [Dict{Any, Any}("keywords" => ["Step", "PotEng", "KinEng", "TotEng", "Temp", "Volume", "Xlo", "Xhi", "Ylo", "Yhi", "Zlo", "Zhi"]), Dict{Any, Any}("data" => Real[110500, -118.66706916398354, 1.1040005887840023, -117.56306857519954, 79.82168449524809, 4443.609994398957, -8.220192399538881, 8.220192399538881, -8.220192399538881, 8.220192399538881, -8.220192399538881, 8.220192399538881])], [Dict{Any, Any}("keywords" => ["Step", "PotEng", "KinEng", "TotEng", "Temp", "Volume", "Xlo", "Xhi", "Ylo", "Yhi", "Zlo", "Zhi"]), Dict{Any, Any}("data" => Real[111000, -118.5424954601734, 1.253547941582279, -117.28894751859112, 90.63428888462772, 4457.032418979577, -8.228460752349738, 8.228460752349738, -8.228460752349738, 8.228460752349738, -8.228460752349738, 8.228460752349738])], [Dict{Any, Any}("keywords" => ["Step", "PotEng", "KinEng", "TotEng", "Temp", "Volume", "Xlo", "Xhi", "Ylo", "Yhi", "Zlo", "Zhi"]), Dict{Any, Any}("data" => Real[111500, -118.60598321165922, 1.2766945282051063, -117.32928868345411, 92.30783829512603, 4472.0581396906955, -8.23769708292504, 8.23769708292504, -8.23769708292504, 8.23769708292504, -8.23769708292504, 8.23769708292504])], [Dict{Any, Any}("keywords" => ["Step", "PotEng", "KinEng", "TotEng", "Temp", "Volume", "Xlo", "Xhi", "Ylo", "Yhi", "Zlo", "Zhi"]), Dict{Any, Any}("data" => Real[112000, -118.85324930143875, 1.3425751052444483, -117.5106741961943, 97.0711497355587, 4466.470566415444, -8.234264813932816, 8.234264813932816, -8.234264813932816, 8.234264813932816, -8.234264813932816, 8.234264813932816])], [Dict{Any, Any}("keywords" => ["Step", "PotEng", "KinEng", "TotEng", "Temp", "Volume", "Xlo", "Xhi", "Ylo", "Yhi", "Zlo", "Zhi"]), Dict{Any, Any}("data" => Real[112500, -118.71245699254627, 1.1670894723589, -117.54536752018737, 84.38315032328688, 4468.368033253137, -8.235430688433015, 8.235430688433015, -8.235430688433015, 8.235430688433015, -8.235430688433015, 8.235430688433015])], [Dict{Any, Any}("keywords" => ["Step", "PotEng", "KinEng", "TotEng", "Temp", "Volume", "Xlo", "Xhi", "Ylo", "Yhi", "Zlo", "Zhi"]), Dict{Any, Any}("data" => Real[113000, -118.76694882093753, 1.2319510396827227, -117.5349977812548, 89.07278510735168, 4446.342141937924, -8.221876779064969, 8.221876779064969, -8.221876779064969, 8.221876779064969, -8.221876779064969, 8.221876779064969])], [Dict{Any, Any}("keywords" => ["Step", "PotEng", "KinEng", "TotEng", "Temp", "Volume", "Xlo", "Xhi", "Ylo", "Yhi", "Zlo", "Zhi"]), Dict{Any, Any}("data" => Real[113500, -118.51709527877453, 1.3207562411255773, -117.19633903764895, 95.49359759887054, 4437.23245692403, -8.216257934441625, 8.216257934441625, -8.216257934441625, 8.216257934441625, -8.216257934441625, 8.216257934441625])], [Dict{Any, Any}("keywords" => ["Step", "PotEng", "KinEng", "TotEng", "Temp", "Volume", "Xlo", "Xhi", "Ylo", "Yhi", "Zlo", "Zhi"]), Dict{Any, Any}("data" => Real[114000, -118.72667005007821, 1.2772963700128563, -117.44937368006535, 92.35135278903331, 4410.550998548226, -8.199756461230859, 8.199756461230859, -8.199756461230859, 8.199756461230859, -8.199756461230859, 8.199756461230859])]  …  [Dict{Any, Any}("keywords" => ["Step", "PotEng", "KinEng", "TotEng", "Temp", "Volume", "Xlo", "Xhi", "Ylo", "Yhi", "Zlo", "Zhi"]), Dict{Any, Any}("data" => Real[1150500, -111.33274572565541, 4.329760927088277, -107.00298479856714, 313.05129197672164, 4881.2260943202855, -8.481636303280883, 8.481636303280883, -8.481636303280883, 8.481636303280883, -8.481636303280883, 8.481636303280883])], [Dict{Any, Any}("keywords" => ["Step", "PotEng", "KinEng", "TotEng", "Temp", "Volume", "Xlo", "Xhi", "Ylo", "Yhi", "Zlo", "Zhi"]), Dict{Any, Any}("data" => Real[1151000, -112.05085995319563, 4.005480215432024, -108.0453797377636, 289.60507925120993, 4881.2260943202855, -8.481636303280883, 8.481636303280883, -8.481636303280883, 8.481636303280883, -8.481636303280883, 8.481636303280883])], [Dict{Any, Any}("keywords" => ["Step", "PotEng", "KinEng", "TotEng", "Temp", "Volume", "Xlo", "Xhi", "Ylo", "Yhi", "Zlo", "Zhi"]), Dict{Any, Any}("data" => Real[1151500, -111.93748415461936, 4.854075903442631, -107.08340825117672, 350.9604244933883, 4881.2260943202855, -8.481636303280883, 8.481636303280883, -8.481636303280883, 8.481636303280883, -8.481636303280883, 8.481636303280883])], [Dict{Any, Any}("keywords" => ["Step", "PotEng", "KinEng", "TotEng", "Temp", "Volume", "Xlo", "Xhi", "Ylo", "Yhi", "Zlo", "Zhi"]), Dict{Any, Any}("data" => Real[1152000, -113.07999770701338, 4.265828336045448, -108.81416937096793, 308.4288242325647, 4881.2260943202855, -8.481636303280883, 8.481636303280883, -8.481636303280883, 8.481636303280883, -8.481636303280883, 8.481636303280883])], [Dict{Any, Any}("keywords" => ["Step", "PotEng", "KinEng", "TotEng", "Temp", "Volume", "Xlo", "Xhi", "Ylo", "Yhi", "Zlo", "Zhi"]), Dict{Any, Any}("data" => Real[1152500, -112.41525332679798, 4.987262862658069, -107.42799046413991, 360.5901362393629, 4881.2260943202855, -8.481636303280883, 8.481636303280883, -8.481636303280883, 8.481636303280883, -8.481636303280883, 8.481636303280883])], [Dict{Any, Any}("keywords" => ["Step", "PotEng", "KinEng", "TotEng", "Temp", "Volume", "Xlo", "Xhi", "Ylo", "Yhi", "Zlo", "Zhi"]), Dict{Any, Any}("data" => Real[1153000, -111.8906050438705, 4.365236171743513, -107.52536887212698, 315.61623063257963, 4881.2260943202855, -8.481636303280883, 8.481636303280883, -8.481636303280883, 8.481636303280883, -8.481636303280883, 8.481636303280883])], [Dict{Any, Any}("keywords" => ["Step", "PotEng", "KinEng", "TotEng", "Temp", "Volume", "Xlo", "Xhi", "Ylo", "Yhi", "Zlo", "Zhi"]), Dict{Any, Any}("data" => Real[1153500, -111.78815670229865, 4.611141339238888, -107.17701536305977, 333.395718157298, 4881.2260943202855, -8.481636303280883, 8.481636303280883, -8.481636303280883, 8.481636303280883, -8.481636303280883, 8.481636303280883])], [Dict{Any, Any}("keywords" => ["Step", "PotEng", "KinEng", "TotEng", "Temp", "Volume", "Xlo", "Xhi", "Ylo", "Yhi", "Zlo", "Zhi"]), Dict{Any, Any}("data" => Real[1154000, -112.488679423801, 4.081705353887927, -108.40697406991308, 295.11632536307604, 4881.2260943202855, -8.481636303280883, 8.481636303280883, -8.481636303280883, 8.481636303280883, -8.481636303280883, 8.481636303280883])], [Dict{Any, Any}("keywords" => ["Step", "PotEng", "KinEng", "TotEng", "Temp", "Volume", "Xlo", "Xhi", "Ylo", "Yhi", "Zlo", "Zhi"]), Dict{Any, Any}("data" => Real[1154500, -111.6431739577287, 3.906342818047219, -107.73683113968148, 282.43722613942305, 4881.2260943202855, -8.481636303280883, 8.481636303280883, -8.481636303280883, 8.481636303280883, -8.481636303280883, 8.481636303280883])], [Dict{Any, Any}("keywords" => ["Step", "PotEng", "KinEng", "TotEng", "Temp", "Volume", "Xlo", "Xhi", "Ylo", "Yhi", "Zlo", "Zhi"]), Dict{Any, Any}("data" => Real[1155000, -111.57970314361862, 4.291823239871932, -107.28787990374668, 310.3083132770473, 4881.2260943202855, -8.481636303280883, 8.481636303280883, -8.481636303280883, 8.481636303280883, -8.481636303280883, 8.481636303280883])]])

Split atomistic dataset into training and test.

conf_train, conf_test = confs[1:1000], confs[1001:end]
(DataSet{num_configs = 1000} 
+	 Configuration{S, Energy, AtomsBase.FlexibleSystem{3, AtomsBase.Atom{3, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}, Unitful.Quantity{Float64, 𝐋 𝐓^-1, Unitful.FreeUnits{(a₀, s^-1), 𝐋 𝐓^-1, nothing}}, Unitful.Quantity{Float64, 𝐌, Unitful.FreeUnits{(u,), 𝐌, nothing}}}, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}, Forces}
+	 Configuration{S, Energy, AtomsBase.FlexibleSystem{3, AtomsBase.Atom{3, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}, Unitful.Quantity{Float64, 𝐋 𝐓^-1, Unitful.FreeUnits{(a₀, s^-1), 𝐋 𝐓^-1, nothing}}, Unitful.Quantity{Float64, 𝐌, Unitful.FreeUnits{(u,), 𝐌, nothing}}}, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}, Forces}
 	 ⋮
-	 Configuration{S, AtomsBase.FlexibleSystem{3, AtomsBase.Atom{3, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}, Unitful.Quantity{Float64, 𝐋 𝐓^-1, Unitful.FreeUnits{(a₀, s^-1), 𝐋 𝐓^-1, nothing}}, Unitful.Quantity{Float64, 𝐌, Unitful.FreeUnits{(u,), 𝐌, nothing}}}, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}, Energy, Forces}, DataSet{num_configs = 1092} 
-	 Configuration{S, AtomsBase.FlexibleSystem{3, AtomsBase.Atom{3, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}, Unitful.Quantity{Float64, 𝐋 𝐓^-1, Unitful.FreeUnits{(a₀, s^-1), 𝐋 𝐓^-1, nothing}}, Unitful.Quantity{Float64, 𝐌, Unitful.FreeUnits{(u,), 𝐌, nothing}}}, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}, Energy, Forces}
-	 Configuration{S, AtomsBase.FlexibleSystem{3, AtomsBase.Atom{3, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}, Unitful.Quantity{Float64, 𝐋 𝐓^-1, Unitful.FreeUnits{(a₀, s^-1), 𝐋 𝐓^-1, nothing}}, Unitful.Quantity{Float64, 𝐌, Unitful.FreeUnits{(u,), 𝐌, nothing}}}, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}, Energy, Forces}
+	 Configuration{S, Energy, AtomsBase.FlexibleSystem{3, AtomsBase.Atom{3, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}, Unitful.Quantity{Float64, 𝐋 𝐓^-1, Unitful.FreeUnits{(a₀, s^-1), 𝐋 𝐓^-1, nothing}}, Unitful.Quantity{Float64, 𝐌, Unitful.FreeUnits{(u,), 𝐌, nothing}}}, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}, Forces}, DataSet{num_configs = 1092} 
+	 Configuration{S, Energy, AtomsBase.FlexibleSystem{3, AtomsBase.Atom{3, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}, Unitful.Quantity{Float64, 𝐋 𝐓^-1, Unitful.FreeUnits{(a₀, s^-1), 𝐋 𝐓^-1, nothing}}, Unitful.Quantity{Float64, 𝐌, Unitful.FreeUnits{(u,), 𝐌, nothing}}}, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}, Forces}
+	 Configuration{S, Energy, AtomsBase.FlexibleSystem{3, AtomsBase.Atom{3, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}, Unitful.Quantity{Float64, 𝐋 𝐓^-1, Unitful.FreeUnits{(a₀, s^-1), 𝐋 𝐓^-1, nothing}}, Unitful.Quantity{Float64, 𝐌, Unitful.FreeUnits{(u,), 𝐌, nothing}}}, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}, Forces}
 	 ⋮
-	 Configuration{S, AtomsBase.FlexibleSystem{3, AtomsBase.Atom{3, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}, Unitful.Quantity{Float64, 𝐋 𝐓^-1, Unitful.FreeUnits{(a₀, s^-1), 𝐋 𝐓^-1, nothing}}, Unitful.Quantity{Float64, 𝐌, Unitful.FreeUnits{(u,), 𝐌, nothing}}}, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}, Energy, Forces})

Create ACE basis, compute energy descriptors and add them to the dataset.

Create ACE basis.

ace = ACE(species = [:Na],         # species
+	 Configuration{S, Energy, AtomsBase.FlexibleSystem{3, AtomsBase.Atom{3, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}, Unitful.Quantity{Float64, 𝐋 𝐓^-1, Unitful.FreeUnits{(a₀, s^-1), 𝐋 𝐓^-1, nothing}}, Unitful.Quantity{Float64, 𝐌, Unitful.FreeUnits{(u,), 𝐌, nothing}}}, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}, Forces})

Create ACE basis, compute energy descriptors and add them to the dataset.

Create ACE basis.

ace = ACE(species = [:Na],         # species
           body_order = 4,          # 4-body
           polynomial_degree = 8,   # 8 degree polynomials
           wL = 1.0,                # Defaults, See ACE.jl documentation
           csp = 1.0,               # Defaults, See ACE.jl documentation
           r0 = 1.0,                # minimum distance between atoms
-          rcutoff = 5.0)           # cutoff radius
InteratomicPotentials.ACE([:Na], 4, 8, 5.0, 1.0, 1.0, 1.0, ACE1.RPI.RPIBasis{Float64, ACE1.RPI.BasicPSH1pBasis{Float64, 1, ACE1.OrthPolys.TransformedPolys{Float64, ACE1.Transforms.PolyTransform{Int64, Float64}, ACE1.OrthPolys.OrthPolyBasis{Float64}, ACE1.OrthPolys.OneEnvelope}}, 1, ACE1.DAGEvaluator}(ACE1.PIBasis{ACE1.RPI.BasicPSH1pBasis{Float64, 1, ACE1.OrthPolys.TransformedPolys{Float64, ACE1.Transforms.PolyTransform{Int64, Float64}, ACE1.OrthPolys.OrthPolyBasis{Float64}, ACE1.OrthPolys.OneEnvelope}}, 1, ACE1.DAGEvaluator}(ACE1.RPI.BasicPSH1pBasis{Float64, 1, ACE1.OrthPolys.TransformedPolys{Float64, ACE1.Transforms.PolyTransform{Int64, Float64}, ACE1.OrthPolys.OrthPolyBasis{Float64}, ACE1.OrthPolys.OneEnvelope}}(ACE1.OrthPolys.TransformedPolys{Float64, ACE1.Transforms.PolyTransform{Int64, Float64}, ACE1.OrthPolys.OrthPolyBasis{Float64}, ACE1.OrthPolys.OneEnvelope}(ACE1.OrthPolys.OrthPolyBasis{Float64}(2, 0.1111111111111111, 0, 1.4692378328741966, [1.2122846178990336, 5.227280512910888, 3.8961916731449633, 3.4886755208481057, 3.3018911797277886, 3.1988782330379095, 3.1354893667826973, 3.093509091814522], [0.0, -6.496897603120461, -3.9605854355556267, -3.2304583771700464, -2.908013820175524, -2.734530541817598, -2.629640563396752, -2.5610802914456907], [0.0, 0.0, -0.7453572968815758, -0.8954065440091857, -0.9464598126125192, -0.9688018347417594, -0.9801840327648189, -0.9866112526443516], [0.11179017447199265, 0.11314830119375573, 0.11450642791551882, 0.1158645546372819, 0.11722268135904498, 0.11858080808080808, 0.11993893480257116, 0.12129706152433424, 0.12265518824609734, 0.12401331496786042  …  1.4563356290174474, 1.4576937557392105, 1.4590518824609735, 1.4604100091827366, 1.4617681359044996, 1.4631262626262627, 1.464484389348026, 1.465842516069789, 1.467200642791552, 1.468558769513315], [0.001, 0.001, 0.001, 0.001, 0.001, 0.001, 0.001, 0.001, 0.001, 0.001  …  0.001, 0.001, 0.001, 0.001, 0.001, 0.001, 0.001, 0.001, 0.001, 0.001]), ACE1.Transforms.PolyTransform{Int64, Float64}(2, 1.0, 1.0), 0.65, 5.0, ACE1.OrthPolys.OneEnvelope()), ACE1.SphericalHarmonics.SHBasis{Float64}(7, ACE1.SphericalHarmonics.ALPCoefficients{Float64}([8.06358400705e-313, 8.7001827449e-313, 1.230757559017e-312, 1.9364916731037085, 9.9733802198e-313, 9.1245819036e-313, 1.9720265943665387, 2.091650066335189, 1.358077306524e-312, 1.506617011926e-312  …  2.69493465515e-312, 5.04e-322, 1.9948914348241344, 2.0155644370746373, 2.0816659994661326, 2.207940216581962, 2.4308621740219887, 2.850438562747845, 3.034453981737e-312, 2.992014065972e-312], [6.91982784122163e-310, 6.9198278412224e-310, 6.9198278412232e-310, -0.5773502691896257, 6.9198441928317e-310, 6.9198441761552e-310, -0.5163977794943222, -0.4472135954999579, 6.9198278422319e-310, 6.9198278422327e-310  …  6.91984417618997e-310, 6.91984417619155e-310, -0.5017452060042545, -0.4947274449181537, -0.47304991679126607, -0.4345240946267408, -0.3739787960033829, -0.2773500981126146, 6.91984417620103e-310, 6.9198441762026e-310])), JuLIP.Potentials.SZList{1}(JuLIP.Chemistry.AtomicNumber[<11>]), ACE1.RPI.PSH1pBasisFcn[znlm[0|1,0,0], znlm[0|1,1,-1], znlm[0|1,1,0], znlm[0|1,1,1], znlm[0|1,2,-2], znlm[0|1,2,-1], znlm[0|1,2,0], znlm[0|1,2,1], znlm[0|1,2,2], znlm[0|1,3,-3]  …  znlm[0|6,2,-2], znlm[0|6,2,-1], znlm[0|6,2,0], znlm[0|6,2,1], znlm[0|6,2,2], znlm[0|7,0,0], znlm[0|7,1,-1], znlm[0|7,1,0], znlm[0|7,1,1], znlm[0|8,0,0]], UnitRange{Int64}[1:204;;]), JuLIP.Potentials.SZList{1}(JuLIP.Chemistry.AtomicNumber[<11>]), (ACE1.InnerPIBasis([1, 1, 1, 1, 1, 1, 1, 1, 2, 2  …  3, 3, 3, 3, 3, 3, 3, 3, 3, 3], [1 0 0; 65 0 0; … ; 65 67 67; 65 114 114], Dict{ACE1.PIBasisFcn, Int64}(ACE1.PIBasisFcn{2, ACE1.RPI.PSH1pBasisFcn}(<11>, (znlm[11|1,2,0], znlm[11|3,0,0]), ACE1.RPI.PSH1pBasisFcn) => 63, ACE1.PIBasisFcn{2, ACE1.RPI.PSH1pBasisFcn}(<11>, (znlm[11|1,2,2], znlm[11|3,2,-2]), ACE1.RPI.PSH1pBasisFcn) => 72, ACE1.PIBasisFcn{3, ACE1.RPI.PSH1pBasisFcn}(<11>, (znlm[11|1,1,0], znlm[11|1,1,0], znlm[11|3,0,0]), ACE1.RPI.PSH1pBasisFcn) => 194, ACE1.PIBasisFcn{3, ACE1.RPI.PSH1pBasisFcn}(<11>, (znlm[11|1,0,0], znlm[11|2,0,0], znlm[11|2,0,0]), ACE1.RPI.PSH1pBasisFcn) => 161, ACE1.PIBasisFcn{2, ACE1.RPI.PSH1pBasisFcn}(<11>, (znlm[11|1,2,0], znlm[11|1,4,0]), ACE1.RPI.PSH1pBasisFcn) => 60, ACE1.PIBasisFcn{3, ACE1.RPI.PSH1pBasisFcn}(<11>, (znlm[11|1,1,0], znlm[11|1,1,0], znlm[11|2,2,0]), ACE1.RPI.PSH1pBasisFcn) => 193, ACE1.PIBasisFcn{3, ACE1.RPI.PSH1pBasisFcn}(<11>, (znlm[11|1,0,0], znlm[11|1,1,0], znlm[11|2,1,0]), ACE1.RPI.PSH1pBasisFcn) => 137, ACE1.PIBasisFcn{2, ACE1.RPI.PSH1pBasisFcn}(<11>, (znlm[11|1,1,1], znlm[11|3,3,-1]), ACE1.RPI.PSH1pBasisFcn) => 48, ACE1.PIBasisFcn{2, ACE1.RPI.PSH1pBasisFcn}(<11>, (znlm[11|1,2,0], znlm[11|2,2,0]), ACE1.RPI.PSH1pBasisFcn) => 62, ACE1.PIBasisFcn{3, ACE1.RPI.PSH1pBasisFcn}(<11>, (znlm[11|1,1,0], znlm[11|2,0,0], znlm[11|3,1,0]), ACE1.RPI.PSH1pBasisFcn) => 203…), Dict{Any, Int64}(znlm[11|3,1,-1] => 115, znlm[11|3,2,-2] => 118, znlm[11|8,0,0] => 204, znlm[11|5,3,3] => 190, znlm[11|2,2,1] => 72, znlm[11|2,5,1] => 96, znlm[11|1,7,-3] => 54, znlm[11|1,2,1] => 8, znlm[11|1,7,-4] => 53, znlm[11|1,5,-2] => 29…), 1:225, <11>, ACE1.DAG.CorrEvalGraph{Int64, Int64}([(1, 0), (2, 0), (3, 0), (4, 0), (5, 0), (6, 0), (7, 0), (8, 0), (9, 0), (10, 0)  …  (232, 65), (233, 65), (233, 114), (239, 65), (239, 71), (239, 114), (239, 150), (65, 241), (65, 243), (240, 114)], [1, 0, 0, 0, 0, 0, 0, 0, 0, 0  …  216, 217, 218, 219, 220, 221, 222, 223, 224, 225], 204, 255)),), ACE1.DAGEvaluator()), (sparse([1, 2, 3, 4, 5, 6, 7, 8, 9, 10  …  67, 68, 68, 68, 69, 70, 71, 72, 72, 73], [1, 2, 3, 4, 5, 6, 7, 8, 9, 13  …  213, 214, 215, 216, 219, 221, 222, 223, 224, 225], [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.4142135623730951, 1.0  …  -0.5773502691896257, -1.264911064067351, 1.2649110640673515, -0.6324555320336758, 2.449489742783178, 1.4142135623730951, 1.4142135623730951, -1.6329931618554525, 0.816496580927726, 1.4142135623730951], 73, 225),), (1:73,)))

Update training dataset by adding energy (local) descriptors.

println("Computing local descriptors of training dataset")
+          rcutoff = 5.0)           # cutoff radius
InteratomicPotentials.ACE([:Na], 4, 8, 5.0, 1.0, 1.0, 1.0, ACE1.RPI.RPIBasis{Float64, ACE1.RPI.BasicPSH1pBasis{Float64, 1, ACE1.OrthPolys.TransformedPolys{Float64, ACE1.Transforms.PolyTransform{Int64, Float64}, ACE1.OrthPolys.OrthPolyBasis{Float64}, ACE1.OrthPolys.OneEnvelope}}, 1, ACE1.DAGEvaluator}(ACE1.PIBasis{ACE1.RPI.BasicPSH1pBasis{Float64, 1, ACE1.OrthPolys.TransformedPolys{Float64, ACE1.Transforms.PolyTransform{Int64, Float64}, ACE1.OrthPolys.OrthPolyBasis{Float64}, ACE1.OrthPolys.OneEnvelope}}, 1, ACE1.DAGEvaluator}(ACE1.RPI.BasicPSH1pBasis{Float64, 1, ACE1.OrthPolys.TransformedPolys{Float64, ACE1.Transforms.PolyTransform{Int64, Float64}, ACE1.OrthPolys.OrthPolyBasis{Float64}, ACE1.OrthPolys.OneEnvelope}}(ACE1.OrthPolys.TransformedPolys{Float64, ACE1.Transforms.PolyTransform{Int64, Float64}, ACE1.OrthPolys.OrthPolyBasis{Float64}, ACE1.OrthPolys.OneEnvelope}(ACE1.OrthPolys.OrthPolyBasis{Float64}(2, 0.1111111111111111, 0, 1.4692378328741966, [1.2122846178990336, 5.227280512910888, 3.8961916731449633, 3.4886755208481057, 3.3018911797277886, 3.1988782330379095, 3.1354893667826973, 3.093509091814522], [0.0, -6.496897603120461, -3.9605854355556267, -3.2304583771700464, -2.908013820175524, -2.734530541817598, -2.629640563396752, -2.5610802914456907], [0.0, 0.0, -0.7453572968815758, -0.8954065440091857, -0.9464598126125192, -0.9688018347417594, -0.9801840327648189, -0.9866112526443516], [0.11179017447199265, 0.11314830119375573, 0.11450642791551882, 0.1158645546372819, 0.11722268135904498, 0.11858080808080808, 0.11993893480257116, 0.12129706152433424, 0.12265518824609734, 0.12401331496786042  …  1.4563356290174474, 1.4576937557392105, 1.4590518824609735, 1.4604100091827366, 1.4617681359044996, 1.4631262626262627, 1.464484389348026, 1.465842516069789, 1.467200642791552, 1.468558769513315], [0.001, 0.001, 0.001, 0.001, 0.001, 0.001, 0.001, 0.001, 0.001, 0.001  …  0.001, 0.001, 0.001, 0.001, 0.001, 0.001, 0.001, 0.001, 0.001, 0.001]), ACE1.Transforms.PolyTransform{Int64, Float64}(2, 1.0, 1.0), 0.65, 5.0, ACE1.OrthPolys.OneEnvelope()), ACE1.SphericalHarmonics.SHBasis{Float64}(7, ACE1.SphericalHarmonics.ALPCoefficients{Float64}([6.94645451611095e-310, 6.94645451611253e-310, 6.9464545161141e-310, 1.9364916731037085, 6.94645451611727e-310, 6.94645451611885e-310, 1.9720265943665387, 2.091650066335189, 6.9464545161236e-310, 6.9464867785751e-310  …  6.9464867789091e-310, 6.94645451613466e-310, 1.9948914348241344, 2.0155644370746373, 2.0816659994661326, 2.207940216581962, 2.4308621740219887, 2.850438562747845, 6.9464545161394e-310, 6.9464851776107e-310], [5.0e-324, 1.0e-323, 1.5e-323, -0.5773502691896257, 2.5e-323, 3.0e-323, -0.5163977794943222, -0.4472135954999579, 4.4e-323, 5.0e-323  …  1.33e-322, 1.4e-322, -0.5017452060042545, -0.4947274449181537, -0.47304991679126607, -0.4345240946267408, -0.3739787960033829, -0.2773500981126146, 1.73e-322, 1.8e-322])), JuLIP.Potentials.SZList{1}(JuLIP.Chemistry.AtomicNumber[<11>]), ACE1.RPI.PSH1pBasisFcn[znlm[0|1,0,0], znlm[0|1,1,-1], znlm[0|1,1,0], znlm[0|1,1,1], znlm[0|1,2,-2], znlm[0|1,2,-1], znlm[0|1,2,0], znlm[0|1,2,1], znlm[0|1,2,2], znlm[0|1,3,-3]  …  znlm[0|6,2,-2], znlm[0|6,2,-1], znlm[0|6,2,0], znlm[0|6,2,1], znlm[0|6,2,2], znlm[0|7,0,0], znlm[0|7,1,-1], znlm[0|7,1,0], znlm[0|7,1,1], znlm[0|8,0,0]], UnitRange{Int64}[1:204;;]), JuLIP.Potentials.SZList{1}(JuLIP.Chemistry.AtomicNumber[<11>]), (ACE1.InnerPIBasis([1, 1, 1, 1, 1, 1, 1, 1, 2, 2  …  3, 3, 3, 3, 3, 3, 3, 3, 3, 3], [1 0 0; 65 0 0; … ; 65 67 67; 65 114 114], Dict{ACE1.PIBasisFcn, Int64}(ACE1.PIBasisFcn{3, ACE1.RPI.PSH1pBasisFcn}(<11>, (znlm[11|1,1,-1], znlm[11|1,1,-1], znlm[11|1,2,2]), ACE1.RPI.PSH1pBasisFcn) => 175, ACE1.PIBasisFcn{3, ACE1.RPI.PSH1pBasisFcn}(<11>, (znlm[11|1,1,0], znlm[11|1,1,0], znlm[11|3,0,0]), ACE1.RPI.PSH1pBasisFcn) => 194, ACE1.PIBasisFcn{3, ACE1.RPI.PSH1pBasisFcn}(<11>, (znlm[11|1,0,0], znlm[11|1,0,0], znlm[11|5,0,0]), ACE1.RPI.PSH1pBasisFcn) => 127, ACE1.PIBasisFcn{2, ACE1.RPI.PSH1pBasisFcn}(<11>, (znlm[11|1,2,-2], znlm[11|1,4,2]), ACE1.RPI.PSH1pBasisFcn) => 52, ACE1.PIBasisFcn{3, ACE1.RPI.PSH1pBasisFcn}(<11>, (znlm[11|1,0,0], znlm[11|2,0,0], znlm[11|5,0,0]), ACE1.RPI.PSH1pBasisFcn) => 166, ACE1.PIBasisFcn{2, ACE1.RPI.PSH1pBasisFcn}(<11>, (znlm[11|1,1,1], znlm[11|4,1,-1]), ACE1.RPI.PSH1pBasisFcn) => 49, ACE1.PIBasisFcn{2, ACE1.RPI.PSH1pBasisFcn}(<11>, (znlm[11|1,2,2], znlm[11|2,2,-2]), ACE1.RPI.PSH1pBasisFcn) => 71, ACE1.PIBasisFcn{3, ACE1.RPI.PSH1pBasisFcn}(<11>, (znlm[11|2,0,0], znlm[11|2,0,0], znlm[11|4,0,0]), ACE1.RPI.PSH1pBasisFcn) => 222, ACE1.PIBasisFcn{2, ACE1.RPI.PSH1pBasisFcn}(<11>, (znlm[11|1,0,0], znlm[11|3,0,0]), ACE1.RPI.PSH1pBasisFcn) => 16, ACE1.PIBasisFcn{2, ACE1.RPI.PSH1pBasisFcn}(<11>, (znlm[11|1,2,-1], znlm[11|3,2,1]), ACE1.RPI.PSH1pBasisFcn) => 58…), Dict{Any, Int64}(znlm[11|3,4,4] => 138, znlm[11|2,2,0] => 71, znlm[11|1,5,-1] => 30, znlm[11|1,3,1] => 14, znlm[11|6,1,-1] => 192, znlm[11|4,4,1] => 171, znlm[11|2,6,0] => 107, znlm[11|3,5,2] => 146, znlm[11|1,5,-4] => 27, znlm[11|3,5,-4] => 140…), 1:225, <11>, ACE1.DAG.CorrEvalGraph{Int64, Int64}([(1, 0), (2, 0), (3, 0), (4, 0), (5, 0), (6, 0), (7, 0), (8, 0), (9, 0), (10, 0)  …  (232, 65), (233, 65), (233, 114), (239, 65), (239, 71), (239, 114), (239, 150), (65, 241), (65, 243), (240, 114)], [1, 0, 0, 0, 0, 0, 0, 0, 0, 0  …  216, 217, 218, 219, 220, 221, 222, 223, 224, 225], 204, 255)),), ACE1.DAGEvaluator()), (sparse([1, 2, 3, 4, 5, 6, 7, 8, 9, 10  …  67, 68, 68, 68, 69, 70, 71, 72, 72, 73], [1, 2, 3, 4, 5, 6, 7, 8, 9, 13  …  213, 214, 215, 216, 219, 221, 222, 223, 224, 225], [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.4142135623730951, 1.0  …  -0.5773502691896257, -1.264911064067351, 1.2649110640673515, -0.6324555320336758, 2.449489742783178, 1.4142135623730951, 1.4142135623730951, -1.6329931618554525, 0.816496580927726, 1.4142135623730951], 73, 225),), (1:73,)))

Update training dataset by adding energy (local) descriptors.

println("Computing local descriptors of training dataset")
 e_descr_train = compute_local_descriptors(conf_train, ace) # JLD.load("data/sodium_empirical_full.jld", "descriptors")
1000-element Vector{LocalDescriptors}:
  LocalDescriptors{n = 108, d = 73}
  LocalDescriptors{n = 108, d = 73}
@@ -43,43 +43,43 @@
  LocalDescriptors{n = 108, d = 73}
  LocalDescriptors{n = 108, d = 73}
  LocalDescriptors{n = 108, d = 73}

Update training dataset by adding energy and force descriptors.

ds_train = DataSet(conf_train .+ e_descr_train)
DataSet{num_configs = 1000} 
-	 Configuration{S, AtomsBase.FlexibleSystem{3, AtomsBase.Atom{3, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}, Unitful.Quantity{Float64, 𝐋 𝐓^-1, Unitful.FreeUnits{(a₀, s^-1), 𝐋 𝐓^-1, nothing}}, Unitful.Quantity{Float64, 𝐌, Unitful.FreeUnits{(u,), 𝐌, nothing}}}, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}, Energy, LocalDescriptors, Forces}
-	 Configuration{S, AtomsBase.FlexibleSystem{3, AtomsBase.Atom{3, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}, Unitful.Quantity{Float64, 𝐋 𝐓^-1, Unitful.FreeUnits{(a₀, s^-1), 𝐋 𝐓^-1, nothing}}, Unitful.Quantity{Float64, 𝐌, Unitful.FreeUnits{(u,), 𝐌, nothing}}}, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}, Energy, LocalDescriptors, Forces}
+	 Configuration{S, Energy, AtomsBase.FlexibleSystem{3, AtomsBase.Atom{3, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}, Unitful.Quantity{Float64, 𝐋 𝐓^-1, Unitful.FreeUnits{(a₀, s^-1), 𝐋 𝐓^-1, nothing}}, Unitful.Quantity{Float64, 𝐌, Unitful.FreeUnits{(u,), 𝐌, nothing}}}, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}, Forces, LocalDescriptors}
+	 Configuration{S, Energy, AtomsBase.FlexibleSystem{3, AtomsBase.Atom{3, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}, Unitful.Quantity{Float64, 𝐋 𝐓^-1, Unitful.FreeUnits{(a₀, s^-1), 𝐋 𝐓^-1, nothing}}, Unitful.Quantity{Float64, 𝐌, Unitful.FreeUnits{(u,), 𝐌, nothing}}}, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}, Forces, LocalDescriptors}
 	 ⋮
-	 Configuration{S, AtomsBase.FlexibleSystem{3, AtomsBase.Atom{3, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}, Unitful.Quantity{Float64, 𝐋 𝐓^-1, Unitful.FreeUnits{(a₀, s^-1), 𝐋 𝐓^-1, nothing}}, Unitful.Quantity{Float64, 𝐌, Unitful.FreeUnits{(u,), 𝐌, nothing}}}, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}, Energy, LocalDescriptors, Forces}

Subsampling via DPP.

Create DPP subselector.

dpp = kDPP(ds_train, GlobalMean(), DotProduct(); batch_size = 200)
kDPP(L-Ensemble.
+	 Configuration{S, Energy, AtomsBase.FlexibleSystem{3, AtomsBase.Atom{3, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}, Unitful.Quantity{Float64, 𝐋 𝐓^-1, Unitful.FreeUnits{(a₀, s^-1), 𝐋 𝐓^-1, nothing}}, Unitful.Quantity{Float64, 𝐌, Unitful.FreeUnits{(u,), 𝐌, nothing}}}, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}, Forces, LocalDescriptors}

Subsampling via DPP.

Create DPP subselector.

dpp = kDPP(ds_train, GlobalMean(), DotProduct(); batch_size = 200)
kDPP(L-Ensemble.
 Number of items in ground set : 1000. Max. rank : 1000. Rescaling constant α=4.306186451810486e14
 , 200)

Subsample trainig dataset.

dpp_inds = get_random_subset(dpp)
200-element Vector{Int64}:
-    4
-    9
+    2
    14
-   19
-   26
    27
-   36
-   53
-   63
+   28
+   37
+   43
+   45
+   57
    64
+   65
     ⋮
+  983
   988
   989
-  991
-  992
   993
   994
   995
-  999
+  996
+  997
  1000

Learn ACE coefficients based on ACE descriptors and DFT data.

lb = LBasisPotential(ace)
 α = 1e-8
-Σ = learn!(lb, ds_train[dpp_inds], α)
UnivariateLinearProblem{T, [-0.017574726287264753, 0.08813481871369788, -0.2371356001945344, 0.4435085466001709, -0.6186484398744057, 0.6234333524628681, -0.33212155570296886, -0.2689832564272763, 0.00047976763610113604, -0.002044623912340393, 0.007041194902297487, -0.018139241934585826, 0.038587179900021695, -0.0710638790510516, 0.11619318917728627, -0.0005900874353619301, 0.0022341033390720355, -0.006632926101211467, 0.014356477067359208, -0.025058049501339497, 0.0004327506497602829, -0.0016360053684442155, 0.004848206696383972, -0.0006845538998517808, 0.01731134791219624, -0.041848308806198276, 0.10702968577606953, -0.2261548550460759, 0.41402355019354076, -0.016924370903780073, 0.035552510940163984, -0.07701555320471698, 0.012381106037913536, 0.20069205755649477, -0.3599889623737411, 0.7548163859586163, -0.14949924628683675, 1.2806722889855031, 2.987509073479333e-5, -9.948769835035898e-5, 0.0003259225900231755, -0.0007974747003698379, 0.001614438997909029, -0.0028424148659720316, -8.190802512735018e-6, 3.0946157188738166e-5, -9.161280893593693e-5, 0.00019753913655451427, 5.763639268301698e-6, -2.1731140084696107e-5, 0.0005729153821096844, -0.0013245910642805114, 0.0032341901834591624, -0.006533213487198708, -0.00023394521940311996, 0.0004900344795362166, 0.006110738374093927, -0.01052329181479994, 1.038229372796011e-6, 4.505815850475159e-5, -5.291084449927236e-6, -0.0001390430240804097, 0.0003173070060080718, -3.826097874606166e-6, -0.00017026067684455803, 0.0005041383974906388, 0.0005254971748240855, -3.1743840895520625e-5, -0.005705946766292769, 0.010752221116043792, -0.02620169763148006, 0.0012873068418493006, -0.03501816028556348], [0.20486150217331126]}

Post-process output: calculate metrics, create plots, and save results.

Update test dataset by adding energy descriptors.

println("Computing local descriptors of test dataset")
+Σ = learn!(lb, ds_train[dpp_inds], α)
UnivariateLinearProblem{T, [-0.08354371474998601, 0.38198351270607134, -0.8863034822063298, 1.2946141096653605, -1.1101633252655176, 0.10918651736326979, 0.9147713430043609, 0.5429960389761277, -0.0033164304301491754, 0.010702994162032908, -0.024331513588396803, 0.032103474175784186, -0.011743109305633936, -0.06189926152960279, 0.20014427683894098, -0.009843658171575509, 0.03663726558921354, -0.1061929368700163, 0.2225246161242609, -0.3719639753958859, 0.0030728570836499047, -0.010886578443902284, 0.029288190678135706, -0.0018856646481378303, -0.06645335703391808, 0.09800425953061875, -0.09727243485959036, -0.07835971374998252, 0.5612322053534982, -0.272871596169594, 0.5596990464204907, -1.1740845644784486, 0.07707062037320966, -0.22759335060092667, -0.012329641014915182, 0.8033684328795196, -2.2985839042895577, 1.2215852145583703, -0.00026280596435428183, 0.000766022389018739, -0.0020876896987356286, 0.004002446063748, -0.005870926507455909, 0.006651001757728814, -0.00017516359272663762, 0.00065039579401166, -0.0018786402793437018, 0.003917329325625163, 6.421776597811957e-5, -0.0002291058741410168, -0.0038403353963336606, 0.007317687692971031, -0.013771505797107508, 0.01954906548705715, -0.004832522245170168, 0.009877696271050063, -0.027371746492159232, 0.03528158255963376, 3.4225265438038444e-5, 0.0009559056488628315, -0.00017388375035091996, -0.002918627144567809, 0.006573338876857626, -0.00012532820435662978, -0.0035499265229324006, 0.010256203163525601, 0.010841176480530734, -0.00034617744000929596, 0.03307027059142165, -0.05075009720956558, 0.09331025307832164, 0.026380660988928994, 0.13179309461018818], [0.18842518289988094]}

Post-process output: calculate metrics, create plots, and save results.

Update test dataset by adding energy descriptors.

println("Computing local descriptors of test dataset")
 e_descr_test = compute_local_descriptors(conf_test, ace)
 ds_test = DataSet(conf_test .+ e_descr_test)
DataSet{num_configs = 1092} 
-	 Configuration{S, AtomsBase.FlexibleSystem{3, AtomsBase.Atom{3, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}, Unitful.Quantity{Float64, 𝐋 𝐓^-1, Unitful.FreeUnits{(a₀, s^-1), 𝐋 𝐓^-1, nothing}}, Unitful.Quantity{Float64, 𝐌, Unitful.FreeUnits{(u,), 𝐌, nothing}}}, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}, Energy, LocalDescriptors, Forces}
-	 Configuration{S, AtomsBase.FlexibleSystem{3, AtomsBase.Atom{3, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}, Unitful.Quantity{Float64, 𝐋 𝐓^-1, Unitful.FreeUnits{(a₀, s^-1), 𝐋 𝐓^-1, nothing}}, Unitful.Quantity{Float64, 𝐌, Unitful.FreeUnits{(u,), 𝐌, nothing}}}, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}, Energy, LocalDescriptors, Forces}
+	 Configuration{S, Energy, AtomsBase.FlexibleSystem{3, AtomsBase.Atom{3, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}, Unitful.Quantity{Float64, 𝐋 𝐓^-1, Unitful.FreeUnits{(a₀, s^-1), 𝐋 𝐓^-1, nothing}}, Unitful.Quantity{Float64, 𝐌, Unitful.FreeUnits{(u,), 𝐌, nothing}}}, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}, Forces, LocalDescriptors}
+	 Configuration{S, Energy, AtomsBase.FlexibleSystem{3, AtomsBase.Atom{3, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}, Unitful.Quantity{Float64, 𝐋 𝐓^-1, Unitful.FreeUnits{(a₀, s^-1), 𝐋 𝐓^-1, nothing}}, Unitful.Quantity{Float64, 𝐌, Unitful.FreeUnits{(u,), 𝐌, nothing}}}, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}, Forces, LocalDescriptors}
 	 ⋮
-	 Configuration{S, AtomsBase.FlexibleSystem{3, AtomsBase.Atom{3, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}, Unitful.Quantity{Float64, 𝐋 𝐓^-1, Unitful.FreeUnits{(a₀, s^-1), 𝐋 𝐓^-1, nothing}}, Unitful.Quantity{Float64, 𝐌, Unitful.FreeUnits{(u,), 𝐌, nothing}}}, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}, Energy, LocalDescriptors, Forces}

Get true and predicted energy values (assuming that all configurations have the same no. of atoms).

n = size(get_system(ds_train[1]))[1]
+	 Configuration{S, Energy, AtomsBase.FlexibleSystem{3, AtomsBase.Atom{3, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}, Unitful.Quantity{Float64, 𝐋 𝐓^-1, Unitful.FreeUnits{(a₀, s^-1), 𝐋 𝐓^-1, nothing}}, Unitful.Quantity{Float64, 𝐌, Unitful.FreeUnits{(u,), 𝐌, nothing}}}, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}, Forces, LocalDescriptors}

Get true and predicted energy values (assuming that all configurations have the same no. of atoms).

n = size(get_system(ds_train[1]))[1]
 e_train, e_train_pred = get_all_energies(ds_train)/n, get_all_energies(ds_train, lb)/n
-e_test, e_test_pred   = get_all_energies(ds_test)/n, get_all_energies(ds_test, lb)/n
([-1.050120757771066, -1.0562140682089582, -1.056995661892708, -1.052943346117414, -1.0507336521441548, -1.0492654039689084, -1.0551928840372566, -1.0478345821564456, -1.0509946266385062, -1.0612155101072316  …  -1.0308587567190317, -1.037507962529589, -1.0364581866168459, -1.0470370158056794, -1.0408819752481295, -1.0360241207765786, -1.0350755250212837, -1.041561846516676, -1.0337330922011918, -1.0331453994779503], [-1.0555201953918436, -1.0588421800058772, -1.056524162692868, -1.0522766806889998, -1.0532225541645774, -1.0593259060041194, -1.053703899819624, -1.0482574152682826, -1.0626822934590299, -1.0568906764891604  …  -1.0235970415813096, -1.0266378846172861, -1.0227436770103424, -1.015666948417198, -1.025561218592769, -1.0158128913610482, -1.0210657927378608, -1.0216114151855225, -1.023920489511161, -1.015732815501946])

Compute and print metrics.

e_mae, e_rmse, e_rsq = calc_metrics(e_train, e_train_pred)
-println("MAE: $e_mae, RMSE: $e_rmse, RSQ: $e_rsq")
MAE: 0.004762854489099197, RMSE: 0.006217952705032473, RSQ: 0.8033726010027876

Plot energy error.

e_err_train, e_err_test = (e_train_pred - e_train), (e_test_pred - e_test)
+e_test, e_test_pred   = get_all_energies(ds_test)/n, get_all_energies(ds_test, lb)/n
([-1.050120757771066, -1.0562140682089582, -1.056995661892708, -1.052943346117414, -1.0507336521441548, -1.0492654039689084, -1.0551928840372566, -1.0478345821564456, -1.0509946266385062, -1.0612155101072316  …  -1.0308587567190317, -1.037507962529589, -1.0364581866168459, -1.0470370158056794, -1.0408819752481295, -1.0360241207765786, -1.0350755250212837, -1.041561846516676, -1.0337330922011918, -1.0331453994779503], [-1.0551685785182356, -1.0581506679597132, -1.0569916094586422, -1.052498926884867, -1.0545379491619224, -1.0625011639546342, -1.0539861948438933, -1.0457587497149126, -1.063034520085893, -1.05876001372703  …  -1.0168602944712233, -1.0200360469295904, -1.0174021335273642, -1.0100615206275394, -1.0194325881751685, -1.0084095674180331, -1.0144463202440432, -1.0160958329440315, -1.0165267124346566, -1.0115755650026357])

Compute and print metrics.

e_mae, e_rmse, e_rsq = calc_metrics(e_train, e_train_pred)
+println("MAE: $e_mae, RMSE: $e_rmse, RSQ: $e_rsq")
MAE: 0.004557375524360856, RMSE: 0.00600370626028478, RSQ: 0.8300173074116394

Plot energy error.

e_err_train, e_err_test = (e_train_pred - e_train), (e_test_pred - e_test)
 dpp_inds2 = get_random_subset(dpp; batch_size = 20)
 p = scatter( e_train, e_err_train, label = "Training", color = :blue,
          markersize = 1.5, markerstrokewidth=0)
@@ -89,4 +89,4 @@
          color = :darkred, label = "DPP Samples",
          markersize = 2.5, markerstrokewidth=0)
 scatter!(xlabel = "Energy (eV/atom)", ylabel = "Error (eV/atom)",
-         dpi = 1000, fontsize = 16)
Example block output

This page was generated using Literate.jl.

+ dpi = 1000, fontsize = 16)Example block output

This page was generated using Literate.jl.

diff --git a/previews/PR74/generated/DPP-ACE-Si/fit-dpp-ace-si/index.html b/previews/PR74/generated/DPP-ACE-Si/fit-dpp-ace-si/index.html index eb4030b6..6efc0626 100644 --- a/previews/PR74/generated/DPP-ACE-Si/fit-dpp-ace-si/index.html +++ b/previews/PR74/generated/DPP-ACE-Si/fit-dpp-ace-si/index.html @@ -9,10 +9,10 @@ nfile = length(file_arr) confs_arr = [load_data(inpath*file, ExtXYZ(u"eV", u"Å")) for file in file_arr] confs = concat_dataset(confs_arr)
DataSet{num_configs = 201} 
-	 Configuration{S, Energy, Forces, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}}
-	 Configuration{S, Energy, Forces, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}}
+	 Configuration{S, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}, Energy, Forces}
+	 Configuration{S, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}, Energy, Forces}
 	 ⋮
-	 Configuration{S, Energy, Forces, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}}

Id of configurations per file

n = 0
+	 Configuration{S, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}, Energy, Forces}

Id of configurations per file

n = 0
 confs_id = Vector{Vector{Int64}}(undef, nfile)
 for k = 1:nfile
     global n
@@ -26,7 +26,7 @@
           wL = 1.0,                     # Defaults, See ACE.jl documentation
           csp = 1.0,                    # Defaults, See ACE.jl documentation
           r0 = 1.0,                     # minimum distance between atoms
-          rcutoff = 10.0)
InteratomicPotentials.ACE([:Si], 4, 5, 10.0, 1.0, 1.0, 1.0, ACE1.RPI.RPIBasis{Float64, ACE1.RPI.BasicPSH1pBasis{Float64, 1, ACE1.OrthPolys.TransformedPolys{Float64, ACE1.Transforms.PolyTransform{Int64, Float64}, ACE1.OrthPolys.OrthPolyBasis{Float64}, ACE1.OrthPolys.OneEnvelope}}, 1, ACE1.DAGEvaluator}(ACE1.PIBasis{ACE1.RPI.BasicPSH1pBasis{Float64, 1, ACE1.OrthPolys.TransformedPolys{Float64, ACE1.Transforms.PolyTransform{Int64, Float64}, ACE1.OrthPolys.OrthPolyBasis{Float64}, ACE1.OrthPolys.OneEnvelope}}, 1, ACE1.DAGEvaluator}(ACE1.RPI.BasicPSH1pBasis{Float64, 1, ACE1.OrthPolys.TransformedPolys{Float64, ACE1.Transforms.PolyTransform{Int64, Float64}, ACE1.OrthPolys.OrthPolyBasis{Float64}, ACE1.OrthPolys.OneEnvelope}}(ACE1.OrthPolys.TransformedPolys{Float64, ACE1.Transforms.PolyTransform{Int64, Float64}, ACE1.OrthPolys.OrthPolyBasis{Float64}, ACE1.OrthPolys.OneEnvelope}(ACE1.OrthPolys.OrthPolyBasis{Float64}(2, 0.03305785123966942, 0, 1.4692378328741966, [1.084095259082914, 4.943189180687471, 3.684442125691434, 3.29907359036723, 3.1224405721338866], [0.0, -6.079499869826186, -3.6494749893429064, -2.9518880477215665, -2.6443581983662967], [0.0, 0.0, -0.7453572968815606, -0.8954065440092013, -0.9464598126125047], [0.03377594123048669, 0.035212121212121215, 0.03664830119375574, 0.03808448117539027, 0.039520661157024795, 0.04095684113865933, 0.042393021120293854, 0.04382920110192838, 0.04526538108356291, 0.04670156106519743  …  1.4555941230486686, 1.4570303030303031, 1.4584664830119376, 1.4599026629935723, 1.4613388429752068, 1.4627750229568413, 1.4642112029384757, 1.4656473829201104, 1.467083562901745, 1.4685197428833794], [0.001, 0.001, 0.001, 0.001, 0.001, 0.001, 0.001, 0.001, 0.001, 0.001  …  0.001, 0.001, 0.001, 0.001, 0.001, 0.001, 0.001, 0.001, 0.001, 0.001]), ACE1.Transforms.PolyTransform{Int64, Float64}(2, 1.0, 1.0), 0.65, 10.0, ACE1.OrthPolys.OneEnvelope()), ACE1.SphericalHarmonics.SHBasis{Float64}(4, ACE1.SphericalHarmonics.ALPCoefficients{Float64}([40.65157422797851, -65.22029576360207, 93.2321331499158, 1.9364916731037085, 0.013119754931538026, -0.05070194529951765, 1.9720265943665387, 2.091650066335189, 0.6463124381360126, -1.0310621443774464, 1.984313483298443, 2.04939015319192, 2.29128784747792, 0.020989327304963012, -0.04441095681325601], [1.912484234127392, -3.5345159688177907, 5.64009611940136, -0.5773502691896257, -0.11122328664296446, 0.2356350401915269, -0.5163977794943222, -0.4472135954999579, -5.852363388821227, 10.819122232750747, -0.50709255283711, -0.47809144373375745, -0.3779644730092272, -0.0012080313821876184, 0.0036863131414138234])), JuLIP.Potentials.SZList{1}(JuLIP.Chemistry.AtomicNumber[<14>]), ACE1.RPI.PSH1pBasisFcn[znlm[0|1,0,0], znlm[0|1,1,-1], znlm[0|1,1,0], znlm[0|1,1,1], znlm[0|1,2,-2], znlm[0|1,2,-1], znlm[0|1,2,0], znlm[0|1,2,1], znlm[0|1,2,2], znlm[0|1,3,-3]  …  znlm[0|3,2,-2], znlm[0|3,2,-1], znlm[0|3,2,0], znlm[0|3,2,1], znlm[0|3,2,2], znlm[0|4,0,0], znlm[0|4,1,-1], znlm[0|4,1,0], znlm[0|4,1,1], znlm[0|5,0,0]], UnitRange{Int64}[1:55;;]), JuLIP.Potentials.SZList{1}(JuLIP.Chemistry.AtomicNumber[<14>]), (ACE1.InnerPIBasis([1, 1, 1, 1, 1, 2, 2, 2, 2, 2  …  2, 2, 2, 3, 3, 3, 3, 3, 3, 3], [1 0 0; 26 0 0; … ; 1 3 3; 1 26 26], Dict{ACE1.PIBasisFcn, Int64}(ACE1.PIBasisFcn{2, ACE1.RPI.PSH1pBasisFcn}(<14>, (znlm[14|1,1,-1], znlm[14|1,1,1]), ACE1.RPI.PSH1pBasisFcn) => 12, ACE1.PIBasisFcn{3, ACE1.RPI.PSH1pBasisFcn}(<14>, (znlm[14|1,0,0], znlm[14|1,1,0], znlm[14|1,1,0]), ACE1.RPI.PSH1pBasisFcn) => 25, ACE1.PIBasisFcn{1, ACE1.RPI.PSH1pBasisFcn}(<14>, (znlm[14|3,0,0],), ACE1.RPI.PSH1pBasisFcn) => 3, ACE1.PIBasisFcn{2, ACE1.RPI.PSH1pBasisFcn}(<14>, (znlm[14|1,0,0], znlm[14|2,2,0]), ACE1.RPI.PSH1pBasisFcn) => 9, ACE1.PIBasisFcn{2, ACE1.RPI.PSH1pBasisFcn}(<14>, (znlm[14|1,0,0], znlm[14|1,0,0]), ACE1.RPI.PSH1pBasisFcn) => 6, ACE1.PIBasisFcn{3, ACE1.RPI.PSH1pBasisFcn}(<14>, (znlm[14|1,0,0], znlm[14|1,0,0], znlm[14|3,0,0]), ACE1.RPI.PSH1pBasisFcn) => 23, ACE1.PIBasisFcn{1, ACE1.RPI.PSH1pBasisFcn}(<14>, (znlm[14|4,0,0],), ACE1.RPI.PSH1pBasisFcn) => 4, ACE1.PIBasisFcn{1, ACE1.RPI.PSH1pBasisFcn}(<14>, (znlm[14|1,0,0],), ACE1.RPI.PSH1pBasisFcn) => 1, ACE1.PIBasisFcn{3, ACE1.RPI.PSH1pBasisFcn}(<14>, (znlm[14|1,0,0], znlm[14|1,0,0], znlm[14|2,0,0]), ACE1.RPI.PSH1pBasisFcn) => 22, ACE1.PIBasisFcn{2, ACE1.RPI.PSH1pBasisFcn}(<14>, (znlm[14|1,0,0], znlm[14|4,0,0]), ACE1.RPI.PSH1pBasisFcn) => 11…), Dict{Any, Int64}(znlm[14|5,0,0] => 55, znlm[14|1,4,-3] => 18, znlm[14|2,2,-2] => 30, znlm[14|1,4,2] => 23, znlm[14|2,1,0] => 28, znlm[14|2,3,-2] => 36, znlm[14|1,3,0] => 13, znlm[14|1,3,1] => 14, znlm[14|1,4,-2] => 19, znlm[14|1,3,2] => 15…), 1:26, <14>, ACE1.DAG.CorrEvalGraph{Int64, Int64}([(1, 0), (2, 0), (3, 0), (4, 0), (5, 0), (6, 0), (7, 0), (8, 0), (9, 0), (10, 0)  …  (7, 26), (26, 26), (26, 42), (56, 1), (56, 7), (56, 26), (56, 42), (1, 58), (1, 59), (57, 26)], [1, 0, 0, 0, 0, 0, 0, 0, 0, 0  …  17, 18, 19, 20, 21, 22, 23, 24, 25, 26], 55, 59)),), ACE1.DAGEvaluator()), (sparse([1, 2, 3, 4, 5, 6, 7, 8, 9, 10  …  11, 11, 12, 13, 14, 15, 16, 17, 17, 18], [1, 2, 3, 4, 5, 6, 8, 10, 11, 12  …  15, 16, 18, 19, 20, 22, 23, 24, 25, 26], [1.0, 1.0, 1.0, 1.0, 1.0, 1.4142135623730951, 1.0, 1.0, 1.0, -1.6329931618554518  …  0.5773502691896257, -0.5773502691896257, 1.4142135623730951, 1.0, 2.449489742783178, 1.4142135623730951, 1.4142135623730951, -1.6329931618554525, 0.816496580927726, 1.4142135623730951], 18, 26),), (1:18,)))

Compute ACE descriptors for energies and forces.

println("Computing local descriptors")
+          rcutoff = 10.0)
InteratomicPotentials.ACE([:Si], 4, 5, 10.0, 1.0, 1.0, 1.0, ACE1.RPI.RPIBasis{Float64, ACE1.RPI.BasicPSH1pBasis{Float64, 1, ACE1.OrthPolys.TransformedPolys{Float64, ACE1.Transforms.PolyTransform{Int64, Float64}, ACE1.OrthPolys.OrthPolyBasis{Float64}, ACE1.OrthPolys.OneEnvelope}}, 1, ACE1.DAGEvaluator}(ACE1.PIBasis{ACE1.RPI.BasicPSH1pBasis{Float64, 1, ACE1.OrthPolys.TransformedPolys{Float64, ACE1.Transforms.PolyTransform{Int64, Float64}, ACE1.OrthPolys.OrthPolyBasis{Float64}, ACE1.OrthPolys.OneEnvelope}}, 1, ACE1.DAGEvaluator}(ACE1.RPI.BasicPSH1pBasis{Float64, 1, ACE1.OrthPolys.TransformedPolys{Float64, ACE1.Transforms.PolyTransform{Int64, Float64}, ACE1.OrthPolys.OrthPolyBasis{Float64}, ACE1.OrthPolys.OneEnvelope}}(ACE1.OrthPolys.TransformedPolys{Float64, ACE1.Transforms.PolyTransform{Int64, Float64}, ACE1.OrthPolys.OrthPolyBasis{Float64}, ACE1.OrthPolys.OneEnvelope}(ACE1.OrthPolys.OrthPolyBasis{Float64}(2, 0.03305785123966942, 0, 1.4692378328741966, [1.084095259082914, 4.943189180687471, 3.684442125691434, 3.29907359036723, 3.1224405721338866], [0.0, -6.079499869826186, -3.6494749893429064, -2.9518880477215665, -2.6443581983662967], [0.0, 0.0, -0.7453572968815606, -0.8954065440092013, -0.9464598126125047], [0.03377594123048669, 0.035212121212121215, 0.03664830119375574, 0.03808448117539027, 0.039520661157024795, 0.04095684113865933, 0.042393021120293854, 0.04382920110192838, 0.04526538108356291, 0.04670156106519743  …  1.4555941230486686, 1.4570303030303031, 1.4584664830119376, 1.4599026629935723, 1.4613388429752068, 1.4627750229568413, 1.4642112029384757, 1.4656473829201104, 1.467083562901745, 1.4685197428833794], [0.001, 0.001, 0.001, 0.001, 0.001, 0.001, 0.001, 0.001, 0.001, 0.001  …  0.001, 0.001, 0.001, 0.001, 0.001, 0.001, 0.001, 0.001, 0.001, 0.001]), ACE1.Transforms.PolyTransform{Int64, Float64}(2, 1.0, 1.0), 0.65, 10.0, ACE1.OrthPolys.OneEnvelope()), ACE1.SphericalHarmonics.SHBasis{Float64}(4, ACE1.SphericalHarmonics.ALPCoefficients{Float64}([0.0, 0.0, 0.0, 1.9364916731037085, 0.0, 0.0, 1.9720265943665387, 2.091650066335189, 0.0, 0.0, 1.984313483298443, 2.04939015319192, 2.29128784747792, 0.0, 0.0], [0.0, 0.0, 0.0, -0.5773502691896257, 0.0, 0.0, -0.5163977794943222, -0.4472135954999579, 0.0, 0.0, -0.50709255283711, -0.47809144373375745, -0.3779644730092272, 0.0, 0.0])), JuLIP.Potentials.SZList{1}(JuLIP.Chemistry.AtomicNumber[<14>]), ACE1.RPI.PSH1pBasisFcn[znlm[0|1,0,0], znlm[0|1,1,-1], znlm[0|1,1,0], znlm[0|1,1,1], znlm[0|1,2,-2], znlm[0|1,2,-1], znlm[0|1,2,0], znlm[0|1,2,1], znlm[0|1,2,2], znlm[0|1,3,-3]  …  znlm[0|3,2,-2], znlm[0|3,2,-1], znlm[0|3,2,0], znlm[0|3,2,1], znlm[0|3,2,2], znlm[0|4,0,0], znlm[0|4,1,-1], znlm[0|4,1,0], znlm[0|4,1,1], znlm[0|5,0,0]], UnitRange{Int64}[1:55;;]), JuLIP.Potentials.SZList{1}(JuLIP.Chemistry.AtomicNumber[<14>]), (ACE1.InnerPIBasis([1, 1, 1, 1, 1, 2, 2, 2, 2, 2  …  2, 2, 2, 3, 3, 3, 3, 3, 3, 3], [1 0 0; 26 0 0; … ; 1 3 3; 1 26 26], Dict{ACE1.PIBasisFcn, Int64}(ACE1.PIBasisFcn{2, ACE1.RPI.PSH1pBasisFcn}(<14>, (znlm[14|1,0,0], znlm[14|1,0,0]), ACE1.RPI.PSH1pBasisFcn) => 6, ACE1.PIBasisFcn{2, ACE1.RPI.PSH1pBasisFcn}(<14>, (znlm[14|1,0,0], znlm[14|2,0,0]), ACE1.RPI.PSH1pBasisFcn) => 8, ACE1.PIBasisFcn{3, ACE1.RPI.PSH1pBasisFcn}(<14>, (znlm[14|1,0,0], znlm[14|1,0,0], znlm[14|1,2,0]), ACE1.RPI.PSH1pBasisFcn) => 21, ACE1.PIBasisFcn{3, ACE1.RPI.PSH1pBasisFcn}(<14>, (znlm[14|1,0,0], znlm[14|1,0,0], znlm[14|3,0,0]), ACE1.RPI.PSH1pBasisFcn) => 23, ACE1.PIBasisFcn{1, ACE1.RPI.PSH1pBasisFcn}(<14>, (znlm[14|1,0,0],), ACE1.RPI.PSH1pBasisFcn) => 1, ACE1.PIBasisFcn{2, ACE1.RPI.PSH1pBasisFcn}(<14>, (znlm[14|1,1,1], znlm[14|2,1,-1]), ACE1.RPI.PSH1pBasisFcn) => 16, ACE1.PIBasisFcn{2, ACE1.RPI.PSH1pBasisFcn}(<14>, (znlm[14|1,0,0], znlm[14|2,2,0]), ACE1.RPI.PSH1pBasisFcn) => 9, ACE1.PIBasisFcn{2, ACE1.RPI.PSH1pBasisFcn}(<14>, (znlm[14|1,0,0], znlm[14|4,0,0]), ACE1.RPI.PSH1pBasisFcn) => 11, ACE1.PIBasisFcn{2, ACE1.RPI.PSH1pBasisFcn}(<14>, (znlm[14|1,1,-1], znlm[14|2,1,1]), ACE1.RPI.PSH1pBasisFcn) => 13, ACE1.PIBasisFcn{3, ACE1.RPI.PSH1pBasisFcn}(<14>, (znlm[14|1,0,0], znlm[14|1,1,-1], znlm[14|1,1,1]), ACE1.RPI.PSH1pBasisFcn) => 24…), Dict{Any, Int64}(znlm[14|2,2,1] => 33, znlm[14|5,0,0] => 55, znlm[14|1,3,-3] => 10, znlm[14|4,1,-1] => 52, znlm[14|2,2,-1] => 31, znlm[14|1,2,2] => 9, znlm[14|3,2,1] => 49, znlm[14|3,2,-2] => 46, znlm[14|1,1,0] => 3, znlm[14|1,2,0] => 7…), 1:26, <14>, ACE1.DAG.CorrEvalGraph{Int64, Int64}([(1, 0), (2, 0), (3, 0), (4, 0), (5, 0), (6, 0), (7, 0), (8, 0), (9, 0), (10, 0)  …  (7, 26), (26, 26), (26, 42), (56, 1), (56, 7), (56, 26), (56, 42), (1, 58), (1, 59), (57, 26)], [1, 0, 0, 0, 0, 0, 0, 0, 0, 0  …  17, 18, 19, 20, 21, 22, 23, 24, 25, 26], 55, 59)),), ACE1.DAGEvaluator()), (sparse([1, 2, 3, 4, 5, 6, 7, 8, 9, 10  …  11, 11, 12, 13, 14, 15, 16, 17, 17, 18], [1, 2, 3, 4, 5, 6, 8, 10, 11, 12  …  15, 16, 18, 19, 20, 22, 23, 24, 25, 26], [1.0, 1.0, 1.0, 1.0, 1.0, 1.4142135623730951, 1.0, 1.0, 1.0, -1.6329931618554518  …  0.5773502691896257, -0.5773502691896257, 1.4142135623730951, 1.0, 2.449489742783178, 1.4142135623730951, 1.4142135623730951, -1.6329931618554525, 0.816496580927726, 1.4142135623730951], 18, 26),), (1:18,)))

Compute ACE descriptors for energies and forces.

println("Computing local descriptors")
 e_descr = compute_local_descriptors(confs, ace; pbar=false)
 f_descr = compute_force_descriptors(confs, ace; pbar=false)
 JLD.save(outpath*"$(elname)_energy_descriptors.jld", "e_descr", e_descr)
@@ -49,11 +49,11 @@
 batch 3
 batch 4
 batch 5
-condnum: [1.981774435337064e10, 1.9173683724574825e10, 1.890435429391704e10, 1.8877880951279392e10, 1.9471865198934975e10]
+condnum: [1.950248769000064e10, 1.98976244126135e10, 1.994877472958409e10, 1.936158454630063e10, 1.8595556010205463e10]
 =============== Starting batch size 40 ===============
 batch 1
 batch 2
 batch 3
 batch 4
 batch 5
-condnum: [1.8619500025630135e10, 1.9478231567179077e10, 1.8174299904536842e10, 1.872159827560268e10, 2.0231183188594486e10]

This page was generated using Literate.jl.

+condnum: [2.032071595852728e10, 1.977832704600197e10, 2.0064915169047237e10, 1.9815611271990753e10, 1.8840139408920628e10]

This page was generated using Literate.jl.

diff --git a/previews/PR74/generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/0a389f8f.png b/previews/PR74/generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/0a389f8f.png new file mode 100644 index 00000000..b5546af6 Binary files /dev/null and b/previews/PR74/generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/0a389f8f.png differ diff --git a/previews/PR74/generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/14628192.png b/previews/PR74/generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/14628192.png new file mode 100644 index 00000000..315320b2 Binary files /dev/null and b/previews/PR74/generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/14628192.png differ diff --git a/previews/PR74/generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/26cd3ba5.png b/previews/PR74/generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/26cd3ba5.png new file mode 100644 index 00000000..9098952a Binary files /dev/null and b/previews/PR74/generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/26cd3ba5.png differ diff --git a/previews/PR74/generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/94218ba2.png b/previews/PR74/generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/94218ba2.png deleted file mode 100644 index 5a498bb7..00000000 Binary files a/previews/PR74/generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/94218ba2.png and /dev/null differ diff --git a/previews/PR74/generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/96029931.png b/previews/PR74/generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/96029931.png deleted file mode 100644 index 28d2cb21..00000000 Binary files a/previews/PR74/generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/96029931.png and /dev/null differ diff --git a/previews/PR74/generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/961a41fd.png b/previews/PR74/generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/961a41fd.png deleted file mode 100644 index 73ad6336..00000000 Binary files a/previews/PR74/generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/961a41fd.png and /dev/null differ diff --git a/previews/PR74/generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/98bfc437.png b/previews/PR74/generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/98bfc437.png new file mode 100644 index 00000000..5e67cfe1 Binary files /dev/null and b/previews/PR74/generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/98bfc437.png differ diff --git a/previews/PR74/generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/aa10a1e2.png b/previews/PR74/generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/aa10a1e2.png deleted file mode 100644 index 2fee3735..00000000 Binary files a/previews/PR74/generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/aa10a1e2.png and /dev/null differ diff --git a/previews/PR74/generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/index.html b/previews/PR74/generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/index.html index f78910f7..7c341a40 100644 --- a/previews/PR74/generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/index.html +++ b/previews/PR74/generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/index.html @@ -4,19 +4,19 @@ using LinearAlgebra, Random, DisplayAs

Define paths.

path = joinpath(dirname(pathof(PotentialLearning)), "../examples/DPP-ACE-aHfO2-1")
 ds_path =  "$path/../data/a-HfO2/a-HfO2-300K-NVT-6000.extxyz"
 res_path = "$path/results/"
"/home/runner/work/PotentialLearning.jl/PotentialLearning.jl/src/../examples/DPP-ACE-aHfO2-1/results/"

Load utility functions.

include("$path/../utils/utils.jl")

Create experiment folder.

run(`mkdir -p $res_path`)
Process(`mkdir -p /home/runner/work/PotentialLearning.jl/PotentialLearning.jl/src/../examples/DPP-ACE-aHfO2-1/results/`, ProcessExited(0))

Load atomistic dataset and split it into training and test.

Load atomistic dataset: atomistic configurations (atom positions, geometry, etc.) + DFT data (energies, forces, etc.)

ds = load_data(ds_path, uparse("eV"), uparse("Å"))
DataSet{num_configs = 6000} 
-	 Configuration{S, Energy, Forces, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}}
-	 Configuration{S, Energy, Forces, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}}
+	 Configuration{S, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}, Energy, Forces}
+	 Configuration{S, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}, Energy, Forces}
 	 ⋮
-	 Configuration{S, Energy, Forces, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}}

Split atomistic dataset into training and test

n_train, n_test = 100, 50 # Few samples per dataset are used in this example.
+	 Configuration{S, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}, Energy, Forces}

Split atomistic dataset into training and test

n_train, n_test = 100, 50 # Few samples per dataset are used in this example.
 conf_train, conf_test = split(ds, n_train, n_test)
(DataSet{num_configs = 100} 
-	 Configuration{S, Energy, Forces, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}}
-	 Configuration{S, Energy, Forces, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}}
+	 Configuration{S, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}, Energy, Forces}
+	 Configuration{S, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}, Energy, Forces}
 	 ⋮
-	 Configuration{S, Energy, Forces, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}}, DataSet{num_configs = 50} 
-	 Configuration{S, Energy, Forces, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}}
-	 Configuration{S, Energy, Forces, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}}
+	 Configuration{S, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}, Energy, Forces}, DataSet{num_configs = 50} 
+	 Configuration{S, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}, Energy, Forces}
+	 Configuration{S, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}, Energy, Forces}
 	 ⋮
-	 Configuration{S, Energy, Forces, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}})

Subsampling

Compute ACE descriptors for energies as subsampling input.

basis = ACE(species           = [:Hf, :O],
+	 Configuration{S, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}, Energy, Forces})

Subsampling

Compute ACE descriptors for energies as subsampling input.

basis = ACE(species           = [:Hf, :O],
             body_order        = 2,
             polynomial_degree = 3,
             rcutoff           = 5.0,
@@ -46,27 +46,27 @@
  LocalDescriptors{n = 96, d = 12}
  LocalDescriptors{n = 96, d = 12}
  LocalDescriptors{n = 96, d = 12}

Update subsampling dataset

conf_train_kDPP = DataSet(conf_train .+ e_descr)
DataSet{num_configs = 100} 
-	 Configuration{S, Energy, LocalDescriptors, Forces, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}}
-	 Configuration{S, Energy, LocalDescriptors, Forces, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}}
+	 Configuration{S, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}, Energy, Forces, LocalDescriptors}
+	 Configuration{S, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}, Energy, Forces, LocalDescriptors}
 	 ⋮
-	 Configuration{S, Energy, LocalDescriptors, Forces, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}}

Create DPP subselector

dataset_selector = kDPP(  conf_train_kDPP,
+	 Configuration{S, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}, Energy, Forces, LocalDescriptors}

Create DPP subselector

dataset_selector = kDPP(  conf_train_kDPP,
                           GlobalMean(),
                           DotProduct();
                           batch_size = 50)
kDPP(L-Ensemble.
-Number of items in ground set : 100. Max. rank : 100. Rescaling constant α=1.113809483900041e15
+Number of items in ground set : 100. Max. rank : 100. Rescaling constant α=1.2191377910275012e15
 , 50)

Subsample trainig dataset

inds = get_random_subset(dataset_selector)
 conf_train = @views conf_train[inds]
DataSet{num_configs = 50} 
-	 Configuration{S, Energy, Forces, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}}
-	 Configuration{S, Energy, Forces, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}}
+	 Configuration{S, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}, Energy, Forces}
+	 Configuration{S, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}, Energy, Forces}
 	 ⋮
-	 Configuration{S, Energy, Forces, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}}

Create ACE basis, compute descriptors and add them to the dataset.

Create ACE basis

basis = ACE(species           = [:Hf, :O],
+	 Configuration{S, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}, Energy, Forces}

Create ACE basis, compute descriptors and add them to the dataset.

Create ACE basis

basis = ACE(species           = [:Hf, :O],
             body_order        = 3,
             polynomial_degree = 3,
             rcutoff           = 5.0,
             wL                = 1.0,
             csp               = 1.0,
             r0                = 1.0)
-@save_var res_path basis
34658

Compute ACE descriptors for energy and forces based on the atomistic training configurations.

println("Computing energy descriptors of training dataset...")
+@save_var res_path basis
34662

Compute ACE descriptors for energy and forces based on the atomistic training configurations.

println("Computing energy descriptors of training dataset...")
 e_descr_train = compute_local_descriptors(conf_train, basis;
                                           pbar=false)
 println("Computing force descriptors of training dataset...")
@@ -92,16 +92,16 @@
  ForceDescriptors{n = 96, d = 3}
  ForceDescriptors{n = 96, d = 3}
  ForceDescriptors{n = 96, d = 3}

Update training dataset by adding energy and force descriptors.

ds_train = DataSet(conf_train .+ e_descr_train .+ f_descr_train)
DataSet{num_configs = 50} 
-	 Configuration{S, Energy, LocalDescriptors, Forces, ForceDescriptors, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}}
-	 Configuration{S, Energy, LocalDescriptors, Forces, ForceDescriptors, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}}
+	 Configuration{S, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}, Energy, ForceDescriptors, Forces, LocalDescriptors}
+	 Configuration{S, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}, Energy, ForceDescriptors, Forces, LocalDescriptors}
 	 ⋮
-	 Configuration{S, Energy, LocalDescriptors, Forces, ForceDescriptors, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}}

Learn ACE coefficients based on ACE descriptors and DFT data.

println("Learning energies and forces...")
+	 Configuration{S, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}, Energy, ForceDescriptors, Forces, LocalDescriptors}

Learn ACE coefficients based on ACE descriptors and DFT data.

println("Learning energies and forces...")
 lb = LBasisPotential(basis)
 ws, int = [1.0, 1.0], false
 learn!(lb, ds_train, ws, int)
 @save_var res_path lb.β
 @save_var res_path lb.β0
-lb.β, lb.β0
([522.500096658176, 106.83399548553595, 4.107560523804064, -969.1870951220063, -74.20204267452726, -100.23785560035395, -813.1423312282069, -245.39793641824392, -2474.0887593797825, 0.17394913858259317  …  -1006.1683965514544, -63.01838420087792, 59.96321000341094, 84.91897909616017, -57.55480894753932, 16946.94101941848, 3577.2302517293047, -186.29435578634886, -25082.533209509114, -6618.396717433171], [0.0])

Post-process output: calculate metrics, create plots, and save results.

Compute ACE descriptors for energy and forces based on the atomistic test configurations.

println("Computing energy descriptors of test dataset...")
+lb.β, lb.β0
([495.43028898929526, 98.75642835962024, 2.8904880070377805, 266.8955082636321, 197.7824021050757, -26.62390001585884, -1014.5623616028422, -309.13236445548006, -2311.5526066711536, -20.473257005118235  …  -181.1848059766305, 190.76880302641382, 93.81537696144568, 83.71663998362283, -58.59832008810385, 17516.960681176213, 3648.784723297296, -121.66234726354335, -30734.101849308638, -8171.8110701202795], [0.0])

Post-process output: calculate metrics, create plots, and save results.

Compute ACE descriptors for energy and forces based on the atomistic test configurations.

println("Computing energy descriptors of test dataset...")
 e_descr_test = compute_local_descriptors(conf_test, basis;
                                          pbar = false)
 println("Computing force descriptors of test dataset...")
@@ -127,10 +127,10 @@
  ForceDescriptors{n = 96, d = 3}
  ForceDescriptors{n = 96, d = 3}
  ForceDescriptors{n = 96, d = 3}

Update test dataset by adding energy and force descriptors.

ds_test = DataSet(conf_test .+ e_descr_test .+ f_descr_test)
DataSet{num_configs = 50} 
-	 Configuration{S, Energy, LocalDescriptors, Forces, ForceDescriptors, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}}
-	 Configuration{S, Energy, LocalDescriptors, Forces, ForceDescriptors, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}}
+	 Configuration{S, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}, Energy, ForceDescriptors, Forces, LocalDescriptors}
+	 Configuration{S, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}, Energy, ForceDescriptors, Forces, LocalDescriptors}
 	 ⋮
-	 Configuration{S, Energy, LocalDescriptors, Forces, ForceDescriptors, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}}

Get true and predicted values for energies and forces.

n_atoms_train = length.(get_system.(ds_train))
+	 Configuration{S, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}, Energy, ForceDescriptors, Forces, LocalDescriptors}

Get true and predicted values for energies and forces.

n_atoms_train = length.(get_system.(ds_train))
 n_atoms_test = length.(get_system.(ds_test))
 
 e_train, e_train_pred = get_all_energies(ds_train) ./ n_atoms_train,
@@ -149,7 +149,7 @@
 @save_var res_path e_test
 @save_var res_path e_test_pred
 @save_var res_path f_test
-@save_var res_path f_test_pred
300757

Compute training metrics

e_train_metrics = get_metrics(e_train, e_train_pred,
+@save_var res_path f_test_pred
300947

Compute training metrics

e_train_metrics = get_metrics(e_train, e_train_pred,
                               metrics = [mae, rmse, rsq],
                               label = "e_train")
 f_train_metrics = get_metrics(f_train, f_train_pred,
@@ -158,13 +158,13 @@
 train_metrics = merge(e_train_metrics, f_train_metrics)
 @save_dict res_path train_metrics
 train_metrics
OrderedCollections.OrderedDict{String, Float64} with 7 entries:
-  "e_train_mae"      => 0.00236046
-  "e_train_rmse"     => 0.00291742
-  "e_train_rsq"      => 0.750426
-  "f_train_mae"      => 0.232055
-  "f_train_rmse"     => 0.298915
-  "f_train_rsq"      => 0.726949
-  "f_train_mean_cos" => 0.816086

Compute test metrics

e_test_metrics = get_metrics(e_test, e_test_pred,
+  "e_train_mae"      => 0.00263463
+  "e_train_rmse"     => 0.00318484
+  "e_train_rsq"      => 0.851623
+  "f_train_mae"      => 0.235335
+  "f_train_rmse"     => 0.303966
+  "f_train_rsq"      => 0.730696
+  "f_train_mean_cos" => 0.816686

Compute test metrics

e_test_metrics = get_metrics(e_test, e_test_pred,
                              metrics = [mae, rmse, rsq],
                              label = "e_test")
 f_test_metrics = get_metrics(f_test, f_test_pred,
@@ -173,28 +173,28 @@
 test_metrics = merge(e_test_metrics, f_test_metrics)
 @save_dict res_path test_metrics
 test_metrics
OrderedCollections.OrderedDict{String, Float64} with 7 entries:
-  "e_test_mae"      => 0.00295823
-  "e_test_rmse"     => 0.00356182
-  "e_test_rsq"      => 0.427357
-  "f_test_mae"      => 0.248335
-  "f_test_rmse"     => 0.321131
-  "f_test_rsq"      => 0.707712
-  "f_test_mean_cos" => 0.807101

Plot and save energy results

e_plot = plot_energy(e_train, e_train_pred,
+  "e_test_mae"      => 0.00306463
+  "e_test_rmse"     => 0.00362936
+  "e_test_rsq"      => 0.218731
+  "f_test_mae"      => 0.244628
+  "f_test_rmse"     => 0.314432
+  "f_test_rsq"      => 0.716821
+  "f_test_mean_cos" => 0.812753

Plot and save energy results

e_plot = plot_energy(e_train, e_train_pred,
                      e_test, e_test_pred)
 @save_fig res_path e_plot
-DisplayAs.PNG(e_plot)
Example block output

Plot and save force results

f_plot = plot_forces(f_train, f_train_pred,
+DisplayAs.PNG(e_plot)
Example block output

Plot and save force results

f_plot = plot_forces(f_train, f_train_pred,
                      f_test, f_test_pred)
 @save_fig res_path f_plot
-DisplayAs.PNG(f_plot)
Example block output

Plot and save training force cosine

e_train_plot = plot_energy(e_train, e_train_pred)
+DisplayAs.PNG(f_plot)
Example block output

Plot and save training force cosine

e_train_plot = plot_energy(e_train, e_train_pred)
 f_train_plot = plot_forces(f_train, f_train_pred)
 f_train_cos  = plot_cos(f_train, f_train_pred)
 @save_fig res_path e_train_plot
 @save_fig res_path f_train_plot
 @save_fig res_path f_train_cos
-DisplayAs.PNG(f_train_cos)
Example block output

Plot and save test force cosine

e_test_plot = plot_energy(e_test, e_test_pred)
+DisplayAs.PNG(f_train_cos)
Example block output

Plot and save test force cosine

e_test_plot = plot_energy(e_test, e_test_pred)
 f_test_plot = plot_forces(f_test, f_test_pred)
 f_test_cos  = plot_cos(f_test, f_test_pred)
 @save_fig res_path e_test_plot
 @save_fig res_path f_test_plot
 @save_fig res_path f_test_cos
-DisplayAs.PNG(f_test_cos)
Example block output

This page was generated using Literate.jl.

+DisplayAs.PNG(f_test_cos)Example block output

This page was generated using Literate.jl.

diff --git a/previews/PR74/generated/LJ-Ar/lennard-jones-ar/index.html b/previews/PR74/generated/LJ-Ar/lennard-jones-ar/index.html index 9f7f0653..8d52c46f 100644 --- a/previews/PR74/generated/LJ-Ar/lennard-jones-ar/index.html +++ b/previews/PR74/generated/LJ-Ar/lennard-jones-ar/index.html @@ -4,10 +4,10 @@ using LinearAlgebra, Plots, DisplayAs

Define paths.

path = joinpath(dirname(pathof(PotentialLearning)), "../examples/LJ-Ar")
 ds_path = "$path/../data/LJ-AR/lj-ar.yaml"
"/home/runner/work/PotentialLearning.jl/PotentialLearning.jl/src/../examples/LJ-Ar/../data/LJ-AR/lj-ar.yaml"

Load atomistic dataset

ds, thermo = load_data(ds_path, YAML(:Ar, u"eV", u"Å"))
 ds = @views ds[2:end] # Filter first configuration (zero energy)
DataSet{num_configs = 10000} 
-	 Configuration{S, AtomsBase.FlexibleSystem{3, AtomsBase.Atom{3, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}, Unitful.Quantity{Float64, 𝐋 𝐓^-1, Unitful.FreeUnits{(a₀, s^-1), 𝐋 𝐓^-1, nothing}}, Unitful.Quantity{Float64, 𝐌, Unitful.FreeUnits{(u,), 𝐌, nothing}}}, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}, Energy, Forces}
-	 Configuration{S, AtomsBase.FlexibleSystem{3, AtomsBase.Atom{3, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}, Unitful.Quantity{Float64, 𝐋 𝐓^-1, Unitful.FreeUnits{(a₀, s^-1), 𝐋 𝐓^-1, nothing}}, Unitful.Quantity{Float64, 𝐌, Unitful.FreeUnits{(u,), 𝐌, nothing}}}, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}, Energy, Forces}
+	 Configuration{S, Energy, AtomsBase.FlexibleSystem{3, AtomsBase.Atom{3, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}, Unitful.Quantity{Float64, 𝐋 𝐓^-1, Unitful.FreeUnits{(a₀, s^-1), 𝐋 𝐓^-1, nothing}}, Unitful.Quantity{Float64, 𝐌, Unitful.FreeUnits{(u,), 𝐌, nothing}}}, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}, Forces}
+	 Configuration{S, Energy, AtomsBase.FlexibleSystem{3, AtomsBase.Atom{3, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}, Unitful.Quantity{Float64, 𝐋 𝐓^-1, Unitful.FreeUnits{(a₀, s^-1), 𝐋 𝐓^-1, nothing}}, Unitful.Quantity{Float64, 𝐌, Unitful.FreeUnits{(u,), 𝐌, nothing}}}, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}, Forces}
 	 ⋮
-	 Configuration{S, AtomsBase.FlexibleSystem{3, AtomsBase.Atom{3, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}, Unitful.Quantity{Float64, 𝐋 𝐓^-1, Unitful.FreeUnits{(a₀, s^-1), 𝐋 𝐓^-1, nothing}}, Unitful.Quantity{Float64, 𝐌, Unitful.FreeUnits{(u,), 𝐌, nothing}}}, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}, Energy, Forces}

Compute distance from origin, extract LJ energies, and define time range.

Get atom positions and compute distance from origin.

systems = get_system.(ds)
+	 Configuration{S, Energy, AtomsBase.FlexibleSystem{3, AtomsBase.Atom{3, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}, Unitful.Quantity{Float64, 𝐋 𝐓^-1, Unitful.FreeUnits{(a₀, s^-1), 𝐋 𝐓^-1, nothing}}, Unitful.Quantity{Float64, 𝐌, Unitful.FreeUnits{(u,), 𝐌, nothing}}}, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}, Forces}

Compute distance from origin, extract LJ energies, and define time range.

Get atom positions and compute distance from origin.

systems = get_system.(ds)
 n_atoms = length(first(systems)) # Note: in this dataset all systems contain the same no. of atoms
 positions = position.(systems)
 dists_origin = map(x->ustrip.(norm.(x)), positions)
10000-element Vector{Vector{Float64}}:
@@ -60,4 +60,4 @@
          xlabel = "τ | ps",
          ylabel = "Lennard Jones energy | eV",
          dpi = 300, fontsize = 12)
-DisplayAs.PNG(p)
Example block output

This page was generated using Literate.jl.

+DisplayAs.PNG(p)Example block output

This page was generated using Literate.jl.

diff --git a/previews/PR74/generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/0c5dfeea.png b/previews/PR74/generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/0c5dfeea.png new file mode 100644 index 00000000..ab1390eb Binary files /dev/null and b/previews/PR74/generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/0c5dfeea.png differ diff --git a/previews/PR74/generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/4dd5e734.png b/previews/PR74/generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/4dd5e734.png new file mode 100644 index 00000000..628a0e62 Binary files /dev/null and b/previews/PR74/generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/4dd5e734.png differ diff --git a/previews/PR74/generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/8b74a4b0.png b/previews/PR74/generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/8b74a4b0.png new file mode 100644 index 00000000..5eb9c920 Binary files /dev/null and b/previews/PR74/generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/8b74a4b0.png differ diff --git a/previews/PR74/generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/9300879a.png b/previews/PR74/generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/9300879a.png deleted file mode 100644 index 74f4e396..00000000 Binary files a/previews/PR74/generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/9300879a.png and /dev/null differ diff --git a/previews/PR74/generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/9cd5c006.png b/previews/PR74/generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/9cd5c006.png deleted file mode 100644 index 6b0ac89e..00000000 Binary files a/previews/PR74/generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/9cd5c006.png and /dev/null differ diff --git a/previews/PR74/generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/ac36f24b.png b/previews/PR74/generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/ac36f24b.png deleted file mode 100644 index 22b253e2..00000000 Binary files a/previews/PR74/generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/ac36f24b.png and /dev/null differ diff --git a/previews/PR74/generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/b64ebcf7.png b/previews/PR74/generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/b64ebcf7.png new file mode 100644 index 00000000..bfbdfc47 Binary files /dev/null and b/previews/PR74/generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/b64ebcf7.png differ diff --git a/previews/PR74/generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/bd36518d.png b/previews/PR74/generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/bd36518d.png deleted file mode 100644 index 660962f4..00000000 Binary files a/previews/PR74/generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/bd36518d.png and /dev/null differ diff --git a/previews/PR74/generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/index.html b/previews/PR74/generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/index.html index 9688981f..587d3e02 100644 --- a/previews/PR74/generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/index.html +++ b/previews/PR74/generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/index.html @@ -5,26 +5,26 @@ ds_path = "$path/../data/a-HfO2/a-HfO2-300K-NVT-6000.extxyz" res_path = "$path/results/"
"/home/runner/work/PotentialLearning.jl/PotentialLearning.jl/src/../examples/PCA-ACE-aHfO2/results/"

Load utility functions.

include("$path/../utils/utils.jl")
 #include("$path/pca.jl")

Create experiment folder.

run(`mkdir -p $res_path`)
Process(`mkdir -p /home/runner/work/PotentialLearning.jl/PotentialLearning.jl/src/../examples/PCA-ACE-aHfO2/results/`, ProcessExited(0))

Load atomistic dataset and split it into training and test.

Load atomistic dataset: atomistic configurations (atom positions, geometry, etc.) + DFT data (energies, forces, etc.)

ds = load_data(ds_path, uparse("eV"), uparse("Å"))
DataSet{num_configs = 6000} 
-	 Configuration{S, Energy, Forces, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}}
-	 Configuration{S, Energy, Forces, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}}
+	 Configuration{S, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}, Energy, Forces}
+	 Configuration{S, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}, Energy, Forces}
 	 ⋮
-	 Configuration{S, Energy, Forces, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}}

Split atomistic dataset into training and test

n_train, n_test = 50, 50 # only 50 samples per dataset are used in this example.
+	 Configuration{S, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}, Energy, Forces}

Split atomistic dataset into training and test

n_train, n_test = 50, 50 # only 50 samples per dataset are used in this example.
 conf_train, conf_test = split(ds[1:1000], n_train, n_test)
(DataSet{num_configs = 50} 
-	 Configuration{S, Energy, Forces, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}}
-	 Configuration{S, Energy, Forces, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}}
+	 Configuration{S, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}, Energy, Forces}
+	 Configuration{S, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}, Energy, Forces}
 	 ⋮
-	 Configuration{S, Energy, Forces, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}}, DataSet{num_configs = 50} 
-	 Configuration{S, Energy, Forces, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}}
-	 Configuration{S, Energy, Forces, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}}
+	 Configuration{S, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}, Energy, Forces}, DataSet{num_configs = 50} 
+	 Configuration{S, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}, Energy, Forces}
+	 Configuration{S, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}, Energy, Forces}
 	 ⋮
-	 Configuration{S, Energy, Forces, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}})

Create ACE basis, compute descriptors and add them to the dataset.

Create ACE basis

basis = ACE(species           = [:Hf, :O],
+	 Configuration{S, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}, Energy, Forces})

Create ACE basis, compute descriptors and add them to the dataset.

Create ACE basis

basis = ACE(species           = [:Hf, :O],
             body_order        = 3,
             polynomial_degree = 4,
             rcutoff           = 5.0,
             wL                = 1.0,
             csp               = 1.0,
             r0                = 1.0)
-@save_var res_path basis
43370

Compute ACE descriptors for energy and forces based on the atomistic training configurations.

println("Computing energy descriptors of training dataset...")
+@save_var res_path basis
43366

Compute ACE descriptors for energy and forces based on the atomistic training configurations.

println("Computing energy descriptors of training dataset...")
 e_descr_train = compute_local_descriptors(conf_train, basis;
                                           pbar=false)
 println("Computing force descriptors of training dataset...")
@@ -50,39 +50,39 @@
  ForceDescriptors{n = 96, d = 3}
  ForceDescriptors{n = 96, d = 3}
  ForceDescriptors{n = 96, d = 3}

Update training dataset by adding energy and force descriptors.

ds_train = DataSet(conf_train .+ e_descr_train .+ f_descr_train)
DataSet{num_configs = 50} 
-	 Configuration{S, Energy, LocalDescriptors, Forces, ForceDescriptors, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}}
-	 Configuration{S, Energy, LocalDescriptors, Forces, ForceDescriptors, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}}
+	 Configuration{S, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}, Energy, ForceDescriptors, Forces, LocalDescriptors}
+	 Configuration{S, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}, Energy, ForceDescriptors, Forces, LocalDescriptors}
 	 ⋮
-	 Configuration{S, Energy, LocalDescriptors, Forces, ForceDescriptors, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}}

Dimension reduction of energy and force descriptors of training dataset.

n_desc = 20
+	 Configuration{S, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}, Energy, ForceDescriptors, Forces, LocalDescriptors}

Dimension reduction of energy and force descriptors of training dataset.

n_desc = 20
 pca = PCAState(tol = n_desc)
 fit!(ds_train, pca)
 transform!(ds_train, pca)
50-element Vector{Configuration}:
- Configuration{S, Energy, LocalDescriptors, Forces, ForceDescriptors, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}}
- Configuration{S, Energy, LocalDescriptors, Forces, ForceDescriptors, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}}
- Configuration{S, Energy, LocalDescriptors, Forces, ForceDescriptors, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}}
- Configuration{S, Energy, LocalDescriptors, Forces, ForceDescriptors, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}}
- Configuration{S, Energy, LocalDescriptors, Forces, ForceDescriptors, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}}
- Configuration{S, Energy, LocalDescriptors, Forces, ForceDescriptors, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}}
- Configuration{S, Energy, LocalDescriptors, Forces, ForceDescriptors, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}}
- Configuration{S, Energy, LocalDescriptors, Forces, ForceDescriptors, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}}
- Configuration{S, Energy, LocalDescriptors, Forces, ForceDescriptors, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}}
- Configuration{S, Energy, LocalDescriptors, Forces, ForceDescriptors, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}}
+ Configuration{S, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}, Energy, ForceDescriptors, Forces, LocalDescriptors}
+ Configuration{S, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}, Energy, ForceDescriptors, Forces, LocalDescriptors}
+ Configuration{S, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}, Energy, ForceDescriptors, Forces, LocalDescriptors}
+ Configuration{S, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}, Energy, ForceDescriptors, Forces, LocalDescriptors}
+ Configuration{S, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}, Energy, ForceDescriptors, Forces, LocalDescriptors}
+ Configuration{S, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}, Energy, ForceDescriptors, Forces, LocalDescriptors}
+ Configuration{S, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}, Energy, ForceDescriptors, Forces, LocalDescriptors}
+ Configuration{S, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}, Energy, ForceDescriptors, Forces, LocalDescriptors}
+ Configuration{S, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}, Energy, ForceDescriptors, Forces, LocalDescriptors}
+ Configuration{S, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}, Energy, ForceDescriptors, Forces, LocalDescriptors}
  ⋮
- Configuration{S, Energy, LocalDescriptors, Forces, ForceDescriptors, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}}
- Configuration{S, Energy, LocalDescriptors, Forces, ForceDescriptors, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}}
- Configuration{S, Energy, LocalDescriptors, Forces, ForceDescriptors, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}}
- Configuration{S, Energy, LocalDescriptors, Forces, ForceDescriptors, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}}
- Configuration{S, Energy, LocalDescriptors, Forces, ForceDescriptors, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}}
- Configuration{S, Energy, LocalDescriptors, Forces, ForceDescriptors, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}}
- Configuration{S, Energy, LocalDescriptors, Forces, ForceDescriptors, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}}
- Configuration{S, Energy, LocalDescriptors, Forces, ForceDescriptors, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}}
- Configuration{S, Energy, LocalDescriptors, Forces, ForceDescriptors, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}}

Learn ACE coefficients based on ACE descriptors and DFT data.

println("Learning energies and forces...")
+ Configuration{S, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}, Energy, ForceDescriptors, Forces, LocalDescriptors}
+ Configuration{S, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}, Energy, ForceDescriptors, Forces, LocalDescriptors}
+ Configuration{S, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}, Energy, ForceDescriptors, Forces, LocalDescriptors}
+ Configuration{S, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}, Energy, ForceDescriptors, Forces, LocalDescriptors}
+ Configuration{S, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}, Energy, ForceDescriptors, Forces, LocalDescriptors}
+ Configuration{S, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}, Energy, ForceDescriptors, Forces, LocalDescriptors}
+ Configuration{S, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}, Energy, ForceDescriptors, Forces, LocalDescriptors}
+ Configuration{S, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}, Energy, ForceDescriptors, Forces, LocalDescriptors}
+ Configuration{S, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}, Energy, ForceDescriptors, Forces, LocalDescriptors}

Learn ACE coefficients based on ACE descriptors and DFT data.

println("Learning energies and forces...")
 lb = LBasisPotential(basis)
 ws, int = [1.0, 1.0], true
 learn!(lb, ds_train, ws, int)
 @save_var res_path lb.β
 @save_var res_path lb.β0
-lb.β, lb.β0
([-0.3796948081870257, -0.5842262657393327, -0.30492628846530473, -0.8025281368076362, 3.0130918741538952, -2.007659324108391, 11.540404829363053, -20.164147152945795, -37.37031333550292, -10.493798285809564, -9.787771382381298, 82.09674283830194, 12.04369230491313, -27.551693547058697, -19.736797507447623, -58.06411200652325, -117.4405391058999, -162.84865529072164, -78.621826175569, -61.23910403237218], [-952.4735713828])

Post-process output: calculate metrics, create plots, and save results.

Compute ACE descriptors for energy and forces based on the atomistic test configurations.

println("Computing energy descriptors of test dataset...")
+lb.β, lb.β0
([-0.4135780353297041, 0.8136045603317855, -0.22025433458629187, -1.5379130375157155, -2.0140241635486804, -1.5679405866438494, 5.5316527060231815, -22.346702980119076, -46.79252941982812, -3.310865049257449, -2.458368731105003, 62.74910920806256, -72.08966099725798, 91.21625874621247, -0.012606284538777518, -19.04296245282672, 124.04746059906157, -8.862579608127081, -187.24322191145347, -7.891819896524654], [-952.4852856285999])

Post-process output: calculate metrics, create plots, and save results.

Compute ACE descriptors for energy and forces based on the atomistic test configurations.

println("Computing energy descriptors of test dataset...")
 e_descr_test = compute_local_descriptors(conf_test, basis;
                                          pbar = false)
 println("Computing force descriptors of test dataset...")
@@ -108,30 +108,30 @@
  ForceDescriptors{n = 96, d = 3}
  ForceDescriptors{n = 96, d = 3}
  ForceDescriptors{n = 96, d = 3}

Update test dataset by adding energy and force descriptors.

ds_test = DataSet(conf_test .+ e_descr_test .+ f_descr_test)
DataSet{num_configs = 50} 
-	 Configuration{S, Energy, LocalDescriptors, Forces, ForceDescriptors, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}}
-	 Configuration{S, Energy, LocalDescriptors, Forces, ForceDescriptors, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}}
+	 Configuration{S, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}, Energy, ForceDescriptors, Forces, LocalDescriptors}
+	 Configuration{S, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}, Energy, ForceDescriptors, Forces, LocalDescriptors}
 	 ⋮
-	 Configuration{S, Energy, LocalDescriptors, Forces, ForceDescriptors, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}}

Dimension reduction of energy and force descriptors of test dataset.

transform!(ds_test, pca)
50-element Vector{Configuration}:
- Configuration{S, Energy, LocalDescriptors, Forces, ForceDescriptors, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}}
- Configuration{S, Energy, LocalDescriptors, Forces, ForceDescriptors, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}}
- Configuration{S, Energy, LocalDescriptors, Forces, ForceDescriptors, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}}
- Configuration{S, Energy, LocalDescriptors, Forces, ForceDescriptors, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}}
- Configuration{S, Energy, LocalDescriptors, Forces, ForceDescriptors, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}}
- Configuration{S, Energy, LocalDescriptors, Forces, ForceDescriptors, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}}
- Configuration{S, Energy, LocalDescriptors, Forces, ForceDescriptors, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}}
- Configuration{S, Energy, LocalDescriptors, Forces, ForceDescriptors, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}}
- Configuration{S, Energy, LocalDescriptors, Forces, ForceDescriptors, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}}
- Configuration{S, Energy, LocalDescriptors, Forces, ForceDescriptors, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}}
+	 Configuration{S, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}, Energy, ForceDescriptors, Forces, LocalDescriptors}

Dimension reduction of energy and force descriptors of test dataset.

transform!(ds_test, pca)
50-element Vector{Configuration}:
+ Configuration{S, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}, Energy, ForceDescriptors, Forces, LocalDescriptors}
+ Configuration{S, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}, Energy, ForceDescriptors, Forces, LocalDescriptors}
+ Configuration{S, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}, Energy, ForceDescriptors, Forces, LocalDescriptors}
+ Configuration{S, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}, Energy, ForceDescriptors, Forces, LocalDescriptors}
+ Configuration{S, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}, Energy, ForceDescriptors, Forces, LocalDescriptors}
+ Configuration{S, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}, Energy, ForceDescriptors, Forces, LocalDescriptors}
+ Configuration{S, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}, Energy, ForceDescriptors, Forces, LocalDescriptors}
+ Configuration{S, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}, Energy, ForceDescriptors, Forces, LocalDescriptors}
+ Configuration{S, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}, Energy, ForceDescriptors, Forces, LocalDescriptors}
+ Configuration{S, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}, Energy, ForceDescriptors, Forces, LocalDescriptors}
  ⋮
- Configuration{S, Energy, LocalDescriptors, Forces, ForceDescriptors, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}}
- Configuration{S, Energy, LocalDescriptors, Forces, ForceDescriptors, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}}
- Configuration{S, Energy, LocalDescriptors, Forces, ForceDescriptors, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}}
- Configuration{S, Energy, LocalDescriptors, Forces, ForceDescriptors, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}}
- Configuration{S, Energy, LocalDescriptors, Forces, ForceDescriptors, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}}
- Configuration{S, Energy, LocalDescriptors, Forces, ForceDescriptors, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}}
- Configuration{S, Energy, LocalDescriptors, Forces, ForceDescriptors, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}}
- Configuration{S, Energy, LocalDescriptors, Forces, ForceDescriptors, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}}
- Configuration{S, Energy, LocalDescriptors, Forces, ForceDescriptors, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}}

Get true and predicted values for energies and forces.

n_atoms_train = length.(get_system.(ds_train))
+ Configuration{S, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}, Energy, ForceDescriptors, Forces, LocalDescriptors}
+ Configuration{S, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}, Energy, ForceDescriptors, Forces, LocalDescriptors}
+ Configuration{S, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}, Energy, ForceDescriptors, Forces, LocalDescriptors}
+ Configuration{S, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}, Energy, ForceDescriptors, Forces, LocalDescriptors}
+ Configuration{S, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}, Energy, ForceDescriptors, Forces, LocalDescriptors}
+ Configuration{S, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}, Energy, ForceDescriptors, Forces, LocalDescriptors}
+ Configuration{S, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}, Energy, ForceDescriptors, Forces, LocalDescriptors}
+ Configuration{S, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}, Energy, ForceDescriptors, Forces, LocalDescriptors}
+ Configuration{S, AtomsBase.FlexibleSystem{3, AtomsBase.Atom, Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(Å,), 𝐋, nothing}}}, Energy, ForceDescriptors, Forces, LocalDescriptors}

Get true and predicted values for energies and forces.

n_atoms_train = length.(get_system.(ds_train))
 n_atoms_test = length.(get_system.(ds_test))
 
 e_train, e_train_pred = get_all_energies(ds_train) ./ n_atoms_train,
@@ -150,7 +150,7 @@
 @save_var res_path e_test
 @save_var res_path e_test_pred
 @save_var res_path f_test
-@save_var res_path f_test_pred
301910

Compute training metrics.

e_train_metrics = get_metrics(e_train, e_train_pred,
+@save_var res_path f_test_pred
301704

Compute training metrics.

e_train_metrics = get_metrics(e_train, e_train_pred,
                               metrics = [mae, rmse, rsq],
                               label = "e_train")
 f_train_metrics = get_metrics(f_train, f_train_pred,
@@ -159,13 +159,13 @@
 train_metrics = merge(e_train_metrics, f_train_metrics)
 @save_dict res_path train_metrics
 train_metrics
OrderedCollections.OrderedDict{String, Float64} with 7 entries:
-  "e_train_mae"      => 0.00271788
-  "e_train_rmse"     => 0.00341328
-  "e_train_rsq"      => 0.276592
-  "f_train_mae"      => 0.244539
-  "f_train_rmse"     => 0.310724
-  "f_train_rsq"      => 0.64245
-  "f_train_mean_cos" => 0.791847

Compute test metrics.

e_test_metrics = get_metrics(e_test, e_test_pred,
+  "e_train_mae"      => 0.00293212
+  "e_train_rmse"     => 0.00357429
+  "e_train_rsq"      => 0.375649
+  "f_train_mae"      => 0.246979
+  "f_train_rmse"     => 0.313317
+  "f_train_rsq"      => 0.632138
+  "f_train_mean_cos" => 0.792823

Compute test metrics.

e_test_metrics = get_metrics(e_test, e_test_pred,
                              metrics = [mae, rmse, rsq],
                              label = "e_test")
 f_test_metrics = get_metrics(f_test, f_test_pred,
@@ -174,28 +174,28 @@
 test_metrics = merge(e_test_metrics, f_test_metrics)
 @save_dict res_path test_metrics
 test_metrics
OrderedCollections.OrderedDict{String, Float64} with 7 entries:
-  "e_test_mae"      => 0.00231212
-  "e_test_rmse"     => 0.00270436
-  "e_test_rsq"      => 0.345383
-  "f_test_mae"      => 0.241552
-  "f_test_rmse"     => 0.305913
-  "f_test_rsq"      => 0.633265
-  "f_test_mean_cos" => 0.788452

Plot and save energy results.

e_plot = plot_energy(e_train, e_train_pred,
+  "e_test_mae"      => 0.00265815
+  "e_test_rmse"     => 0.00316107
+  "e_test_rsq"      => -0.0802281
+  "f_test_mae"      => 0.238697
+  "f_test_rmse"     => 0.302379
+  "f_test_rsq"      => 0.6503
+  "f_test_mean_cos" => 0.79437

Plot and save energy results.

e_plot = plot_energy(e_train, e_train_pred,
                      e_test, e_test_pred)
 @save_fig res_path e_plot
-DisplayAs.PNG(e_plot)
Example block output

Plot and save force results.

f_plot = plot_forces(f_train, f_train_pred,
+DisplayAs.PNG(e_plot)
Example block output

Plot and save force results.

f_plot = plot_forces(f_train, f_train_pred,
                      f_test, f_test_pred)
 @save_fig res_path f_plot
-DisplayAs.PNG(f_plot)
Example block output

Plot and save training force cosine.

e_train_plot = plot_energy(e_train, e_train_pred)
+DisplayAs.PNG(f_plot)
Example block output

Plot and save training force cosine.

e_train_plot = plot_energy(e_train, e_train_pred)
 f_train_plot = plot_forces(f_train, f_train_pred)
 f_train_cos  = plot_cos(f_train, f_train_pred)
 @save_fig res_path e_train_plot
 @save_fig res_path f_train_plot
 @save_fig res_path f_train_cos
-DisplayAs.PNG(f_train_cos)
Example block output

Plot and save test force cosine.

e_test_plot = plot_energy(e_test, e_test_pred)
+DisplayAs.PNG(f_train_cos)
Example block output

Plot and save test force cosine.

e_test_plot = plot_energy(e_test, e_test_pred)
 f_test_plot = plot_forces(f_test, f_test_pred)
 f_test_cos  = plot_cos(f_test, f_test_pred)
 @save_fig res_path e_test_plot
 @save_fig res_path f_test_plot
 @save_fig res_path f_test_cos
-DisplayAs.PNG(f_test_cos)
Example block output

This page was generated using Literate.jl.

+DisplayAs.PNG(f_test_cos)Example block output

This page was generated using Literate.jl.

diff --git a/previews/PR74/how-to-run-the-examples/index.html b/previews/PR74/how-to-run-the-examples/index.html index 88afe8ea..1b1542f7 100644 --- a/previews/PR74/how-to-run-the-examples/index.html +++ b/previews/PR74/how-to-run-the-examples/index.html @@ -2,4 +2,4 @@ How to run the examples · PotentialLearning.jl

How to run the examples

Add registries

Open a Julia REPL ($ julia), type ] to enter the Pkg REPL, and add the following registries:

    pkg> registry add https://github.com/JuliaRegistries/General
     pkg> registry add https://github.com/cesmix-mit/CESMIX.git 
     pkg> registry add https://github.com/JuliaMolSim/MolSim.git
-    pkg> registry add https://github.com/ACEsuit/ACEregistry

Clone repository and access an example folder

Clone PotentialLearning.jl repository in your working directory.

    $ git clone git@github.com:cesmix-mit/PotentialLearning.jl.git

Access to any folder within PotentialLearning.jl/examples. E.g.

    $ cd PotentialLearning.jl/examples/Na

Run example

Open a Julia REPL, activate the examples folder project, and define the number of threads.

    $ julia --project=./ --threads=4

Type ] to enter the Pkg REPL and instantiate.

    pkg> instantiate

Finally, include the example file.

    julia> include("fit-dpp-ace-na.jl")
+ pkg> registry add https://github.com/ACEsuit/ACEregistry

Clone repository and access an example folder

Clone PotentialLearning.jl repository in your working directory.

    $ git clone git@github.com:cesmix-mit/PotentialLearning.jl.git

Access to any folder within PotentialLearning.jl/examples. E.g.

    $ cd PotentialLearning.jl/examples/Na

Run example

Open a Julia REPL, activate the examples folder project, and define the number of threads.

    $ julia --project=./ --threads=4

Type ] to enter the Pkg REPL and instantiate.

    pkg> instantiate

Finally, include the example file.

    julia> include("fit-dpp-ace-na.jl")
diff --git a/previews/PR74/index.html b/previews/PR74/index.html index dcaafddc..07fb937f 100644 --- a/previews/PR74/index.html +++ b/previews/PR74/index.html @@ -1,2 +1,2 @@ -Home · PotentialLearning.jl

[WIP] PotentialLearning.jl

Composable optimization workflows for fast and accurate interatomic potentials. This package is part of a software suite developed for the CESMIX project.

Goals

Optimize your atomistic data: intelligent subsampling of large datasets to reduce DFT computations

  • Intelligent subsampling of atomistic configurations using algorithms based on DPP, DBSCAN, CUR, etc.
  • Highly scalable parallel subsampling via hierarchical subsampling and distributed parallelism (Dagger.jl).
  • Optimal subsampler choosing via Hyperopt.jl.

Optimize your interatomic potential model: hyperparameters, coefficients, model compression, and model selection.

  • Parallel optimization of hyperparameters, coefficients, and model selection via Hyperopt.jl; multi-objective optimization (Pareto fronts): force execution time vs fitting accuracy (e.g. MAE of energies and forces).
  • Model compression via feature selection (e.g. CUR) and dimensionality reduction (e.g PCA, Active Subspaces) of atomistic descriptors.
  • Fitting of linear potentials and inference of parameter uncertainties. Training of neural versions of Julia-ACE and LAMMPS-POD.

Additionally, this package provides utilities for atomistic configuration and DFT data management and post-processing.

  • Process input data so that it is ready for training. E.g. read XYZ file with atomic configurations, linearize energies and forces, split dataset into training and testing, normalize data, transfer data to GPU, define iterators, etc.
  • Post-processing: computation of different metrics (MAE, RSQ, COV, etc), saving results, and plotting.

Leveraging Julia!

  • Software composability through multiple dispatch. A series of composable workflows is guiding our design and development. We analyzed three of the most representative workflows: classical molecular dynamics (MD), Ab initio MD, and classical MD with active learning. In addition, it facilitates the training of new potentials defined by the composition of neural networks with state-of-the-art interatomic potential descriptors.
  • Differentiable programming. Powerful automatic differentiation tools, such as Enzyme or Zygote, help to accelerate the development of new interatomic potentials by automatically calculating loss function gradients and forces.
  • SciML: Open Source Software for Scientific Machine Learning. It provides libraries, such as Optimization.jl, that bring together several optimization packages into one unified Julia interface.
  • Machine learning and HPC abstractions: Flux.jl makes parallel learning simple using the NVIDIA GPU abstractions of CUDA.jl. Mini-batch iterations on heterogeneous data, as required by a loss function based on energies and forces, can be handled by DataLoader.jl.
+Home · PotentialLearning.jl

[WIP] PotentialLearning.jl

Composable optimization workflows for fast and accurate interatomic potentials. This package is part of a software suite developed for the CESMIX project.

Goals

Optimize your atomistic data: intelligent subsampling of large datasets to reduce DFT computations

  • Intelligent subsampling of atomistic configurations using algorithms based on DPP, DBSCAN, CUR, etc.
  • Highly scalable parallel subsampling via hierarchical subsampling and distributed parallelism (Dagger.jl).
  • Optimal subsampler choosing via Hyperopt.jl.

Optimize your interatomic potential model: hyperparameters, coefficients, model compression, and model selection.

  • Parallel optimization of hyperparameters, coefficients, and model selection via Hyperopt.jl; multi-objective optimization (Pareto fronts): force execution time vs fitting accuracy (e.g. MAE of energies and forces).
  • Model compression via feature selection (e.g. CUR) and dimensionality reduction (e.g PCA, Active Subspaces) of atomistic descriptors.
  • Fitting of linear potentials and inference of parameter uncertainties. Training of neural versions of Julia-ACE and LAMMPS-POD.

Additionally, this package provides utilities for atomistic configuration and DFT data management and post-processing.

  • Process input data so that it is ready for training. E.g. read XYZ file with atomic configurations, linearize energies and forces, split dataset into training and testing, normalize data, transfer data to GPU, define iterators, etc.
  • Post-processing: computation of different metrics (MAE, RSQ, COV, etc), saving results, and plotting.

Leveraging Julia!

  • Software composability through multiple dispatch. A series of composable workflows is guiding our design and development. We analyzed three of the most representative workflows: classical molecular dynamics (MD), Ab initio MD, and classical MD with active learning. In addition, it facilitates the training of new potentials defined by the composition of neural networks with state-of-the-art interatomic potential descriptors.
  • Differentiable programming. Powerful automatic differentiation tools, such as Enzyme or Zygote, help to accelerate the development of new interatomic potentials by automatically calculating loss function gradients and forces.
  • SciML: Open Source Software for Scientific Machine Learning. It provides libraries, such as Optimization.jl, that bring together several optimization packages into one unified Julia interface.
  • Machine learning and HPC abstractions: Flux.jl makes parallel learning simple using the NVIDIA GPU abstractions of CUDA.jl. Mini-batch iterations on heterogeneous data, as required by a loss function based on energies and forces, can be handled by DataLoader.jl.