diff --git a/previews/PR84/.documenter-siteinfo.json b/previews/PR84/.documenter-siteinfo.json index 0a098d7..4137fd9 100644 --- a/previews/PR84/.documenter-siteinfo.json +++ b/previews/PR84/.documenter-siteinfo.json @@ -1 +1 @@ -{"documenter":{"julia_version":"1.10.4","generation_timestamp":"2024-07-14T20:30:01","documenter_version":"1.5.0"}} \ No newline at end of file +{"documenter":{"julia_version":"1.10.4","generation_timestamp":"2024-07-14T20:53:13","documenter_version":"1.5.0"}} \ No newline at end of file diff --git a/previews/PR84/api/index.html b/previews/PR84/api/index.html index c21affd..908fb91 100644 --- a/previews/PR84/api/index.html +++ b/previews/PR84/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
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
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_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_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.hyperlearn!Method

function hyperlearn!( model::DataType, pars::OrderedDict, conftrain::DataSet; nsamples = 5, sampler = RandomSampler(), loss = loss, ws = [1.0, 1.0], int = true )

Hyper-parameter optimization of linear interatomic potentials.

source
PotentialLearning.hyperlossMethod

function hyperloss( metrics::OrderedDict: we = 1.0, wf = 1.0, wt = 1.0E-3, emaemax = 0.05, fmae_max = 0.05 )

metrics: OrderedDict object with metrics of the fitting process. - Mean absolute error of energies: emae. - Mean absolute error of forces: fmae. - Time per force per atom: timeus. `we: energy weight.wf: force weight.wt: time weight.emaemax: maximum mean absolute error for energies.fmaemax`: maximum mean absolute error for forces.

Loss function for hyper-parameter optimization: minimizes fitting error and time.

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_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_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.hyperlearn!Method

function hyperlearn!( model::DataType, pars::OrderedDict, conftrain::DataSet; nsamples = 5, sampler = RandomSampler(), loss = loss, ws = [1.0, 1.0], int = true )

Hyper-parameter optimization of linear interatomic potentials.

source
PotentialLearning.hyperlossMethod

function hyperloss( metrics::OrderedDict: we = 1.0, wf = 1.0, wt = 1.0E-3, emaemax = 0.05, fmae_max = 0.05 )

metrics: OrderedDict object with metrics of the fitting process. - Mean absolute error of energies: emae. - Mean absolute error of forces: fmae. - Time per force per atom: timeus. `we: energy weight.wf: force weight.wt: time weight.emaemax: maximum mean absolute error for energies.fmaemax`: maximum mean absolute error for forces.

Loss function for hyper-parameter optimization: minimizes fitting error and time.

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/PR84/generated/ACE-aHfO2/fit-ace-ahfo2/065bddf5.png b/previews/PR84/generated/ACE-aHfO2/fit-ace-ahfo2/065bddf5.png new file mode 100644 index 0000000..7302368 Binary files /dev/null and b/previews/PR84/generated/ACE-aHfO2/fit-ace-ahfo2/065bddf5.png differ diff --git a/previews/PR84/generated/ACE-aHfO2/fit-ace-ahfo2/5828a568.png b/previews/PR84/generated/ACE-aHfO2/fit-ace-ahfo2/5828a568.png new file mode 100644 index 0000000..2172fd4 Binary files /dev/null and b/previews/PR84/generated/ACE-aHfO2/fit-ace-ahfo2/5828a568.png differ diff --git a/previews/PR84/generated/ACE-aHfO2/fit-ace-ahfo2/876fc9fd.png b/previews/PR84/generated/ACE-aHfO2/fit-ace-ahfo2/876fc9fd.png deleted file mode 100644 index 9e4900f..0000000 Binary files a/previews/PR84/generated/ACE-aHfO2/fit-ace-ahfo2/876fc9fd.png and /dev/null differ diff --git a/previews/PR84/generated/ACE-aHfO2/fit-ace-ahfo2/93fb20c4.png b/previews/PR84/generated/ACE-aHfO2/fit-ace-ahfo2/93fb20c4.png new file mode 100644 index 0000000..b47fb1e Binary files /dev/null and b/previews/PR84/generated/ACE-aHfO2/fit-ace-ahfo2/93fb20c4.png differ diff --git a/previews/PR84/generated/ACE-aHfO2/fit-ace-ahfo2/a3e136da.png b/previews/PR84/generated/ACE-aHfO2/fit-ace-ahfo2/a3e136da.png new file mode 100644 index 0000000..9fb9908 Binary files /dev/null and b/previews/PR84/generated/ACE-aHfO2/fit-ace-ahfo2/a3e136da.png differ diff --git a/previews/PR84/generated/ACE-aHfO2/fit-ace-ahfo2/b4a5900e.png b/previews/PR84/generated/ACE-aHfO2/fit-ace-ahfo2/b4a5900e.png deleted file mode 100644 index 3f09e20..0000000 Binary files a/previews/PR84/generated/ACE-aHfO2/fit-ace-ahfo2/b4a5900e.png and /dev/null differ diff --git a/previews/PR84/generated/ACE-aHfO2/fit-ace-ahfo2/e01ce35e.png b/previews/PR84/generated/ACE-aHfO2/fit-ace-ahfo2/e01ce35e.png deleted file mode 100644 index 00888b7..0000000 Binary files a/previews/PR84/generated/ACE-aHfO2/fit-ace-ahfo2/e01ce35e.png and /dev/null differ diff --git a/previews/PR84/generated/ACE-aHfO2/fit-ace-ahfo2/e46be6f3.png b/previews/PR84/generated/ACE-aHfO2/fit-ace-ahfo2/e46be6f3.png deleted file mode 100644 index 4e4958b..0000000 Binary files a/previews/PR84/generated/ACE-aHfO2/fit-ace-ahfo2/e46be6f3.png and /dev/null differ diff --git a/previews/PR84/generated/ACE-aHfO2/fit-ace-ahfo2/index.html b/previews/PR84/generated/ACE-aHfO2/fit-ace-ahfo2/index.html index 0354295..3d545e7 100644 --- a/previews/PR84/generated/ACE-aHfO2/fit-ace-ahfo2/index.html +++ b/previews/PR84/generated/ACE-aHfO2/fit-ace-ahfo2/index.html @@ -50,7 +50,7 @@ learn!(lb, ds_train, ws, int) @save_var res_path lb.β @save_var res_path lb.β0 -lb.β, lb.β0
([1001.1698497533798, 520.2417706251144, 186.64902985095978, 34.05733581446111, 115.6989834997803, 34.89271420217119, -17.48350385064259, -0.7188793327659369, 9748.926515579224, 5355.464530944824  …  144.0935276299715, 60.599256217479706, -1723.5653915405273, -475.87929916381836, 109.70664930343628, -1344.190481185913, 2513.2482299804688, 3144.4865493774414, -956.5331473946571, -846.2002086639404], [0.0])

Post-process results

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

println("Computing energy descriptors of test dataset...")
+lb.β, lb.β0
([780.5141793489456, 437.98936384916306, 169.29692785441875, 32.18506378494203, 93.58582463860512, 21.663394873961806, -25.325369023019448, -4.765742309449706, 8829.699081420898, 4827.555494308472  …  177.42781195323914, 62.89208509027958, -2425.869758605957, -637.7372426986694, 130.5160734653473, -1856.4738302230835, 3445.7537689208984, 4461.270923614502, -1085.116563796997, -1213.382966041565], [0.0])

Post-process 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,13 +84,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.00164371
-  "e_train_rmse"     => 0.00200351
-  "e_train_rsq"      => 0.503956
-  "f_train_mae"      => 0.172798
-  "f_train_rmse"     => 0.220975
-  "f_train_rsq"      => 0.848918
-  "f_train_mean_cos" => 0.888441

Compute and save test metrics.

e_test_metrics = get_metrics(e_test, e_test_pred,
+  "e_train_mae"      => 0.00197873
+  "e_train_rmse"     => 0.00236388
+  "e_train_rsq"      => 0.445006
+  "f_train_mae"      => 0.171558
+  "f_train_rmse"     => 0.219571
+  "f_train_rsq"      => 0.853624
+  "f_train_mean_cos" => 0.888676

Compute and save 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,
@@ -99,28 +99,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.000914066
-  "e_test_rmse"     => 0.00113829
-  "e_test_rsq"      => 0.887067
-  "f_test_mae"      => 0.172838
-  "f_test_rmse"     => 0.218647
-  "f_test_rsq"      => 0.851475
-  "f_test_mean_cos" => 0.887394

Plot and save energy results.

e_plot = plot_energy(e_train, e_train_pred,
+  "e_test_mae"      => 0.000679435
+  "e_test_rmse"     => 0.000838268
+  "e_test_rsq"      => 0.931151
+  "f_test_mae"      => 0.174184
+  "f_test_rmse"     => 0.220284
+  "f_test_rsq"      => 0.844581
+  "f_test_mean_cos" => 0.886392

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/PR84/generated/DPP-ACE-Na/fit-dpp-ace-na/71360069.svg b/previews/PR84/generated/DPP-ACE-Na/fit-dpp-ace-na/71360069.svg new file mode 100644 index 0000000..cef8de5 --- /dev/null +++ b/previews/PR84/generated/DPP-ACE-Na/fit-dpp-ace-na/71360069.svg @@ -0,0 +1,2161 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/previews/PR84/generated/DPP-ACE-Na/fit-dpp-ace-na/fbe14cca.svg b/previews/PR84/generated/DPP-ACE-Na/fit-dpp-ace-na/fbe14cca.svg deleted file mode 100644 index 06e267e..0000000 --- a/previews/PR84/generated/DPP-ACE-Na/fit-dpp-ace-na/fbe14cca.svg +++ /dev/null @@ -1,2155 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/previews/PR84/generated/DPP-ACE-Na/fit-dpp-ace-na/index.html b/previews/PR84/generated/DPP-ACE-Na/fit-dpp-ace-na/index.html index 68d8ab4..dbf6fd4 100644 --- a/previews/PR84/generated/DPP-ACE-Na/fit-dpp-ace-na/index.html +++ b/previews/PR84/generated/DPP-ACE-Na/fit-dpp-ace-na/index.html @@ -2,7 +2,7 @@ Subsample Na dataset with DPP and fit with ACE · PotentialLearning.jl

Subsample Na dataset with DPP and fit energies with ACE

Setup experiment

Load packages.

using Unitful, UnitfulAtomic
 using AtomsBase, InteratomicPotentials, PotentialLearning
 using LinearAlgebra, Plots

Define paths.

base_path = haskey(ENV, "BASE_PATH") ? ENV["BASE_PATH"] : "../../"
-ds_path   = "$base_path/examples/data/Na/liquify_sodium.yaml"
"/home/runner/work/PotentialLearning.jl/PotentialLearning.jl/docs/..//examples/data/Na/liquify_sodium.yaml"

Load datasets

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"Å"))
+ds_path   = "$base_path/examples/data/Na/liquify_sodium.yaml";

Load datasets

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}
@@ -44,848 +44,14 @@
  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);

Subsample dataset

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}:
-    5
-    6
-    9
-   12
-   19
-   24
-   29
-   36
-   57
-   59
-    ⋮
-  990
-  991
-  992
-  993
-  994
-  995
-  997
-  999
- 1000

Learn coefficients

Learn ACE coefficients based on ACE descriptors and DFT data.

lb = LBasisPotential(ace)
+, 200)

Subsample trainig dataset.

dpp_inds = get_random_subset(dpp);

Learn coefficients

Learn ACE coefficients based on ACE descriptors and DFT data.

lb = LBasisPotential(ace)
 α = 1e-8
-Σ = learn!(lb, ds_train[dpp_inds], α)
UnivariateLinearProblem{T, [-0.13677743343561843, 0.6198644514265368, -1.4154113678009708, 2.000528877868419, -1.5534563803694823, -0.22690742912635642, 1.8508380915487805, 1.1027804487176809, -0.006357504463115671, 0.020888232573264887, -0.04925736021387905, 0.07146920496585807, -0.04929617790514129, -0.061635566404043995, 0.2830617758612206, -0.011900481565508159, 0.04384357035847941, -0.12523800940822838, 0.257181565017234, -0.41804369793516116, 0.005002523842328799, -0.017576812356073113, 0.04666064567489059, -0.007565664038709841, -0.13320754528039913, 0.2087949965405329, -0.2564214812541934, 0.026844413094153197, 0.7120794692085326, -0.32323020314294126, 0.6533862348575781, -1.3432651113884617, 0.12331411276935711, -0.5643498308249946, 0.2532717922704535, 0.8751845452277465, -2.6445889822525714, 1.2140687806944435, -0.0004932475965700733, 0.0014456694190272401, -0.003974340820771749, 0.007724662031673546, -0.011592240863399716, 0.013703637041214023, -0.0002227755780871421, 0.0008199035044263447, -0.00233828667318714, 0.004789923899926052, 0.0001099849567129732, -0.0003911569523208924, -0.007295870008749983, 0.014050731082147827, -0.02690409446967834, 0.039363971126736175, -0.0060382479959688595, 0.01218587977822061, -0.0533063943611225, 0.07039338420329244, 5.098180487649387e-5, 0.0012100679330786512, -0.00025879398985004243, -0.0036716764543607283, 0.0082052231818186, -0.00018565838647091604, -0.0044538476017450535, 0.012703260734162392, 0.013515432213162093, -0.0005903939032699534, 0.06333593227373413, -0.09848978397308628, 0.18516796203280705, 0.032803010902680896, 0.26043795363939637], [0.1771300852304998]}

Post-process 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);
Computing local descriptors of test dataset
-
0.1%┣                                         ┫ 1/1.1k [00:00<Inf:Inf, InfGs/it]
-
0.2%┣                                             ┫ 2/1.1k [00:00<01:00, 18it/s]
-
0.3%┣▏                                            ┫ 3/1.1k [00:00<01:06, 17it/s]
-
0.4%┣▏                                            ┫ 4/1.1k [00:00<01:07, 16it/s]
-
0.5%┣▏                                            ┫ 5/1.1k [00:00<01:18, 14it/s]
-
0.6%┣▎                                            ┫ 7/1.1k [00:00<01:10, 16it/s]
-
0.7%┣▎                                            ┫ 8/1.1k [00:00<01:14, 15it/s]
-
0.9%┣▍                                           ┫ 10/1.1k [00:01<01:08, 16it/s]
-
1.0%┣▍                                           ┫ 11/1.1k [00:01<01:07, 16it/s]
-
1.1%┣▌                                           ┫ 12/1.1k [00:01<01:08, 16it/s]
-
1.3%┣▋                                           ┫ 14/1.1k [00:01<01:05, 17it/s]
-
1.4%┣▋                                           ┫ 15/1.1k [00:01<01:05, 17it/s]
-
1.5%┣▋                                           ┫ 16/1.1k [00:01<01:05, 16it/s]
-
1.6%┣▊                                           ┫ 18/1.1k [00:01<01:03, 17it/s]
-
1.7%┣▊                                           ┫ 19/1.1k [00:01<01:03, 17it/s]
-
1.8%┣▉                                           ┫ 20/1.1k [00:01<01:04, 17it/s]
-
2.0%┣▉                                           ┫ 22/1.1k [00:01<01:02, 17it/s]
-
2.1%┣█                                           ┫ 23/1.1k [00:01<01:02, 17it/s]
-
2.2%┣█                                           ┫ 24/1.1k [00:01<01:03, 17it/s]
-
2.4%┣█                                           ┫ 26/1.1k [00:01<01:02, 17it/s]
-
2.5%┣█                                           ┫ 27/1.1k [00:02<01:02, 17it/s]
-
2.6%┣█▏                                          ┫ 28/1.1k [00:02<01:02, 17it/s]
-
2.7%┣█▏                                          ┫ 30/1.1k [00:02<01:01, 17it/s]
-
2.8%┣█▎                                          ┫ 31/1.1k [00:02<01:01, 17it/s]
-
2.9%┣█▎                                          ┫ 32/1.1k [00:02<01:01, 17it/s]
-
3.1%┣█▍                                          ┫ 34/1.1k [00:02<01:00, 17it/s]
-
3.2%┣█▍                                          ┫ 35/1.1k [00:02<01:00, 18it/s]
-
3.3%┣█▌                                          ┫ 36/1.1k [00:02<01:01, 17it/s]
-
3.5%┣█▌                                          ┫ 38/1.1k [00:02<01:00, 18it/s]
-
3.6%┣█▋                                          ┫ 39/1.1k [00:02<01:00, 18it/s]
-
3.7%┣█▋                                          ┫ 40/1.1k [00:02<01:00, 17it/s]
-
3.8%┣█▊                                          ┫ 42/1.1k [00:02<01:00, 18it/s]
-
3.9%┣█▊                                          ┫ 43/1.1k [00:02<00:59, 18it/s]
-
4.0%┣█▊                                          ┫ 44/1.1k [00:02<01:00, 18it/s]
-
4.2%┣█▉                                          ┫ 46/1.1k [00:03<00:59, 18it/s]
-
4.3%┣██                                          ┫ 47/1.1k [00:03<00:59, 18it/s]
-
4.4%┣██                                          ┫ 48/1.1k [00:03<00:59, 18it/s]
-
4.6%┣██                                          ┫ 50/1.1k [00:03<00:59, 18it/s]
-
4.7%┣██                                          ┫ 51/1.1k [00:03<00:59, 18it/s]
-
4.8%┣██                                          ┫ 52/1.1k [00:03<00:59, 18it/s]
-
4.9%┣██▏                                         ┫ 54/1.1k [00:03<00:58, 18it/s]
-
5.0%┣██▏                                         ┫ 55/1.1k [00:03<00:59, 18it/s]
-
5.1%┣██▎                                         ┫ 56/1.1k [00:03<00:59, 18it/s]
-
5.3%┣██▍                                         ┫ 58/1.1k [00:03<00:58, 18it/s]
-
5.4%┣██▍                                         ┫ 59/1.1k [00:03<00:58, 18it/s]
-
5.5%┣██▍                                         ┫ 60/1.1k [00:03<00:58, 18it/s]
-
5.7%┣██▌                                         ┫ 62/1.1k [00:03<00:58, 18it/s]
-
5.8%┣██▌                                         ┫ 63/1.1k [00:03<00:58, 18it/s]
-
5.9%┣██▋                                         ┫ 64/1.1k [00:04<00:58, 18it/s]
-
6.0%┣██▋                                         ┫ 66/1.1k [00:04<00:58, 18it/s]
-
6.1%┣██▊                                         ┫ 67/1.1k [00:04<00:58, 18it/s]
-
6.2%┣██▊                                         ┫ 68/1.1k [00:04<00:58, 18it/s]
-
6.4%┣██▉                                         ┫ 70/1.1k [00:04<00:57, 18it/s]
-
6.5%┣██▉                                         ┫ 71/1.1k [00:04<00:57, 18it/s]
-
6.6%┣███                                         ┫ 72/1.1k [00:04<00:57, 18it/s]
-
6.8%┣███                                         ┫ 74/1.1k [00:04<00:57, 18it/s]
-
6.9%┣███                                         ┫ 75/1.1k [00:04<00:57, 18it/s]
-
7.0%┣███                                         ┫ 76/1.1k [00:04<00:57, 18it/s]
-
7.1%┣███▏                                        ┫ 78/1.1k [00:04<00:57, 18it/s]
-
7.2%┣███▏                                        ┫ 79/1.1k [00:04<00:57, 18it/s]
-
7.3%┣███▎                                        ┫ 80/1.1k [00:04<00:57, 18it/s]
-
7.5%┣███▎                                        ┫ 82/1.1k [00:05<00:56, 18it/s]
-
7.6%┣███▍                                        ┫ 83/1.1k [00:05<00:56, 18it/s]
-
7.7%┣███▍                                        ┫ 84/1.1k [00:05<00:56, 18it/s]
-
7.9%┣███▌                                        ┫ 86/1.1k [00:05<00:56, 18it/s]
-
8.0%┣███▌                                        ┫ 87/1.1k [00:05<00:56, 18it/s]
-
8.1%┣███▌                                        ┫ 88/1.1k [00:05<00:56, 18it/s]
-
8.2%┣███▋                                        ┫ 90/1.1k [00:05<00:56, 18it/s]
-
8.3%┣███▊                                        ┫ 91/1.1k [00:05<00:56, 18it/s]
-
8.4%┣███▊                                        ┫ 92/1.1k [00:05<00:56, 18it/s]
-
8.6%┣███▉                                        ┫ 94/1.1k [00:05<00:56, 18it/s]
-
8.7%┣███▉                                        ┫ 95/1.1k [00:05<00:56, 18it/s]
-
8.8%┣███▉                                        ┫ 96/1.1k [00:05<00:56, 18it/s]
-
9.0%┣████                                        ┫ 98/1.1k [00:05<00:55, 18it/s]
-
9.1%┣████                                        ┫ 99/1.1k [00:05<00:55, 18it/s]
-
9.2%┣████                                       ┫ 100/1.1k [00:06<00:55, 18it/s]
-
9.3%┣████                                       ┫ 102/1.1k [00:06<00:55, 18it/s]
-
9.4%┣████                                       ┫ 103/1.1k [00:06<00:55, 18it/s]
-
9.5%┣████                                       ┫ 104/1.1k [00:06<00:55, 18it/s]
-
9.7%┣████▏                                      ┫ 106/1.1k [00:06<00:55, 18it/s]
-
9.8%┣████▏                                      ┫ 107/1.1k [00:06<00:55, 18it/s]
-
9.9%┣████▎                                      ┫ 108/1.1k [00:06<00:55, 18it/s]
-
10.1%┣████▎                                     ┫ 110/1.1k [00:06<00:54, 18it/s]
-
10.2%┣████▎                                     ┫ 111/1.1k [00:06<00:54, 18it/s]
-
10.3%┣████▎                                     ┫ 112/1.1k [00:06<00:55, 18it/s]
-
10.4%┣████▍                                     ┫ 114/1.1k [00:06<00:54, 18it/s]
-
10.5%┣████▍                                     ┫ 115/1.1k [00:06<00:54, 18it/s]
-
10.6%┣████▌                                     ┫ 116/1.1k [00:06<00:54, 18it/s]
-
10.8%┣████▌                                     ┫ 118/1.1k [00:06<00:54, 18it/s]
-
10.9%┣████▋                                     ┫ 119/1.1k [00:07<00:54, 18it/s]
-
11.0%┣████▋                                     ┫ 120/1.1k [00:07<00:54, 18it/s]
-
11.2%┣████▊                                     ┫ 122/1.1k [00:07<00:54, 18it/s]
-
11.3%┣████▊                                     ┫ 123/1.1k [00:07<00:54, 18it/s]
-
11.4%┣████▊                                     ┫ 124/1.1k [00:07<00:54, 18it/s]
-
11.5%┣████▉                                     ┫ 126/1.1k [00:07<00:54, 18it/s]
-
11.6%┣████▉                                     ┫ 127/1.1k [00:07<00:53, 18it/s]
-
11.7%┣█████                                     ┫ 128/1.1k [00:07<00:54, 18it/s]
-
11.9%┣█████                                     ┫ 130/1.1k [00:07<00:53, 18it/s]
-
12.0%┣█████                                     ┫ 131/1.1k [00:07<00:53, 18it/s]
-
12.1%┣█████                                     ┫ 132/1.1k [00:07<00:53, 18it/s]
-
12.3%┣█████▏                                    ┫ 134/1.1k [00:07<00:53, 18it/s]
-
12.4%┣█████▏                                    ┫ 135/1.1k [00:07<00:53, 18it/s]
-
12.5%┣█████▎                                    ┫ 136/1.1k [00:08<00:53, 18it/s]
-
12.6%┣█████▎                                    ┫ 138/1.1k [00:08<00:53, 18it/s]
-
12.7%┣█████▍                                    ┫ 139/1.1k [00:08<00:53, 18it/s]
-
12.8%┣█████▍                                    ┫ 140/1.1k [00:08<00:53, 18it/s]
-
13.0%┣█████▌                                    ┫ 142/1.1k [00:08<00:53, 18it/s]
-
13.1%┣█████▌                                    ┫ 143/1.1k [00:08<00:53, 18it/s]
-
13.2%┣█████▌                                    ┫ 144/1.1k [00:08<00:53, 18it/s]
-
13.4%┣█████▋                                    ┫ 146/1.1k [00:08<00:52, 18it/s]
-
13.5%┣█████▋                                    ┫ 147/1.1k [00:08<00:52, 18it/s]
-
13.6%┣█████▊                                    ┫ 148/1.1k [00:08<00:52, 18it/s]
-
13.6%┣█████▊                                    ┫ 149/1.1k [00:08<00:52, 18it/s]
-
13.8%┣█████▉                                    ┫ 151/1.1k [00:08<00:52, 18it/s]
-
13.9%┣█████▉                                    ┫ 152/1.1k [00:08<00:52, 18it/s]
-
14.1%┣██████                                    ┫ 154/1.1k [00:08<00:52, 18it/s]
-
14.2%┣██████                                    ┫ 155/1.1k [00:09<00:52, 18it/s]
-
14.3%┣██████                                    ┫ 156/1.1k [00:09<00:52, 18it/s]
-
14.5%┣██████                                    ┫ 158/1.1k [00:09<00:52, 18it/s]
-
14.6%┣██████▏                                   ┫ 159/1.1k [00:09<00:52, 18it/s]
-
14.7%┣██████▏                                   ┫ 160/1.1k [00:09<00:52, 18it/s]
-
14.8%┣██████▎                                   ┫ 162/1.1k [00:09<00:52, 18it/s]
-
14.9%┣██████▎                                   ┫ 163/1.1k [00:09<00:51, 18it/s]
-
15.0%┣██████▎                                   ┫ 164/1.1k [00:09<00:51, 18it/s]
-
15.1%┣██████▍                                   ┫ 165/1.1k [00:09<00:51, 18it/s]
-
15.3%┣██████▍                                   ┫ 167/1.1k [00:09<00:51, 18it/s]
-
15.4%┣██████▌                                   ┫ 168/1.1k [00:09<00:51, 18it/s]
-
15.5%┣██████▌                                   ┫ 169/1.1k [00:09<00:51, 18it/s]
-
15.7%┣██████▋                                   ┫ 171/1.1k [00:09<00:51, 18it/s]
-
15.8%┣██████▋                                   ┫ 172/1.1k [00:09<00:51, 18it/s]
-
15.8%┣██████▋                                   ┫ 173/1.1k [00:10<00:51, 18it/s]
-
16.0%┣██████▊                                   ┫ 175/1.1k [00:10<00:51, 18it/s]
-
16.1%┣██████▊                                   ┫ 176/1.1k [00:10<00:51, 18it/s]
-
16.2%┣██████▉                                   ┫ 177/1.1k [00:10<00:51, 18it/s]
-
16.4%┣██████▉                                   ┫ 179/1.1k [00:10<00:51, 18it/s]
-
16.5%┣███████                                   ┫ 180/1.1k [00:10<00:51, 18it/s]
-
16.6%┣███████                                   ┫ 181/1.1k [00:10<00:51, 18it/s]
-
16.8%┣███████                                   ┫ 183/1.1k [00:10<00:50, 18it/s]
-
16.8%┣███████                                   ┫ 184/1.1k [00:10<00:50, 18it/s]
-
16.9%┣███████▏                                  ┫ 185/1.1k [00:10<00:50, 18it/s]
-
17.1%┣███████▏                                  ┫ 187/1.1k [00:10<00:50, 18it/s]
-
17.2%┣███████▎                                  ┫ 188/1.1k [00:10<00:50, 18it/s]
-
17.3%┣███████▎                                  ┫ 189/1.1k [00:10<00:50, 18it/s]
-
17.5%┣███████▍                                  ┫ 191/1.1k [00:11<00:50, 18it/s]
-
17.6%┣███████▍                                  ┫ 192/1.1k [00:11<00:50, 18it/s]
-
17.7%┣███████▍                                  ┫ 193/1.1k [00:11<00:50, 18it/s]
-
17.9%┣███████▌                                  ┫ 195/1.1k [00:11<00:50, 18it/s]
-
17.9%┣███████▌                                  ┫ 196/1.1k [00:11<00:50, 18it/s]
-
18.0%┣███████▋                                  ┫ 197/1.1k [00:11<00:50, 18it/s]
-
18.2%┣███████▋                                  ┫ 199/1.1k [00:11<00:49, 18it/s]
-
18.3%┣███████▊                                  ┫ 200/1.1k [00:11<00:49, 18it/s]
-
18.4%┣███████▊                                  ┫ 201/1.1k [00:11<00:49, 18it/s]
-
18.6%┣███████▉                                  ┫ 203/1.1k [00:11<00:49, 18it/s]
-
18.7%┣███████▉                                  ┫ 204/1.1k [00:11<00:49, 18it/s]
-
18.8%┣███████▉                                  ┫ 205/1.1k [00:11<00:49, 18it/s]
-
19.0%┣████████                                  ┫ 207/1.1k [00:11<00:49, 18it/s]
-
19.0%┣████████                                  ┫ 208/1.1k [00:11<00:49, 18it/s]
-
19.1%┣████████                                  ┫ 209/1.1k [00:12<00:49, 18it/s]
-
19.3%┣████████▏                                 ┫ 211/1.1k [00:12<00:49, 18it/s]
-
19.4%┣████████▏                                 ┫ 212/1.1k [00:12<00:49, 18it/s]
-
19.5%┣████████▏                                 ┫ 213/1.1k [00:12<00:49, 18it/s]
-
19.7%┣████████▎                                 ┫ 215/1.1k [00:12<00:49, 18it/s]
-
19.8%┣████████▎                                 ┫ 216/1.1k [00:12<00:49, 18it/s]
-
19.9%┣████████▍                                 ┫ 217/1.1k [00:12<00:49, 18it/s]
-
20.1%┣████████▍                                 ┫ 219/1.1k [00:12<00:48, 18it/s]
-
20.1%┣████████▌                                 ┫ 220/1.1k [00:12<00:48, 18it/s]
-
20.2%┣████████▌                                 ┫ 221/1.1k [00:12<00:48, 18it/s]
-
20.3%┣████████▌                                 ┫ 222/1.1k [00:12<00:48, 18it/s]
-
20.5%┣████████▋                                 ┫ 224/1.1k [00:12<00:48, 18it/s]
-
20.6%┣████████▋                                 ┫ 225/1.1k [00:12<00:48, 18it/s]
-
20.7%┣████████▊                                 ┫ 226/1.1k [00:12<00:48, 18it/s]
-
20.9%┣████████▊                                 ┫ 228/1.1k [00:13<00:48, 18it/s]
-
21.0%┣████████▉                                 ┫ 229/1.1k [00:13<00:48, 18it/s]
-
21.1%┣████████▉                                 ┫ 230/1.1k [00:13<00:48, 18it/s]
-
21.2%┣█████████                                 ┫ 232/1.1k [00:13<00:48, 18it/s]
-
21.3%┣█████████                                 ┫ 233/1.1k [00:13<00:48, 18it/s]
-
21.4%┣█████████                                 ┫ 234/1.1k [00:13<00:48, 18it/s]
-
21.6%┣█████████                                 ┫ 236/1.1k [00:13<00:47, 18it/s]
-
21.7%┣█████████▏                                ┫ 237/1.1k [00:13<00:47, 18it/s]
-
21.8%┣█████████▏                                ┫ 238/1.1k [00:13<00:47, 18it/s]
-
22.0%┣█████████▎                                ┫ 240/1.1k [00:13<00:47, 18it/s]
-
22.1%┣█████████▎                                ┫ 241/1.1k [00:13<00:47, 18it/s]
-
22.2%┣█████████▎                                ┫ 242/1.1k [00:13<00:47, 18it/s]
-
22.3%┣█████████▍                                ┫ 244/1.1k [00:13<00:47, 18it/s]
-
22.4%┣█████████▍                                ┫ 245/1.1k [00:13<00:47, 18it/s]
-
22.5%┣█████████▌                                ┫ 246/1.1k [00:14<00:47, 18it/s]
-
22.7%┣█████████▌                                ┫ 248/1.1k [00:14<00:47, 18it/s]
-
22.8%┣█████████▋                                ┫ 249/1.1k [00:14<00:47, 18it/s]
-
22.9%┣█████████▋                                ┫ 250/1.1k [00:14<00:47, 18it/s]
-
23.1%┣█████████▊                                ┫ 252/1.1k [00:14<00:46, 18it/s]
-
23.2%┣█████████▊                                ┫ 253/1.1k [00:14<00:46, 18it/s]
-
23.3%┣█████████▊                                ┫ 254/1.1k [00:14<00:46, 18it/s]
-
23.4%┣█████████▉                                ┫ 256/1.1k [00:14<00:46, 18it/s]
-
23.5%┣█████████▉                                ┫ 257/1.1k [00:14<00:46, 18it/s]
-
23.6%┣██████████                                ┫ 258/1.1k [00:14<00:46, 18it/s]
-
23.8%┣██████████                                ┫ 260/1.1k [00:14<00:46, 18it/s]
-
23.9%┣██████████                                ┫ 261/1.1k [00:14<00:46, 18it/s]
-
24.0%┣██████████                                ┫ 262/1.1k [00:14<00:46, 18it/s]
-
24.1%┣██████████▏                               ┫ 263/1.1k [00:14<00:46, 18it/s]
-
24.3%┣██████████▏                               ┫ 265/1.1k [00:15<00:46, 18it/s]
-
24.4%┣██████████▎                               ┫ 266/1.1k [00:15<00:46, 18it/s]
-
24.5%┣██████████▎                               ┫ 267/1.1k [00:15<00:46, 18it/s]
-
24.6%┣██████████▍                               ┫ 269/1.1k [00:15<00:45, 18it/s]
-
24.7%┣██████████▍                               ┫ 270/1.1k [00:15<00:45, 18it/s]
-
24.8%┣██████████▍                               ┫ 271/1.1k [00:15<00:45, 18it/s]
-
25.0%┣██████████▌                               ┫ 273/1.1k [00:15<00:45, 18it/s]
-
25.1%┣██████████▌                               ┫ 274/1.1k [00:15<00:45, 18it/s]
-
25.2%┣██████████▋                               ┫ 275/1.1k [00:15<00:45, 18it/s]
-
25.4%┣██████████▋                               ┫ 277/1.1k [00:15<00:45, 18it/s]
-
25.5%┣██████████▊                               ┫ 278/1.1k [00:15<00:45, 18it/s]
-
25.5%┣██████████▊                               ┫ 279/1.1k [00:15<00:45, 18it/s]
-
25.7%┣██████████▉                               ┫ 281/1.1k [00:15<00:45, 18it/s]
-
25.8%┣██████████▉                               ┫ 282/1.1k [00:16<00:45, 18it/s]
-
25.9%┣██████████▉                               ┫ 283/1.1k [00:16<00:45, 18it/s]
-
26.1%┣███████████                               ┫ 285/1.1k [00:16<00:45, 18it/s]
-
26.2%┣███████████                               ┫ 286/1.1k [00:16<00:44, 18it/s]
-
26.3%┣███████████                               ┫ 287/1.1k [00:16<00:44, 18it/s]
-
26.5%┣███████████▏                              ┫ 289/1.1k [00:16<00:44, 18it/s]
-
26.6%┣███████████▏                              ┫ 290/1.1k [00:16<00:44, 18it/s]
-
26.6%┣███████████▏                              ┫ 291/1.1k [00:16<00:44, 18it/s]
-
26.8%┣███████████▎                              ┫ 293/1.1k [00:16<00:44, 18it/s]
-
26.9%┣███████████▎                              ┫ 294/1.1k [00:16<00:44, 18it/s]
-
27.0%┣███████████▍                              ┫ 295/1.1k [00:16<00:44, 18it/s]
-
27.2%┣███████████▍                              ┫ 297/1.1k [00:16<00:44, 18it/s]
-
27.3%┣███████████▌                              ┫ 298/1.1k [00:16<00:44, 18it/s]
-
27.4%┣███████████▌                              ┫ 299/1.1k [00:16<00:44, 18it/s]
-
27.5%┣███████████▌                              ┫ 300/1.1k [00:17<00:44, 18it/s]
-
27.7%┣███████████▋                              ┫ 302/1.1k [00:17<00:44, 18it/s]
-
27.7%┣███████████▋                              ┫ 303/1.1k [00:17<00:44, 18it/s]
-
27.8%┣███████████▊                              ┫ 304/1.1k [00:17<00:43, 18it/s]
-
28.0%┣███████████▊                              ┫ 306/1.1k [00:17<00:43, 18it/s]
-
28.1%┣███████████▉                              ┫ 307/1.1k [00:17<00:43, 18it/s]
-
28.2%┣███████████▉                              ┫ 308/1.1k [00:17<00:43, 18it/s]
-
28.4%┣████████████                              ┫ 310/1.1k [00:17<00:43, 18it/s]
-
28.5%┣████████████                              ┫ 311/1.1k [00:17<00:43, 18it/s]
-
28.6%┣████████████                              ┫ 312/1.1k [00:17<00:43, 18it/s]
-
28.8%┣████████████                              ┫ 314/1.1k [00:17<00:43, 18it/s]
-
28.8%┣████████████▏                             ┫ 315/1.1k [00:17<00:43, 18it/s]
-
28.9%┣████████████▏                             ┫ 316/1.1k [00:17<00:43, 18it/s]
-
29.1%┣████████████▎                             ┫ 318/1.1k [00:17<00:43, 18it/s]
-
29.2%┣████████████▎                             ┫ 319/1.1k [00:18<00:43, 18it/s]
-
29.3%┣████████████▎                             ┫ 320/1.1k [00:18<00:43, 18it/s]
-
29.5%┣████████████▍                             ┫ 322/1.1k [00:18<00:42, 18it/s]
-
29.6%┣████████████▍                             ┫ 323/1.1k [00:18<00:42, 18it/s]
-
29.7%┣████████████▌                             ┫ 324/1.1k [00:18<00:42, 18it/s]
-
29.8%┣████████████▌                             ┫ 325/1.1k [00:18<00:42, 18it/s]
-
29.9%┣████████████▋                             ┫ 327/1.1k [00:18<00:42, 18it/s]
-
30.0%┣████████████▋                             ┫ 328/1.1k [00:18<00:42, 18it/s]
-
30.1%┣████████████▋                             ┫ 329/1.1k [00:18<00:42, 18it/s]
-
30.3%┣████████████▊                             ┫ 331/1.1k [00:18<00:42, 18it/s]
-
30.4%┣████████████▊                             ┫ 332/1.1k [00:18<00:42, 18it/s]
-
30.5%┣████████████▉                             ┫ 333/1.1k [00:18<00:42, 18it/s]
-
30.7%┣████████████▉                             ┫ 335/1.1k [00:18<00:42, 18it/s]
-
30.8%┣█████████████                             ┫ 336/1.1k [00:18<00:42, 18it/s]
-
30.9%┣█████████████                             ┫ 337/1.1k [00:19<00:42, 18it/s]
-
31.0%┣█████████████                             ┫ 339/1.1k [00:19<00:42, 18it/s]
-
31.1%┣█████████████                             ┫ 340/1.1k [00:19<00:41, 18it/s]
-
31.2%┣█████████████▏                            ┫ 341/1.1k [00:19<00:41, 18it/s]
-
31.4%┣█████████████▏                            ┫ 343/1.1k [00:19<00:41, 18it/s]
-
31.5%┣█████████████▎                            ┫ 344/1.1k [00:19<00:41, 18it/s]
-
31.6%┣█████████████▎                            ┫ 345/1.1k [00:19<00:41, 18it/s]
-
31.8%┣█████████████▍                            ┫ 347/1.1k [00:19<00:41, 18it/s]
-
31.9%┣█████████████▍                            ┫ 348/1.1k [00:19<00:41, 18it/s]
-
32.0%┣█████████████▍                            ┫ 349/1.1k [00:19<00:41, 18it/s]
-
32.1%┣█████████████▌                            ┫ 351/1.1k [00:19<00:41, 18it/s]
-
32.2%┣█████████████▌                            ┫ 352/1.1k [00:19<00:41, 18it/s]
-
32.3%┣█████████████▋                            ┫ 353/1.1k [00:19<00:41, 18it/s]
-
32.4%┣█████████████▋                            ┫ 354/1.1k [00:19<00:41, 18it/s]
-
32.6%┣█████████████▊                            ┫ 356/1.1k [00:20<00:41, 18it/s]
-
32.7%┣█████████████▊                            ┫ 357/1.1k [00:20<00:41, 18it/s]
-
32.8%┣█████████████▊                            ┫ 358/1.1k [00:20<00:40, 18it/s]
-
33.0%┣█████████████▉                            ┫ 360/1.1k [00:20<00:40, 18it/s]
-
33.1%┣█████████████▉                            ┫ 361/1.1k [00:20<00:40, 18it/s]
-
33.2%┣██████████████                            ┫ 362/1.1k [00:20<00:40, 18it/s]
-
33.3%┣██████████████                            ┫ 364/1.1k [00:20<00:40, 18it/s]
-
33.4%┣██████████████                            ┫ 365/1.1k [00:20<00:40, 18it/s]
-
33.5%┣██████████████                            ┫ 366/1.1k [00:20<00:40, 18it/s]
-
33.7%┣██████████████▏                           ┫ 368/1.1k [00:20<00:40, 18it/s]
-
33.8%┣██████████████▏                           ┫ 369/1.1k [00:20<00:40, 18it/s]
-
33.9%┣██████████████▎                           ┫ 370/1.1k [00:20<00:40, 18it/s]
-
34.1%┣██████████████▎                           ┫ 372/1.1k [00:20<00:40, 18it/s]
-
34.2%┣██████████████▍                           ┫ 373/1.1k [00:21<00:40, 18it/s]
-
34.2%┣██████████████▍                           ┫ 374/1.1k [00:21<00:40, 18it/s]
-
34.3%┣██████████████▍                           ┫ 375/1.1k [00:21<00:40, 18it/s]
-
34.5%┣██████████████▌                           ┫ 377/1.1k [00:21<00:39, 18it/s]
-
34.6%┣██████████████▌                           ┫ 378/1.1k [00:21<00:39, 18it/s]
-
34.7%┣██████████████▋                           ┫ 379/1.1k [00:21<00:39, 18it/s]
-
34.9%┣██████████████▋                           ┫ 381/1.1k [00:21<00:39, 18it/s]
-
35.0%┣██████████████▊                           ┫ 382/1.1k [00:21<00:39, 18it/s]
-
35.1%┣██████████████▊                           ┫ 383/1.1k [00:21<00:39, 18it/s]
-
35.3%┣██████████████▉                           ┫ 385/1.1k [00:21<00:39, 18it/s]
-
35.3%┣██████████████▉                           ┫ 386/1.1k [00:21<00:39, 18it/s]
-
35.4%┣██████████████▉                           ┫ 387/1.1k [00:21<00:39, 18it/s]
-
35.6%┣███████████████                           ┫ 389/1.1k [00:21<00:39, 18it/s]
-
35.7%┣███████████████                           ┫ 390/1.1k [00:21<00:39, 18it/s]
-
35.8%┣███████████████                           ┫ 391/1.1k [00:22<00:39, 18it/s]
-
36.0%┣███████████████▏                          ┫ 393/1.1k [00:22<00:39, 18it/s]
-
36.1%┣███████████████▏                          ┫ 394/1.1k [00:22<00:39, 18it/s]
-
36.2%┣███████████████▏                          ┫ 395/1.1k [00:22<00:38, 18it/s]
-
36.3%┣███████████████▎                          ┫ 396/1.1k [00:22<00:38, 18it/s]
-
36.4%┣███████████████▎                          ┫ 398/1.1k [00:22<00:38, 18it/s]
-
36.5%┣███████████████▍                          ┫ 399/1.1k [00:22<00:38, 18it/s]
-
36.6%┣███████████████▍                          ┫ 400/1.1k [00:22<00:38, 18it/s]
-
36.8%┣███████████████▌                          ┫ 402/1.1k [00:22<00:38, 18it/s]
-
36.9%┣███████████████▌                          ┫ 403/1.1k [00:22<00:38, 18it/s]
-
37.0%┣███████████████▌                          ┫ 404/1.1k [00:22<00:38, 18it/s]
-
37.2%┣███████████████▋                          ┫ 406/1.1k [00:22<00:38, 18it/s]
-
37.3%┣███████████████▋                          ┫ 407/1.1k [00:22<00:38, 18it/s]
-
37.4%┣███████████████▊                          ┫ 408/1.1k [00:22<00:38, 18it/s]
-
37.5%┣███████████████▊                          ┫ 410/1.1k [00:23<00:38, 18it/s]
-
37.6%┣███████████████▉                          ┫ 411/1.1k [00:23<00:38, 18it/s]
-
37.7%┣███████████████▉                          ┫ 412/1.1k [00:23<00:38, 18it/s]
-
37.9%┣████████████████                          ┫ 414/1.1k [00:23<00:37, 18it/s]
-
38.0%┣████████████████                          ┫ 415/1.1k [00:23<00:37, 18it/s]
-
38.1%┣████████████████                          ┫ 416/1.1k [00:23<00:37, 18it/s]
-
38.2%┣████████████████                          ┫ 417/1.1k [00:23<00:37, 18it/s]
-
38.4%┣████████████████▏                         ┫ 419/1.1k [00:23<00:37, 18it/s]
-
38.5%┣████████████████▏                         ┫ 420/1.1k [00:23<00:37, 18it/s]
-
38.6%┣████████████████▏                         ┫ 421/1.1k [00:23<00:37, 18it/s]
-
38.7%┣████████████████▎                         ┫ 423/1.1k [00:23<00:37, 18it/s]
-
38.8%┣████████████████▎                         ┫ 424/1.1k [00:23<00:37, 18it/s]
-
38.9%┣████████████████▍                         ┫ 425/1.1k [00:23<00:37, 18it/s]
-
39.1%┣████████████████▍                         ┫ 427/1.1k [00:23<00:37, 18it/s]
-
39.2%┣████████████████▌                         ┫ 428/1.1k [00:24<00:37, 18it/s]
-
39.3%┣████████████████▌                         ┫ 429/1.1k [00:24<00:37, 18it/s]
-
39.5%┣████████████████▋                         ┫ 431/1.1k [00:24<00:36, 18it/s]
-
39.6%┣████████████████▋                         ┫ 432/1.1k [00:24<00:36, 18it/s]
-
39.7%┣████████████████▋                         ┫ 433/1.1k [00:24<00:36, 18it/s]
-
39.8%┣████████████████▊                         ┫ 435/1.1k [00:24<00:36, 18it/s]
-
39.9%┣████████████████▊                         ┫ 436/1.1k [00:24<00:36, 18it/s]
-
40.0%┣████████████████▉                         ┫ 437/1.1k [00:24<00:36, 18it/s]
-
40.1%┣████████████████▉                         ┫ 438/1.1k [00:24<00:36, 18it/s]
-
40.2%┣████████████████▉                         ┫ 439/1.1k [00:24<00:36, 18it/s]
-
40.4%┣█████████████████                         ┫ 441/1.1k [00:24<00:36, 18it/s]
-
40.5%┣█████████████████                         ┫ 442/1.1k [00:24<00:36, 18it/s]
-
40.7%┣█████████████████                         ┫ 444/1.1k [00:24<00:36, 18it/s]
-
40.8%┣█████████████████▏                        ┫ 445/1.1k [00:24<00:36, 18it/s]
-
40.8%┣█████████████████▏                        ┫ 446/1.1k [00:25<00:36, 18it/s]
-
41.0%┣█████████████████▎                        ┫ 448/1.1k [00:25<00:36, 18it/s]
-
41.1%┣█████████████████▎                        ┫ 449/1.1k [00:25<00:35, 18it/s]
-
41.2%┣█████████████████▎                        ┫ 450/1.1k [00:25<00:35, 18it/s]
-
41.4%┣█████████████████▍                        ┫ 452/1.1k [00:25<00:35, 18it/s]
-
41.5%┣█████████████████▍                        ┫ 453/1.1k [00:25<00:35, 18it/s]
-
41.6%┣█████████████████▌                        ┫ 454/1.1k [00:25<00:35, 18it/s]
-
41.7%┣█████████████████▌                        ┫ 455/1.1k [00:25<00:35, 18it/s]
-
41.8%┣█████████████████▋                        ┫ 457/1.1k [00:25<00:35, 18it/s]
-
41.9%┣█████████████████▋                        ┫ 458/1.1k [00:25<00:35, 18it/s]
-
42.0%┣█████████████████▋                        ┫ 459/1.1k [00:25<00:35, 18it/s]
-
42.2%┣█████████████████▊                        ┫ 461/1.1k [00:25<00:35, 18it/s]
-
42.3%┣█████████████████▊                        ┫ 462/1.1k [00:25<00:35, 18it/s]
-
42.4%┣█████████████████▉                        ┫ 463/1.1k [00:25<00:35, 18it/s]
-
42.6%┣█████████████████▉                        ┫ 465/1.1k [00:26<00:35, 18it/s]
-
42.7%┣██████████████████                        ┫ 466/1.1k [00:26<00:35, 18it/s]
-
42.8%┣██████████████████                        ┫ 467/1.1k [00:26<00:34, 18it/s]
-
42.9%┣██████████████████                        ┫ 469/1.1k [00:26<00:34, 18it/s]
-
43.0%┣██████████████████                        ┫ 470/1.1k [00:26<00:34, 18it/s]
-
43.1%┣██████████████████▏                       ┫ 471/1.1k [00:26<00:34, 18it/s]
-
43.2%┣██████████████████▏                       ┫ 472/1.1k [00:26<00:34, 18it/s]
-
43.4%┣██████████████████▎                       ┫ 474/1.1k [00:26<00:34, 18it/s]
-
43.5%┣██████████████████▎                       ┫ 475/1.1k [00:26<00:34, 18it/s]
-
43.6%┣██████████████████▎                       ┫ 476/1.1k [00:26<00:34, 18it/s]
-
43.8%┣██████████████████▍                       ┫ 478/1.1k [00:26<00:34, 18it/s]
-
43.9%┣██████████████████▍                       ┫ 479/1.1k [00:26<00:34, 18it/s]
-
44.0%┣██████████████████▌                       ┫ 480/1.1k [00:26<00:34, 18it/s]
-
44.1%┣██████████████████▌                       ┫ 482/1.1k [00:27<00:34, 18it/s]
-
44.2%┣██████████████████▋                       ┫ 483/1.1k [00:27<00:34, 18it/s]
-
44.3%┣██████████████████▋                       ┫ 484/1.1k [00:27<00:34, 18it/s]
-
44.4%┣██████████████████▋                       ┫ 485/1.1k [00:27<00:33, 18it/s]
-
44.6%┣██████████████████▊                       ┫ 487/1.1k [00:27<00:33, 18it/s]
-
44.7%┣██████████████████▊                       ┫ 488/1.1k [00:27<00:33, 18it/s]
-
44.8%┣██████████████████▉                       ┫ 489/1.1k [00:27<00:33, 18it/s]
-
45.0%┣██████████████████▉                       ┫ 491/1.1k [00:27<00:33, 18it/s]
-
45.1%┣███████████████████                       ┫ 492/1.1k [00:27<00:33, 18it/s]
-
45.1%┣███████████████████                       ┫ 493/1.1k [00:27<00:33, 18it/s]
-
45.3%┣███████████████████                       ┫ 495/1.1k [00:27<00:33, 18it/s]
-
45.4%┣███████████████████                       ┫ 496/1.1k [00:27<00:33, 18it/s]
-
45.5%┣███████████████████▏                      ┫ 497/1.1k [00:27<00:33, 18it/s]
-
45.6%┣███████████████████▏                      ┫ 498/1.1k [00:27<00:33, 18it/s]
-
45.8%┣███████████████████▎                      ┫ 500/1.1k [00:27<00:33, 18it/s]
-
45.9%┣███████████████████▎                      ┫ 501/1.1k [00:28<00:33, 18it/s]
-
46.0%┣███████████████████▎                      ┫ 502/1.1k [00:28<00:32, 18it/s]
-
46.2%┣███████████████████▍                      ┫ 504/1.1k [00:28<00:32, 18it/s]
-
46.2%┣███████████████████▍                      ┫ 505/1.1k [00:28<00:32, 18it/s]
-
46.3%┣███████████████████▌                      ┫ 506/1.1k [00:28<00:32, 18it/s]
-
46.5%┣███████████████████▌                      ┫ 508/1.1k [00:28<00:32, 18it/s]
-
46.7%┣███████████████████▋                      ┫ 510/1.1k [00:28<00:32, 18it/s]
-
46.8%┣███████████████████▋                      ┫ 511/1.1k [00:28<00:32, 18it/s]
-
47.0%┣███████████████████▊                      ┫ 513/1.1k [00:28<00:32, 18it/s]
-
47.1%┣███████████████████▊                      ┫ 514/1.1k [00:28<00:32, 18it/s]
-
47.2%┣███████████████████▉                      ┫ 515/1.1k [00:28<00:32, 18it/s]
-
47.3%┣███████████████████▉                      ┫ 517/1.1k [00:28<00:32, 18it/s]
-
47.4%┣████████████████████                      ┫ 518/1.1k [00:28<00:32, 18it/s]
-
47.5%┣████████████████████                      ┫ 519/1.1k [00:28<00:32, 18it/s]
-
47.6%┣████████████████████                      ┫ 520/1.1k [00:29<00:31, 18it/s]
-
47.8%┣████████████████████                      ┫ 522/1.1k [00:29<00:31, 18it/s]
-
47.9%┣████████████████████▏                     ┫ 523/1.1k [00:29<00:31, 18it/s]
-
48.0%┣████████████████████▏                     ┫ 524/1.1k [00:29<00:31, 18it/s]
-
48.2%┣████████████████████▎                     ┫ 526/1.1k [00:29<00:31, 18it/s]
-
48.3%┣████████████████████▎                     ┫ 527/1.1k [00:29<00:31, 18it/s]
-
48.4%┣████████████████████▎                     ┫ 528/1.1k [00:29<00:31, 18it/s]
-
48.5%┣████████████████████▍                     ┫ 530/1.1k [00:29<00:31, 18it/s]
-
48.7%┣████████████████████▌                     ┫ 532/1.1k [00:29<00:31, 18it/s]
-
48.8%┣████████████████████▌                     ┫ 533/1.1k [00:29<00:31, 18it/s]
-
49.0%┣████████████████████▋                     ┫ 535/1.1k [00:29<00:31, 18it/s]
-
49.1%┣████████████████████▋                     ┫ 536/1.1k [00:29<00:31, 18it/s]
-
49.2%┣████████████████████▋                     ┫ 537/1.1k [00:29<00:31, 18it/s]
-
49.4%┣████████████████████▊                     ┫ 539/1.1k [00:30<00:30, 18it/s]
-
49.5%┣████████████████████▉                     ┫ 541/1.1k [00:30<00:30, 18it/s]
-
49.6%┣████████████████████▉                     ┫ 542/1.1k [00:30<00:30, 18it/s]
-
49.8%┣█████████████████████                     ┫ 544/1.1k [00:30<00:30, 18it/s]
-
49.9%┣█████████████████████                     ┫ 545/1.1k [00:30<00:30, 18it/s]
-
50.0%┣█████████████████████                     ┫ 546/1.1k [00:30<00:30, 18it/s]
-
50.2%┣█████████████████████                     ┫ 548/1.1k [00:30<00:30, 18it/s]
-
50.3%┣█████████████████████▏                    ┫ 549/1.1k [00:30<00:30, 18it/s]
-
50.4%┣█████████████████████▏                    ┫ 550/1.1k [00:30<00:30, 18it/s]
-
50.5%┣█████████████████████▏                    ┫ 551/1.1k [00:30<00:30, 18it/s]
-
50.6%┣█████████████████████▎                    ┫ 553/1.1k [00:30<00:30, 18it/s]
-
50.7%┣█████████████████████▎                    ┫ 554/1.1k [00:30<00:30, 18it/s]
-
50.8%┣█████████████████████▍                    ┫ 555/1.1k [00:30<00:30, 18it/s]
-
51.0%┣█████████████████████▍                    ┫ 557/1.1k [00:31<00:29, 18it/s]
-
51.1%┣█████████████████████▌                    ┫ 558/1.1k [00:31<00:29, 18it/s]
-
51.2%┣█████████████████████▌                    ┫ 559/1.1k [00:31<00:29, 18it/s]
-
51.3%┣█████████████████████▌                    ┫ 560/1.1k [00:31<00:29, 18it/s]
-
51.5%┣█████████████████████▋                    ┫ 562/1.1k [00:31<00:29, 18it/s]
-
51.6%┣█████████████████████▋                    ┫ 563/1.1k [00:31<00:29, 18it/s]
-
51.6%┣█████████████████████▊                    ┫ 564/1.1k [00:31<00:29, 18it/s]
-
51.8%┣█████████████████████▊                    ┫ 566/1.1k [00:31<00:29, 18it/s]
-
51.9%┣█████████████████████▉                    ┫ 567/1.1k [00:31<00:29, 18it/s]
-
52.0%┣█████████████████████▉                    ┫ 568/1.1k [00:31<00:29, 18it/s]
-
52.2%┣██████████████████████                    ┫ 570/1.1k [00:31<00:29, 18it/s]
-
52.4%┣██████████████████████                    ┫ 572/1.1k [00:31<00:29, 18it/s]
-
52.5%┣██████████████████████                    ┫ 573/1.1k [00:31<00:29, 18it/s]
-
52.7%┣██████████████████████▏                   ┫ 575/1.1k [00:32<00:28, 18it/s]
-
52.7%┣██████████████████████▏                   ┫ 576/1.1k [00:32<00:28, 18it/s]
-
52.8%┣██████████████████████▏                   ┫ 577/1.1k [00:32<00:28, 18it/s]
-
53.0%┣██████████████████████▎                   ┫ 579/1.1k [00:32<00:28, 18it/s]
-
53.2%┣██████████████████████▍                   ┫ 581/1.1k [00:32<00:28, 18it/s]
-
53.3%┣██████████████████████▍                   ┫ 582/1.1k [00:32<00:28, 18it/s]
-
53.5%┣██████████████████████▌                   ┫ 584/1.1k [00:32<00:28, 18it/s]
-
53.6%┣██████████████████████▌                   ┫ 585/1.1k [00:32<00:28, 18it/s]
-
53.7%┣██████████████████████▌                   ┫ 586/1.1k [00:32<00:28, 18it/s]
-
53.8%┣██████████████████████▋                   ┫ 588/1.1k [00:32<00:28, 18it/s]
-
53.9%┣██████████████████████▋                   ┫ 589/1.1k [00:32<00:28, 18it/s]
-
54.0%┣██████████████████████▊                   ┫ 590/1.1k [00:32<00:28, 18it/s]
-
54.1%┣██████████████████████▊                   ┫ 591/1.1k [00:32<00:27, 18it/s]
-
54.3%┣██████████████████████▉                   ┫ 593/1.1k [00:32<00:27, 18it/s]
-
54.4%┣██████████████████████▉                   ┫ 594/1.1k [00:33<00:27, 18it/s]
-
54.5%┣██████████████████████▉                   ┫ 595/1.1k [00:33<00:27, 18it/s]
-
54.7%┣███████████████████████                   ┫ 597/1.1k [00:33<00:27, 18it/s]
-
54.8%┣███████████████████████                   ┫ 598/1.1k [00:33<00:27, 18it/s]
-
54.9%┣███████████████████████                   ┫ 599/1.1k [00:33<00:27, 18it/s]
-
55.0%┣███████████████████████▏                  ┫ 601/1.1k [00:33<00:27, 18it/s]
-
55.2%┣███████████████████████▏                  ┫ 603/1.1k [00:33<00:27, 18it/s]
-
55.3%┣███████████████████████▎                  ┫ 604/1.1k [00:33<00:27, 18it/s]
-
55.5%┣███████████████████████▎                  ┫ 606/1.1k [00:33<00:27, 18it/s]
-
55.6%┣███████████████████████▍                  ┫ 607/1.1k [00:33<00:27, 18it/s]
-
55.7%┣███████████████████████▍                  ┫ 608/1.1k [00:33<00:27, 18it/s]
-
55.9%┣███████████████████████▌                  ┫ 610/1.1k [00:33<00:26, 18it/s]
-
56.0%┣███████████████████████▌                  ┫ 612/1.1k [00:33<00:26, 18it/s]
-
56.1%┣███████████████████████▋                  ┫ 613/1.1k [00:34<00:26, 18it/s]
-
56.3%┣███████████████████████▋                  ┫ 615/1.1k [00:34<00:26, 18it/s]
-
56.4%┣███████████████████████▊                  ┫ 616/1.1k [00:34<00:26, 18it/s]
-
56.5%┣███████████████████████▊                  ┫ 617/1.1k [00:34<00:26, 18it/s]
-
56.7%┣███████████████████████▉                  ┫ 619/1.1k [00:34<00:26, 18it/s]
-
56.9%┣███████████████████████▉                  ┫ 621/1.1k [00:34<00:26, 18it/s]
-
57.0%┣████████████████████████                  ┫ 622/1.1k [00:34<00:26, 18it/s]
-
57.1%┣████████████████████████                  ┫ 624/1.1k [00:34<00:26, 18it/s]
-
57.2%┣████████████████████████                  ┫ 625/1.1k [00:34<00:26, 18it/s]
-
57.3%┣████████████████████████                  ┫ 626/1.1k [00:34<00:26, 18it/s]
-
57.5%┣████████████████████████▏                 ┫ 628/1.1k [00:34<00:25, 18it/s]
-
57.7%┣████████████████████████▎                 ┫ 630/1.1k [00:34<00:25, 18it/s]
-
57.8%┣████████████████████████▎                 ┫ 631/1.1k [00:35<00:25, 18it/s]
-
58.0%┣████████████████████████▍                 ┫ 633/1.1k [00:35<00:25, 18it/s]
-
58.1%┣████████████████████████▍                 ┫ 634/1.1k [00:35<00:25, 18it/s]
-
58.2%┣████████████████████████▍                 ┫ 635/1.1k [00:35<00:25, 18it/s]
-
58.3%┣████████████████████████▌                 ┫ 637/1.1k [00:35<00:25, 18it/s]
-
58.5%┣████████████████████████▋                 ┫ 639/1.1k [00:35<00:25, 18it/s]
-
58.6%┣████████████████████████▋                 ┫ 640/1.1k [00:35<00:25, 18it/s]
-
58.8%┣████████████████████████▊                 ┫ 642/1.1k [00:35<00:25, 18it/s]
-
58.9%┣████████████████████████▊                 ┫ 643/1.1k [00:35<00:25, 18it/s]
-
59.0%┣████████████████████████▊                 ┫ 644/1.1k [00:35<00:25, 18it/s]
-
59.2%┣████████████████████████▉                 ┫ 646/1.1k [00:35<00:24, 18it/s]
-
59.3%┣█████████████████████████                 ┫ 648/1.1k [00:35<00:24, 18it/s]
-
59.4%┣█████████████████████████                 ┫ 649/1.1k [00:35<00:24, 18it/s]
-
59.6%┣█████████████████████████                 ┫ 651/1.1k [00:36<00:24, 18it/s]
-
59.7%┣█████████████████████████                 ┫ 652/1.1k [00:36<00:24, 18it/s]
-
59.8%┣█████████████████████████▏                ┫ 653/1.1k [00:36<00:24, 18it/s]
-
60.0%┣█████████████████████████▏                ┫ 655/1.1k [00:36<00:24, 18it/s]
-
60.2%┣█████████████████████████▎                ┫ 657/1.1k [00:36<00:24, 18it/s]
-
60.3%┣█████████████████████████▎                ┫ 658/1.1k [00:36<00:24, 18it/s]
-
60.4%┣█████████████████████████▍                ┫ 660/1.1k [00:36<00:24, 18it/s]
-
60.5%┣█████████████████████████▍                ┫ 661/1.1k [00:36<00:24, 18it/s]
-
60.6%┣█████████████████████████▌                ┫ 662/1.1k [00:36<00:24, 18it/s]
-
60.8%┣█████████████████████████▌                ┫ 664/1.1k [00:36<00:23, 18it/s]
-
61.0%┣█████████████████████████▋                ┫ 666/1.1k [00:36<00:23, 18it/s]
-
61.1%┣█████████████████████████▋                ┫ 667/1.1k [00:36<00:23, 18it/s]
-
61.3%┣█████████████████████████▊                ┫ 669/1.1k [00:37<00:23, 18it/s]
-
61.4%┣█████████████████████████▊                ┫ 670/1.1k [00:37<00:23, 18it/s]
-
61.4%┣█████████████████████████▉                ┫ 671/1.1k [00:37<00:23, 18it/s]
-
61.6%┣█████████████████████████▉                ┫ 673/1.1k [00:37<00:23, 18it/s]
-
61.8%┣██████████████████████████                ┫ 675/1.1k [00:37<00:23, 18it/s]
-
61.9%┣██████████████████████████                ┫ 676/1.1k [00:37<00:23, 18it/s]
-
62.1%┣██████████████████████████                ┫ 678/1.1k [00:37<00:23, 18it/s]
-
62.2%┣██████████████████████████▏               ┫ 679/1.1k [00:37<00:23, 18it/s]
-
62.3%┣██████████████████████████▏               ┫ 680/1.1k [00:37<00:23, 18it/s]
-
62.5%┣██████████████████████████▎               ┫ 682/1.1k [00:37<00:22, 18it/s]
-
62.6%┣██████████████████████████▎               ┫ 684/1.1k [00:37<00:22, 18it/s]
-
62.7%┣██████████████████████████▍               ┫ 685/1.1k [00:37<00:22, 18it/s]
-
62.9%┣██████████████████████████▍               ┫ 687/1.1k [00:38<00:22, 18it/s]
-
63.0%┣██████████████████████████▌               ┫ 688/1.1k [00:38<00:22, 18it/s]
-
63.1%┣██████████████████████████▌               ┫ 689/1.1k [00:38<00:22, 18it/s]
-
63.2%┣██████████████████████████▌               ┫ 690/1.1k [00:38<00:22, 18it/s]
-
63.4%┣██████████████████████████▋               ┫ 692/1.1k [00:38<00:22, 18it/s]
-
63.5%┣██████████████████████████▋               ┫ 693/1.1k [00:38<00:22, 18it/s]
-
63.6%┣██████████████████████████▊               ┫ 694/1.1k [00:38<00:22, 18it/s]
-
63.7%┣██████████████████████████▊               ┫ 696/1.1k [00:38<00:22, 18it/s]
-
63.8%┣██████████████████████████▉               ┫ 697/1.1k [00:38<00:22, 18it/s]
-
63.9%┣██████████████████████████▉               ┫ 698/1.1k [00:38<00:22, 18it/s]
-
64.0%┣██████████████████████████▉               ┫ 699/1.1k [00:38<00:22, 18it/s]
-
64.2%┣███████████████████████████               ┫ 701/1.1k [00:38<00:21, 18it/s]
-
64.3%┣███████████████████████████               ┫ 702/1.1k [00:38<00:21, 18it/s]
-
64.4%┣███████████████████████████               ┫ 703/1.1k [00:38<00:21, 18it/s]
-
64.6%┣███████████████████████████▏              ┫ 705/1.1k [00:39<00:21, 18it/s]
-
64.7%┣███████████████████████████▏              ┫ 706/1.1k [00:39<00:21, 18it/s]
-
64.7%┣███████████████████████████▏              ┫ 707/1.1k [00:39<00:21, 18it/s]
-
64.8%┣███████████████████████████▎              ┫ 708/1.1k [00:39<00:21, 18it/s]
-
65.0%┣███████████████████████████▎              ┫ 710/1.1k [00:39<00:21, 18it/s]
-
65.1%┣███████████████████████████▍              ┫ 711/1.1k [00:39<00:21, 18it/s]
-
65.2%┣███████████████████████████▍              ┫ 712/1.1k [00:39<00:21, 18it/s]
-
65.4%┣███████████████████████████▌              ┫ 714/1.1k [00:39<00:21, 18it/s]
-
65.5%┣███████████████████████████▌              ┫ 715/1.1k [00:39<00:21, 18it/s]
-
65.6%┣███████████████████████████▌              ┫ 716/1.1k [00:39<00:21, 18it/s]
-
65.7%┣███████████████████████████▋              ┫ 717/1.1k [00:39<00:21, 18it/s]
-
65.8%┣███████████████████████████▋              ┫ 719/1.1k [00:39<00:20, 18it/s]
-
65.9%┣███████████████████████████▊              ┫ 720/1.1k [00:39<00:20, 18it/s]
-
66.0%┣███████████████████████████▊              ┫ 721/1.1k [00:39<00:20, 18it/s]
-
66.2%┣███████████████████████████▉              ┫ 723/1.1k [00:39<00:20, 18it/s]
-
66.3%┣███████████████████████████▉              ┫ 724/1.1k [00:40<00:20, 18it/s]
-
66.4%┣███████████████████████████▉              ┫ 725/1.1k [00:40<00:20, 18it/s]
-
66.5%┣████████████████████████████              ┫ 726/1.1k [00:40<00:20, 18it/s]
-
66.7%┣████████████████████████████              ┫ 728/1.1k [00:40<00:20, 18it/s]
-
66.8%┣████████████████████████████              ┫ 729/1.1k [00:40<00:20, 18it/s]
-
66.8%┣████████████████████████████              ┫ 730/1.1k [00:40<00:20, 18it/s]
-
67.0%┣████████████████████████████▏             ┫ 732/1.1k [00:40<00:20, 18it/s]
-
67.1%┣████████████████████████████▏             ┫ 733/1.1k [00:40<00:20, 18it/s]
-
67.2%┣████████████████████████████▎             ┫ 734/1.1k [00:40<00:20, 18it/s]
-
67.3%┣████████████████████████████▎             ┫ 735/1.1k [00:40<00:20, 18it/s]
-
67.5%┣████████████████████████████▍             ┫ 737/1.1k [00:40<00:19, 18it/s]
-
67.6%┣████████████████████████████▍             ┫ 738/1.1k [00:40<00:19, 18it/s]
-
67.7%┣████████████████████████████▍             ┫ 739/1.1k [00:40<00:19, 18it/s]
-
67.9%┣████████████████████████████▌             ┫ 741/1.1k [00:40<00:19, 18it/s]
-
68.0%┣████████████████████████████▋             ┫ 743/1.1k [00:41<00:19, 18it/s]
-
68.1%┣████████████████████████████▋             ┫ 744/1.1k [00:41<00:19, 18it/s]
-
68.3%┣████████████████████████████▊             ┫ 746/1.1k [00:41<00:19, 18it/s]
-
68.4%┣████████████████████████████▊             ┫ 747/1.1k [00:41<00:19, 18it/s]
-
68.5%┣████████████████████████████▊             ┫ 748/1.1k [00:41<00:19, 18it/s]
-
68.7%┣████████████████████████████▉             ┫ 750/1.1k [00:41<00:19, 18it/s]
-
68.9%┣█████████████████████████████             ┫ 752/1.1k [00:41<00:19, 18it/s]
-
69.0%┣█████████████████████████████             ┫ 753/1.1k [00:41<00:19, 18it/s]
-
69.1%┣█████████████████████████████             ┫ 755/1.1k [00:41<00:18, 18it/s]
-
69.2%┣█████████████████████████████             ┫ 756/1.1k [00:41<00:18, 18it/s]
-
69.3%┣█████████████████████████████▏            ┫ 757/1.1k [00:41<00:18, 18it/s]
-
69.4%┣█████████████████████████████▏            ┫ 758/1.1k [00:41<00:18, 18it/s]
-
69.6%┣█████████████████████████████▎            ┫ 760/1.1k [00:41<00:18, 18it/s]
-
69.7%┣█████████████████████████████▎            ┫ 761/1.1k [00:42<00:18, 18it/s]
-
69.8%┣█████████████████████████████▎            ┫ 762/1.1k [00:42<00:18, 18it/s]
-
70.0%┣█████████████████████████████▍            ┫ 764/1.1k [00:42<00:18, 18it/s]
-
70.1%┣█████████████████████████████▍            ┫ 765/1.1k [00:42<00:18, 18it/s]
-
70.1%┣█████████████████████████████▌            ┫ 766/1.1k [00:42<00:18, 18it/s]
-
70.2%┣█████████████████████████████▌            ┫ 767/1.1k [00:42<00:18, 18it/s]
-
70.4%┣█████████████████████████████▋            ┫ 769/1.1k [00:42<00:18, 18it/s]
-
70.5%┣█████████████████████████████▋            ┫ 770/1.1k [00:42<00:18, 18it/s]
-
70.6%┣█████████████████████████████▋            ┫ 771/1.1k [00:42<00:18, 18it/s]
-
70.8%┣█████████████████████████████▊            ┫ 773/1.1k [00:42<00:17, 18it/s]
-
70.9%┣█████████████████████████████▊            ┫ 774/1.1k [00:42<00:17, 18it/s]
-
71.0%┣█████████████████████████████▉            ┫ 775/1.1k [00:42<00:17, 18it/s]
-
71.1%┣█████████████████████████████▉            ┫ 776/1.1k [00:42<00:17, 18it/s]
-
71.2%┣██████████████████████████████            ┫ 778/1.1k [00:42<00:17, 18it/s]
-
71.3%┣██████████████████████████████            ┫ 779/1.1k [00:43<00:17, 18it/s]
-
71.4%┣██████████████████████████████            ┫ 780/1.1k [00:43<00:17, 18it/s]
-
71.6%┣██████████████████████████████            ┫ 782/1.1k [00:43<00:17, 18it/s]
-
71.8%┣██████████████████████████████▏           ┫ 784/1.1k [00:43<00:17, 18it/s]
-
71.9%┣██████████████████████████████▏           ┫ 785/1.1k [00:43<00:17, 18it/s]
-
72.1%┣██████████████████████████████▎           ┫ 787/1.1k [00:43<00:17, 18it/s]
-
72.2%┣██████████████████████████████▎           ┫ 788/1.1k [00:43<00:17, 18it/s]
-
72.3%┣██████████████████████████████▍           ┫ 789/1.1k [00:43<00:17, 18it/s]
-
72.3%┣██████████████████████████████▍           ┫ 790/1.1k [00:43<00:17, 18it/s]
-
72.5%┣██████████████████████████████▌           ┫ 792/1.1k [00:43<00:16, 18it/s]
-
72.6%┣██████████████████████████████▌           ┫ 793/1.1k [00:43<00:16, 18it/s]
-
72.7%┣██████████████████████████████▌           ┫ 794/1.1k [00:43<00:16, 18it/s]
-
72.9%┣██████████████████████████████▋           ┫ 796/1.1k [00:43<00:16, 18it/s]
-
73.0%┣██████████████████████████████▋           ┫ 797/1.1k [00:44<00:16, 18it/s]
-
73.1%┣██████████████████████████████▊           ┫ 798/1.1k [00:44<00:16, 18it/s]
-
73.2%┣██████████████████████████████▊           ┫ 799/1.1k [00:44<00:16, 18it/s]
-
73.4%┣██████████████████████████████▉           ┫ 801/1.1k [00:44<00:16, 18it/s]
-
73.4%┣██████████████████████████████▉           ┫ 802/1.1k [00:44<00:16, 18it/s]
-
73.5%┣██████████████████████████████▉           ┫ 803/1.1k [00:44<00:16, 18it/s]
-
73.7%┣███████████████████████████████           ┫ 805/1.1k [00:44<00:16, 18it/s]
-
73.9%┣███████████████████████████████           ┫ 807/1.1k [00:44<00:16, 18it/s]
-
74.0%┣███████████████████████████████           ┫ 808/1.1k [00:44<00:16, 18it/s]
-
74.2%┣███████████████████████████████▏          ┫ 810/1.1k [00:44<00:15, 18it/s]
-
74.3%┣███████████████████████████████▏          ┫ 811/1.1k [00:44<00:15, 18it/s]
-
74.4%┣███████████████████████████████▎          ┫ 812/1.1k [00:44<00:15, 18it/s]
-
74.5%┣███████████████████████████████▎          ┫ 813/1.1k [00:44<00:15, 18it/s]
-
74.6%┣███████████████████████████████▍          ┫ 815/1.1k [00:44<00:15, 18it/s]
-
74.7%┣███████████████████████████████▍          ┫ 816/1.1k [00:45<00:15, 18it/s]
-
74.8%┣███████████████████████████████▍          ┫ 817/1.1k [00:45<00:15, 18it/s]
-
75.0%┣███████████████████████████████▌          ┫ 819/1.1k [00:45<00:15, 18it/s]
-
75.1%┣███████████████████████████████▌          ┫ 820/1.1k [00:45<00:15, 18it/s]
-
75.2%┣███████████████████████████████▋          ┫ 821/1.1k [00:45<00:15, 18it/s]
-
75.3%┣███████████████████████████████▋          ┫ 822/1.1k [00:45<00:15, 18it/s]
-
75.5%┣███████████████████████████████▊          ┫ 824/1.1k [00:45<00:15, 18it/s]
-
75.5%┣███████████████████████████████▊          ┫ 825/1.1k [00:45<00:15, 18it/s]
-
75.6%┣███████████████████████████████▊          ┫ 826/1.1k [00:45<00:15, 18it/s]
-
75.7%┣███████████████████████████████▉          ┫ 827/1.1k [00:45<00:14, 18it/s]
-
75.9%┣███████████████████████████████▉          ┫ 829/1.1k [00:45<00:14, 18it/s]
-
76.0%┣████████████████████████████████          ┫ 830/1.1k [00:45<00:14, 18it/s]
-
76.1%┣████████████████████████████████          ┫ 831/1.1k [00:45<00:14, 18it/s]
-
76.3%┣████████████████████████████████          ┫ 833/1.1k [00:45<00:14, 18it/s]
-
76.4%┣████████████████████████████████          ┫ 834/1.1k [00:45<00:14, 18it/s]
-
76.5%┣████████████████████████████████▏         ┫ 835/1.1k [00:46<00:14, 18it/s]
-
76.6%┣████████████████████████████████▏         ┫ 836/1.1k [00:46<00:14, 18it/s]
-
76.7%┣████████████████████████████████▎         ┫ 838/1.1k [00:46<00:14, 18it/s]
-
76.8%┣████████████████████████████████▎         ┫ 839/1.1k [00:46<00:14, 18it/s]
-
76.9%┣████████████████████████████████▎         ┫ 840/1.1k [00:46<00:14, 18it/s]
-
77.1%┣████████████████████████████████▍         ┫ 842/1.1k [00:46<00:14, 18it/s]
-
77.3%┣████████████████████████████████▌         ┫ 844/1.1k [00:46<00:14, 18it/s]
-
77.4%┣████████████████████████████████▌         ┫ 845/1.1k [00:46<00:13, 18it/s]
-
77.6%┣████████████████████████████████▋         ┫ 847/1.1k [00:46<00:13, 18it/s]
-
77.7%┣████████████████████████████████▋         ┫ 848/1.1k [00:46<00:13, 18it/s]
-
77.7%┣████████████████████████████████▋         ┫ 849/1.1k [00:46<00:13, 18it/s]
-
77.8%┣████████████████████████████████▊         ┫ 850/1.1k [00:46<00:13, 18it/s]
-
78.0%┣████████████████████████████████▊         ┫ 852/1.1k [00:46<00:13, 18it/s]
-
78.1%┣████████████████████████████████▉         ┫ 853/1.1k [00:47<00:13, 18it/s]
-
78.2%┣████████████████████████████████▉         ┫ 854/1.1k [00:47<00:13, 18it/s]
-
78.4%┣█████████████████████████████████         ┫ 856/1.1k [00:47<00:13, 18it/s]
-
78.6%┣█████████████████████████████████         ┫ 858/1.1k [00:47<00:13, 18it/s]
-
78.7%┣█████████████████████████████████         ┫ 859/1.1k [00:47<00:13, 18it/s]
-
78.8%┣█████████████████████████████████▏        ┫ 861/1.1k [00:47<00:13, 18it/s]
-
78.9%┣█████████████████████████████████▏        ┫ 862/1.1k [00:47<00:13, 18it/s]
-
79.0%┣█████████████████████████████████▏        ┫ 863/1.1k [00:47<00:13, 18it/s]
-
79.1%┣█████████████████████████████████▎        ┫ 864/1.1k [00:47<00:12, 18it/s]
-
79.3%┣█████████████████████████████████▎        ┫ 866/1.1k [00:47<00:12, 18it/s]
-
79.4%┣█████████████████████████████████▍        ┫ 867/1.1k [00:47<00:12, 18it/s]
-
79.5%┣█████████████████████████████████▍        ┫ 868/1.1k [00:47<00:12, 18it/s]
-
79.7%┣█████████████████████████████████▌        ┫ 870/1.1k [00:47<00:12, 18it/s]
-
79.8%┣█████████████████████████████████▌        ┫ 871/1.1k [00:47<00:12, 18it/s]
-
79.9%┣█████████████████████████████████▌        ┫ 872/1.1k [00:48<00:12, 18it/s]
-
79.9%┣█████████████████████████████████▋        ┫ 873/1.1k [00:48<00:12, 18it/s]
-
80.1%┣█████████████████████████████████▋        ┫ 875/1.1k [00:48<00:12, 18it/s]
-
80.2%┣█████████████████████████████████▊        ┫ 876/1.1k [00:48<00:12, 18it/s]
-
80.3%┣█████████████████████████████████▊        ┫ 877/1.1k [00:48<00:12, 18it/s]
-
80.4%┣█████████████████████████████████▊        ┫ 878/1.1k [00:48<00:12, 18it/s]
-
80.6%┣█████████████████████████████████▉        ┫ 880/1.1k [00:48<00:12, 18it/s]
-
80.7%┣█████████████████████████████████▉        ┫ 881/1.1k [00:48<00:12, 18it/s]
-
80.8%┣██████████████████████████████████        ┫ 882/1.1k [00:48<00:11, 18it/s]
-
81.0%┣██████████████████████████████████        ┫ 884/1.1k [00:48<00:11, 18it/s]
-
81.0%┣██████████████████████████████████        ┫ 885/1.1k [00:48<00:11, 18it/s]
-
81.1%┣██████████████████████████████████        ┫ 886/1.1k [00:48<00:11, 18it/s]
-
81.2%┣██████████████████████████████████▏       ┫ 887/1.1k [00:48<00:11, 18it/s]
-
81.4%┣██████████████████████████████████▏       ┫ 889/1.1k [00:48<00:11, 18it/s]
-
81.5%┣██████████████████████████████████▎       ┫ 890/1.1k [00:49<00:11, 18it/s]
-
81.6%┣██████████████████████████████████▎       ┫ 891/1.1k [00:49<00:11, 18it/s]
-
81.7%┣██████████████████████████████████▎       ┫ 892/1.1k [00:49<00:11, 18it/s]
-
81.9%┣██████████████████████████████████▍       ┫ 894/1.1k [00:49<00:11, 18it/s]
-
82.0%┣██████████████████████████████████▍       ┫ 895/1.1k [00:49<00:11, 18it/s]
-
82.1%┣██████████████████████████████████▌       ┫ 896/1.1k [00:49<00:11, 18it/s]
-
82.2%┣██████████████████████████████████▌       ┫ 898/1.1k [00:49<00:11, 18it/s]
-
82.4%┣██████████████████████████████████▋       ┫ 900/1.1k [00:49<00:10, 18it/s]
-
82.5%┣██████████████████████████████████▋       ┫ 901/1.1k [00:49<00:10, 18it/s]
-
82.7%┣██████████████████████████████████▊       ┫ 903/1.1k [00:49<00:10, 18it/s]
-
82.8%┣██████████████████████████████████▊       ┫ 904/1.1k [00:49<00:10, 18it/s]
-
82.9%┣██████████████████████████████████▉       ┫ 905/1.1k [00:49<00:10, 18it/s]
-
83.0%┣██████████████████████████████████▉       ┫ 906/1.1k [00:49<00:10, 18it/s]
-
83.2%┣███████████████████████████████████       ┫ 908/1.1k [00:50<00:10, 18it/s]
-
83.2%┣███████████████████████████████████       ┫ 909/1.1k [00:50<00:10, 18it/s]
-
83.3%┣███████████████████████████████████       ┫ 910/1.1k [00:50<00:10, 18it/s]
-
83.5%┣███████████████████████████████████       ┫ 912/1.1k [00:50<00:10, 18it/s]
-
83.6%┣███████████████████████████████████▏      ┫ 913/1.1k [00:50<00:10, 18it/s]
-
83.7%┣███████████████████████████████████▏      ┫ 914/1.1k [00:50<00:10, 18it/s]
-
83.8%┣███████████████████████████████████▏      ┫ 915/1.1k [00:50<00:10, 18it/s]
-
84.0%┣███████████████████████████████████▎      ┫ 917/1.1k [00:50<00:10, 18it/s]
-
84.1%┣███████████████████████████████████▎      ┫ 918/1.1k [00:50<00:09, 18it/s]
-
84.2%┣███████████████████████████████████▍      ┫ 919/1.1k [00:50<00:09, 18it/s]
-
84.2%┣███████████████████████████████████▍      ┫ 920/1.1k [00:50<00:09, 18it/s]
-
84.4%┣███████████████████████████████████▌      ┫ 922/1.1k [00:50<00:09, 18it/s]
-
84.5%┣███████████████████████████████████▌      ┫ 923/1.1k [00:50<00:09, 18it/s]
-
84.6%┣███████████████████████████████████▌      ┫ 924/1.1k [00:50<00:09, 18it/s]
-
84.8%┣███████████████████████████████████▋      ┫ 926/1.1k [00:50<00:09, 18it/s]
-
85.0%┣███████████████████████████████████▊      ┫ 928/1.1k [00:51<00:09, 18it/s]
-
85.1%┣███████████████████████████████████▊      ┫ 929/1.1k [00:51<00:09, 18it/s]
-
85.3%┣███████████████████████████████████▉      ┫ 931/1.1k [00:51<00:09, 18it/s]
-
85.3%┣███████████████████████████████████▉      ┫ 932/1.1k [00:51<00:09, 18it/s]
-
85.4%┣███████████████████████████████████▉      ┫ 933/1.1k [00:51<00:09, 18it/s]
-
85.5%┣████████████████████████████████████      ┫ 934/1.1k [00:51<00:09, 18it/s]
-
85.7%┣████████████████████████████████████      ┫ 936/1.1k [00:51<00:09, 18it/s]
-
85.8%┣████████████████████████████████████      ┫ 937/1.1k [00:51<00:08, 18it/s]
-
85.9%┣████████████████████████████████████      ┫ 938/1.1k [00:51<00:08, 18it/s]
-
86.1%┣████████████████████████████████████▏     ┫ 940/1.1k [00:51<00:08, 18it/s]
-
86.3%┣████████████████████████████████████▎     ┫ 942/1.1k [00:51<00:08, 18it/s]
-
86.4%┣████████████████████████████████████▎     ┫ 943/1.1k [00:51<00:08, 18it/s]
-
86.5%┣████████████████████████████████████▍     ┫ 945/1.1k [00:52<00:08, 18it/s]
-
86.6%┣████████████████████████████████████▍     ┫ 946/1.1k [00:52<00:08, 18it/s]
-
86.7%┣████████████████████████████████████▍     ┫ 947/1.1k [00:52<00:08, 18it/s]
-
86.8%┣████████████████████████████████████▌     ┫ 948/1.1k [00:52<00:08, 18it/s]
-
87.0%┣████████████████████████████████████▌     ┫ 950/1.1k [00:52<00:08, 18it/s]
-
87.1%┣████████████████████████████████████▋     ┫ 951/1.1k [00:52<00:08, 18it/s]
-
87.2%┣████████████████████████████████████▋     ┫ 952/1.1k [00:52<00:08, 18it/s]
-
87.3%┣████████████████████████████████████▋     ┫ 953/1.1k [00:52<00:08, 18it/s]
-
87.5%┣████████████████████████████████████▊     ┫ 955/1.1k [00:52<00:07, 18it/s]
-
87.5%┣████████████████████████████████████▊     ┫ 956/1.1k [00:52<00:07, 18it/s]
-
87.6%┣████████████████████████████████████▉     ┫ 957/1.1k [00:52<00:07, 18it/s]
-
87.8%┣████████████████████████████████████▉     ┫ 959/1.1k [00:52<00:07, 18it/s]
-
87.9%┣█████████████████████████████████████     ┫ 960/1.1k [00:52<00:07, 18it/s]
-
88.0%┣█████████████████████████████████████     ┫ 961/1.1k [00:52<00:07, 18it/s]
-
88.1%┣█████████████████████████████████████     ┫ 962/1.1k [00:52<00:07, 18it/s]
-
88.3%┣█████████████████████████████████████     ┫ 964/1.1k [00:53<00:07, 18it/s]
-
88.4%┣█████████████████████████████████████▏    ┫ 965/1.1k [00:53<00:07, 18it/s]
-
88.5%┣█████████████████████████████████████▏    ┫ 966/1.1k [00:53<00:07, 18it/s]
-
88.6%┣█████████████████████████████████████▏    ┫ 967/1.1k [00:53<00:07, 18it/s]
-
88.7%┣█████████████████████████████████████▎    ┫ 969/1.1k [00:53<00:07, 18it/s]
-
88.8%┣█████████████████████████████████████▎    ┫ 970/1.1k [00:53<00:07, 18it/s]
-
88.9%┣█████████████████████████████████████▍    ┫ 971/1.1k [00:53<00:07, 18it/s]
-
89.1%┣█████████████████████████████████████▍    ┫ 973/1.1k [00:53<00:06, 18it/s]
-
89.2%┣█████████████████████████████████████▌    ┫ 974/1.1k [00:53<00:06, 18it/s]
-
89.3%┣█████████████████████████████████████▌    ┫ 975/1.1k [00:53<00:06, 18it/s]
-
89.4%┣█████████████████████████████████████▌    ┫ 976/1.1k [00:53<00:06, 18it/s]
-
89.6%┣█████████████████████████████████████▋    ┫ 978/1.1k [00:53<00:06, 18it/s]
-
89.7%┣█████████████████████████████████████▋    ┫ 979/1.1k [00:53<00:06, 18it/s]
-
89.7%┣█████████████████████████████████████▊    ┫ 980/1.1k [00:53<00:06, 18it/s]
-
89.8%┣█████████████████████████████████████▊    ┫ 981/1.1k [00:54<00:06, 18it/s]
-
90.0%┣█████████████████████████████████████▉    ┫ 983/1.1k [00:54<00:06, 18it/s]
-
90.1%┣█████████████████████████████████████▉    ┫ 984/1.1k [00:54<00:06, 18it/s]
-
90.2%┣█████████████████████████████████████▉    ┫ 985/1.1k [00:54<00:06, 18it/s]
-
90.4%┣██████████████████████████████████████    ┫ 987/1.1k [00:54<00:06, 18it/s]
-
90.6%┣██████████████████████████████████████    ┫ 989/1.1k [00:54<00:06, 18it/s]
-
90.7%┣██████████████████████████████████████    ┫ 990/1.1k [00:54<00:06, 18it/s]
-
90.8%┣██████████████████████████████████████▏   ┫ 992/1.1k [00:54<00:05, 18it/s]
-
90.9%┣██████████████████████████████████████▏   ┫ 993/1.1k [00:54<00:05, 18it/s]
-
91.0%┣██████████████████████████████████████▎   ┫ 994/1.1k [00:54<00:05, 18it/s]
-
91.1%┣██████████████████████████████████████▎   ┫ 995/1.1k [00:54<00:05, 18it/s]
-
91.3%┣██████████████████████████████████████▍   ┫ 997/1.1k [00:54<00:05, 18it/s]
-
91.4%┣██████████████████████████████████████▍   ┫ 998/1.1k [00:54<00:05, 18it/s]
-
91.5%┣██████████████████████████████████████▍   ┫ 999/1.1k [00:55<00:05, 18it/s]
-
91.6%┣█████████████████████████████████████▌   ┫ 1.0k/1.1k [00:55<00:05, 18it/s]
-
91.8%┣█████████████████████████████████████▋   ┫ 1.0k/1.1k [00:55<00:05, 18it/s]
-
91.8%┣█████████████████████████████████████▋   ┫ 1.0k/1.1k [00:55<00:05, 18it/s]
-
91.9%┣█████████████████████████████████████▊   ┫ 1.0k/1.1k [00:55<00:05, 18it/s]
-
92.1%┣█████████████████████████████████████▊   ┫ 1.0k/1.1k [00:55<00:05, 18it/s]
-
92.3%┣█████████████████████████████████████▉   ┫ 1.0k/1.1k [00:55<00:05, 18it/s]
-
92.4%┣█████████████████████████████████████▉   ┫ 1.0k/1.1k [00:55<00:05, 18it/s]
-
92.6%┣██████████████████████████████████████   ┫ 1.0k/1.1k [00:55<00:04, 18it/s]
-
92.7%┣██████████████████████████████████████   ┫ 1.0k/1.1k [00:55<00:04, 18it/s]
-
92.8%┣██████████████████████████████████████   ┫ 1.0k/1.1k [00:55<00:04, 18it/s]
-
92.9%┣██████████████████████████████████████   ┫ 1.0k/1.1k [00:55<00:04, 18it/s]
-
93.0%┣██████████████████████████████████████▏  ┫ 1.0k/1.1k [00:55<00:04, 18it/s]
-
93.1%┣██████████████████████████████████████▏  ┫ 1.0k/1.1k [00:55<00:04, 18it/s]
-
93.2%┣██████████████████████████████████████▏  ┫ 1.0k/1.1k [00:56<00:04, 18it/s]
-
93.4%┣██████████████████████████████████████▎  ┫ 1.0k/1.1k [00:56<00:04, 18it/s]
-
93.5%┣██████████████████████████████████████▍  ┫ 1.0k/1.1k [00:56<00:04, 18it/s]
-
93.6%┣██████████████████████████████████████▍  ┫ 1.0k/1.1k [00:56<00:04, 18it/s]
-
93.7%┣██████████████████████████████████████▍  ┫ 1.0k/1.1k [00:56<00:04, 18it/s]
-
93.9%┣██████████████████████████████████████▌  ┫ 1.0k/1.1k [00:56<00:04, 18it/s]
-
94.0%┣██████████████████████████████████████▌  ┫ 1.0k/1.1k [00:56<00:04, 18it/s]
-
94.0%┣██████████████████████████████████████▋  ┫ 1.0k/1.1k [00:56<00:04, 18it/s]
-
94.1%┣██████████████████████████████████████▋  ┫ 1.0k/1.1k [00:56<00:03, 18it/s]
-
94.3%┣██████████████████████████████████████▊  ┫ 1.0k/1.1k [00:56<00:03, 18it/s]
-
94.4%┣██████████████████████████████████████▊  ┫ 1.0k/1.1k [00:56<00:03, 18it/s]
-
94.5%┣██████████████████████████████████████▊  ┫ 1.0k/1.1k [00:56<00:03, 18it/s]
-
94.6%┣██████████████████████████████████████▉  ┫ 1.0k/1.1k [00:56<00:03, 18it/s]
-
94.8%┣██████████████████████████████████████▉  ┫ 1.0k/1.1k [00:56<00:03, 18it/s]
-
94.9%┣███████████████████████████████████████  ┫ 1.0k/1.1k [00:57<00:03, 18it/s]
-
95.0%┣███████████████████████████████████████  ┫ 1.0k/1.1k [00:57<00:03, 18it/s]
-
95.1%┣███████████████████████████████████████  ┫ 1.0k/1.1k [00:57<00:03, 18it/s]
-
95.2%┣███████████████████████████████████████  ┫ 1.0k/1.1k [00:57<00:03, 18it/s]
-
95.3%┣███████████████████████████████████████  ┫ 1.0k/1.1k [00:57<00:03, 18it/s]
-
95.4%┣███████████████████████████████████████▏ ┫ 1.0k/1.1k [00:57<00:03, 18it/s]
-
95.6%┣███████████████████████████████████████▏ ┫ 1.0k/1.1k [00:57<00:03, 18it/s]
-
95.7%┣███████████████████████████████████████▎ ┫ 1.0k/1.1k [00:57<00:03, 18it/s]
-
95.8%┣███████████████████████████████████████▎ ┫ 1.0k/1.1k [00:57<00:03, 18it/s]
-
95.9%┣███████████████████████████████████████▎ ┫ 1.0k/1.1k [00:57<00:02, 18it/s]
-
96.1%┣███████████████████████████████████████▍ ┫ 1.0k/1.1k [00:57<00:02, 18it/s]
-
96.2%┣███████████████████████████████████████▍ ┫ 1.1k/1.1k [00:57<00:02, 18it/s]
-
96.2%┣███████████████████████████████████████▌ ┫ 1.1k/1.1k [00:57<00:02, 18it/s]
-
96.4%┣███████████████████████████████████████▌ ┫ 1.1k/1.1k [00:57<00:02, 18it/s]
-
96.6%┣███████████████████████████████████████▋ ┫ 1.1k/1.1k [00:58<00:02, 18it/s]
-
96.7%┣███████████████████████████████████████▋ ┫ 1.1k/1.1k [00:58<00:02, 18it/s]
-
96.9%┣███████████████████████████████████████▊ ┫ 1.1k/1.1k [00:58<00:02, 18it/s]
-
97.0%┣███████████████████████████████████████▊ ┫ 1.1k/1.1k [00:58<00:02, 18it/s]
-
97.1%┣███████████████████████████████████████▉ ┫ 1.1k/1.1k [00:58<00:02, 18it/s]
-
97.2%┣███████████████████████████████████████▉ ┫ 1.1k/1.1k [00:58<00:02, 18it/s]
-
97.3%┣████████████████████████████████████████ ┫ 1.1k/1.1k [00:58<00:02, 18it/s]
-
97.4%┣████████████████████████████████████████ ┫ 1.1k/1.1k [00:58<00:02, 18it/s]
-
97.5%┣████████████████████████████████████████ ┫ 1.1k/1.1k [00:58<00:01, 18it/s]
-
97.6%┣████████████████████████████████████████ ┫ 1.1k/1.1k [00:58<00:01, 18it/s]
-
97.8%┣████████████████████████████████████████ ┫ 1.1k/1.1k [00:58<00:01, 18it/s]
-
97.9%┣████████████████████████████████████████▏┫ 1.1k/1.1k [00:58<00:01, 18it/s]
-
98.0%┣████████████████████████████████████████▏┫ 1.1k/1.1k [00:58<00:01, 18it/s]
-
98.2%┣████████████████████████████████████████▎┫ 1.1k/1.1k [00:59<00:01, 18it/s]
-
98.4%┣████████████████████████████████████████▎┫ 1.1k/1.1k [00:59<00:01, 18it/s]
-
98.4%┣████████████████████████████████████████▍┫ 1.1k/1.1k [00:59<00:01, 18it/s]
-
98.6%┣████████████████████████████████████████▍┫ 1.1k/1.1k [00:59<00:01, 18it/s]
-
98.7%┣████████████████████████████████████████▌┫ 1.1k/1.1k [00:59<00:01, 18it/s]
-
98.8%┣████████████████████████████████████████▌┫ 1.1k/1.1k [00:59<00:01, 18it/s]
-
98.9%┣████████████████████████████████████████▌┫ 1.1k/1.1k [00:59<00:01, 18it/s]
-
99.1%┣████████████████████████████████████████▋┫ 1.1k/1.1k [00:59<00:01, 18it/s]
-
99.2%┣████████████████████████████████████████▋┫ 1.1k/1.1k [00:59<00:00, 18it/s]
-
99.3%┣████████████████████████████████████████▊┫ 1.1k/1.1k [00:59<00:00, 18it/s]
-
99.4%┣████████████████████████████████████████▊┫ 1.1k/1.1k [00:59<00:00, 18it/s]
-
99.5%┣████████████████████████████████████████▉┫ 1.1k/1.1k [00:59<00:00, 18it/s]
-
99.6%┣████████████████████████████████████████▉┫ 1.1k/1.1k [00:59<00:00, 18it/s]
-
99.7%┣████████████████████████████████████████▉┫ 1.1k/1.1k [00:59<00:00, 18it/s]
-
99.9%┣█████████████████████████████████████████┫ 1.1k/1.1k [01:00<00:00, 18it/s]
-
100.0%┣████████████████████████████████████████┫ 1.1k/1.1k [01:00<00:00, 18it/s]

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

n = size(get_system(ds_train[1]))[1]
+Σ = learn!(lb, ds_train[dpp_inds], α)
UnivariateLinearProblem{T, [-0.04903795794583843, 0.2279407758045835, -0.5447066887850269, 0.8433585093983424, -0.8417754356660794, 0.36546221169163573, 0.2664211780284518, 0.13100204160340922, -0.0013678563591941195, 0.0041544442909766666, -0.008195004904234082, 0.006204920045696838, 0.014345757932321845, -0.0670931304199347, 0.15796348798178528, -0.006379895308766592, 0.02384214301270049, -0.06950573195577903, 0.14679515288848677, -0.24799151788261042, 0.0013102677014340536, -0.0046393307505865344, 0.012492674542303739, -0.0009471094750288234, -0.023393752054971628, 0.026038151002232723, 0.00805504813234137, -0.15507180397728604, 0.48697993130734574, -0.1782838974344969, 0.36775473793903757, -0.7773743038400767, 0.032869604616703185, -0.007071840869798507, -0.19149062500390812, 0.7785977510549262, -1.5185604185296597, 1.2508422078791632, -0.00011392193111103843, 0.000325649126805605, -0.0008593720822397399, 0.001559375268243457, -0.002061262413737275, 0.0018213900224561819, -0.00011065135094133483, 0.0004124013541371707, -0.0011976192114403483, 0.002515856028801222, 2.745120127892013e-5, -9.761576411803502e-5, -0.0015946028905260423, 0.0029197298470569066, -0.00511858207244309, 0.006284364896113281, -0.003075553726940461, 0.006319769992952029, -0.010336523154601096, 0.011990243091878128, 1.840434120245829e-5, 0.0006044284535478561, -9.299207435224666e-5, -0.0018478075119032766, 0.004168058558875032, -6.750160517201426e-5, -0.0022531466666744215, 0.006544907687691115, 0.006889833287340608, -0.00014751902611397083, 0.013338743237198969, -0.01945898050431083, 0.032533216925379804, 0.01680633107474705, 0.046965011491167274], [0.27838115649011613]}

Post-process results

Update test dataset by adding energy descriptors.

println("Computing local descriptors of test dataset")
+e_descr_test = compute_local_descriptors(conf_test, ace, pbar = false)
+ds_test = DataSet(conf_test .+ e_descr_test);
Computing local descriptors of test dataset

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;

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.00455040287256017, RMSE: 0.005997970189468177, RSQ: 0.8194742258945313

Plot energy error.

e_err_train, e_err_test = (e_train_pred - e_train), (e_test_pred - e_test)
+println("MAE: $e_mae, RMSE: $e_rmse, RSQ: $e_rsq")
MAE: 0.004606058963658236, RMSE: 0.0060458156005117674, RSQ: 0.8208726272861704

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)
@@ -895,4 +61,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/PR84/generated/DPP-ACE-Si/fit-dpp-ace-si/index.html b/previews/PR84/generated/DPP-ACE-Si/fit-dpp-ace-si/index.html index b68d197..462b98a 100644 --- a/previews/PR84/generated/DPP-ACE-Si/fit-dpp-ace-si/index.html +++ b/previews/PR84/generated/DPP-ACE-Si/fit-dpp-ace-si/index.html @@ -49,11 +49,11 @@ batch 3 batch 4 batch 5 -condnum: [1.86443735000523e10, 1.9827222971809242e10, 1.871347279290145e10, 1.994110953706399e10, 1.9138464395519135e10] +condnum: [1.9773782387303787e10, 2.0207126318285233e10, 1.937309984742764e10, 1.96064692549535e10, 1.983878537556088e10] =============== Starting batch size 40 =============== batch 1 batch 2 batch 3 batch 4 batch 5 -condnum: [2.0220180222347134e10, 1.938580188423855e10, 1.8345019433730633e10, 2.025660782811996e10, 1.8934972189065136e10]

This page was generated using Literate.jl.

+condnum: [1.8010891053120365e10, 1.7323989978748745e10, 1.9591275096570847e10, 1.8507110124894306e10, 1.7403415921546246e10]

This page was generated using Literate.jl.

diff --git a/previews/PR84/generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/0afc979d.png b/previews/PR84/generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/0afc979d.png deleted file mode 100644 index a528117..0000000 Binary files a/previews/PR84/generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/0afc979d.png and /dev/null differ diff --git a/previews/PR84/generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/4b8f808a.png b/previews/PR84/generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/4b8f808a.png new file mode 100644 index 0000000..b915e0c Binary files /dev/null and b/previews/PR84/generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/4b8f808a.png differ diff --git a/previews/PR84/generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/87584eb8.png b/previews/PR84/generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/87584eb8.png deleted file mode 100644 index 9768cef..0000000 Binary files a/previews/PR84/generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/87584eb8.png and /dev/null differ diff --git a/previews/PR84/generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/88a1c661.png b/previews/PR84/generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/88a1c661.png new file mode 100644 index 0000000..ccf94b3 Binary files /dev/null and b/previews/PR84/generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/88a1c661.png differ diff --git a/previews/PR84/generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/896d7ed5.png b/previews/PR84/generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/896d7ed5.png deleted file mode 100644 index 57f5195..0000000 Binary files a/previews/PR84/generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/896d7ed5.png and /dev/null differ diff --git a/previews/PR84/generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/91f1981a.png b/previews/PR84/generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/91f1981a.png new file mode 100644 index 0000000..3a30014 Binary files /dev/null and b/previews/PR84/generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/91f1981a.png differ diff --git a/previews/PR84/generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/a937311a.png b/previews/PR84/generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/a937311a.png deleted file mode 100644 index 87f4966..0000000 Binary files a/previews/PR84/generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/a937311a.png and /dev/null differ diff --git a/previews/PR84/generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/c7c3eb4c.png b/previews/PR84/generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/c7c3eb4c.png new file mode 100644 index 0000000..ca5b0a6 Binary files /dev/null and b/previews/PR84/generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/c7c3eb4c.png differ diff --git a/previews/PR84/generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/index.html b/previews/PR84/generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/index.html index 1bf92b4..89cd8af 100644 --- a/previews/PR84/generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/index.html +++ b/previews/PR84/generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/index.html @@ -25,7 +25,7 @@ GlobalMean(), DotProduct(); batch_size = 50)
kDPP(L-Ensemble.
-Number of items in ground set : 100. Max. rank : 100. Rescaling constant α=1.5547299903360698e15
+Number of items in ground set : 100. Max. rank : 100. Rescaling constant α=1.7148027220007558e15
 , 50)

Subsample trainig dataset.

inds = get_random_subset(dataset_selector)
 conf_train = @views conf_train[inds];

Compute descriptors

Create ACE basis.

basis = ACE(species           = [:Hf, :O],
             body_order        = 3,
@@ -65,7 +65,7 @@
 learn!(lb, ds_train, ws, int)
 @save_var res_path lb.β
 @save_var res_path lb.β0
-lb.β, lb.β0
([668.6881258487701, 384.2495012283325, 153.68560627102852, 30.18747902289033, 132.16206489503384, 41.63736667856574, -15.723599650315009, -1.6281386595219374, 8582.249843597412, 4711.528293609619  …  127.3466037735343, 69.17120319604874, -1806.7922897338867, -639.2673139572144, 243.28065395355225, -1582.8186225891113, 2955.887908935547, 3744.0139541625977, -1040.6038207411766, -1013.9924421310425], [0.0])

Post-process results

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

println("Computing energy descriptors of test dataset...")
+lb.β, lb.β0
([989.654163479805, 513.1826636791229, 182.9983583241701, 32.88304098509252, 107.50526095181704, 30.37650476419367, -18.698341257637367, -2.7314057955518365, 7823.224727630615, 4328.415250778198  …  122.88483897317201, 64.85433851182461, -499.9987487792969, -434.15935802459717, 302.62152338027954, -1572.9695501327515, 2978.613212585449, 3451.6201248168945, -997.5596956014633, -901.9709777832031], [0.0])

Post-process 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...")
@@ -99,13 +99,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.00177821
-  "e_train_rmse"     => 0.00208449
-  "e_train_rsq"      => 0.647331
-  "f_train_mae"      => 0.169429
-  "f_train_rmse"     => 0.216704
-  "f_train_rsq"      => 0.856095
-  "f_train_mean_cos" => 0.893975

Compute and save test metrics.

e_test_metrics = get_metrics(e_test, e_test_pred,
+  "e_train_mae"      => 0.00183077
+  "e_train_rmse"     => 0.00215831
+  "e_train_rsq"      => 0.643069
+  "f_train_mae"      => 0.16807
+  "f_train_rmse"     => 0.214966
+  "f_train_rsq"      => 0.856065
+  "f_train_mean_cos" => 0.89249

Compute and save 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,
@@ -114,28 +114,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.0011584
-  "e_test_rmse"     => 0.00141246
-  "e_test_rsq"      => 0.768781
-  "f_test_mae"      => 0.173173
-  "f_test_rmse"     => 0.218941
-  "f_test_rsq"      => 0.848838
-  "f_test_mean_cos" => 0.885553

Plot and save energy results.

e_plot = plot_energy(e_train, e_train_pred,
+  "e_test_mae"      => 0.00127736
+  "e_test_rmse"     => 0.00147785
+  "e_test_rsq"      => 0.769582
+  "f_test_mae"      => 0.174894
+  "f_test_rmse"     => 0.220801
+  "f_test_rsq"      => 0.846424
+  "f_test_mean_cos" => 0.889697

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/PR84/generated/LJ-Ar/lennard-jones-ar/index.html b/previews/PR84/generated/LJ-Ar/lennard-jones-ar/index.html index 1bf6d9b..a20e635 100644 --- a/previews/PR84/generated/LJ-Ar/lennard-jones-ar/index.html +++ b/previews/PR84/generated/LJ-Ar/lennard-jones-ar/index.html @@ -2,7 +2,7 @@ Load Ar+Lennard-Jones dataset and postprocess · PotentialLearning.jl

Load Ar dataset with energies computed by Lennard-Jones and postprocess

Setup experiment

Load packages.

using Unitful, UnitfulAtomic
 using AtomsBase, InteratomicPotentials, PotentialLearning
 using LinearAlgebra, Plots, DisplayAs

Define paths.

base_path = haskey(ENV, "BASE_PATH") ? ENV["BASE_PATH"] : "../../"
-ds_path   = "$base_path/examples/data/LJ-AR/lj-ar.yaml"
"/home/runner/work/PotentialLearning.jl/PotentialLearning.jl/docs/..//examples/data/LJ-AR/lj-ar.yaml"

Load datasets

ds, thermo = load_data(ds_path, YAML(:Ar, u"eV", u"Å"))
+ds_path   = "$base_path/examples/data/LJ-AR/lj-ar.yaml";

Load datasets

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}
@@ -20,4 +20,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/PR84/generated/Opt-ACE-aHfO2/fit-opt-ace-ahfo2/9ff883a4.png b/previews/PR84/generated/Opt-ACE-aHfO2/fit-opt-ace-ahfo2/9ff883a4.png new file mode 100644 index 0000000..2681805 Binary files /dev/null and b/previews/PR84/generated/Opt-ACE-aHfO2/fit-opt-ace-ahfo2/9ff883a4.png differ diff --git a/previews/PR84/generated/Opt-ACE-aHfO2/fit-opt-ace-ahfo2/ef0a8445.png b/previews/PR84/generated/Opt-ACE-aHfO2/fit-opt-ace-ahfo2/ef0a8445.png deleted file mode 100644 index 9aa7613..0000000 Binary files a/previews/PR84/generated/Opt-ACE-aHfO2/fit-opt-ace-ahfo2/ef0a8445.png and /dev/null differ diff --git a/previews/PR84/generated/Opt-ACE-aHfO2/fit-opt-ace-ahfo2/index.html b/previews/PR84/generated/Opt-ACE-aHfO2/fit-opt-ace-ahfo2/index.html index 466afa2..37e0d83 100644 --- a/previews/PR84/generated/Opt-ACE-aHfO2/fit-opt-ace-ahfo2/index.html +++ b/previews/PR84/generated/Opt-ACE-aHfO2/fit-opt-ace-ahfo2/index.html @@ -36,19 +36,19 @@ Continuous(), Continuous(), Continuous()]) iap, res = hyperlearn!(model, pars, conf_train; n_samples = 10, sampler = sampler, - loss = custom_loss, ws = [1.0, 1.0], int = true);
E_MAE:0.103 eV/atom, F_MAE:0.116 eV/Å, Time per force per atom:218.439 µs
-E_MAE:0.161 eV/atom, F_MAE:0.214 eV/Å, Time per force per atom:128.035 µs
-E_MAE:0.063 eV/atom, F_MAE:0.087 eV/Å, Time per force per atom:1172.989 µs
-E_MAE:0.2 eV/atom, F_MAE:0.189 eV/Å, Time per force per atom:109.971 µs
-E_MAE:0.209 eV/atom, F_MAE:0.302 eV/Å, Time per force per atom:65.641 µs
-E_MAE:0.223 eV/atom, F_MAE:0.172 eV/Å, Time per force per atom:225.24 µs
-E_MAE:0.194 eV/atom, F_MAE:0.175 eV/Å, Time per force per atom:141.765 µs
-E_MAE:0.179 eV/atom, F_MAE:0.305 eV/Å, Time per force per atom:50.315 µs
-E_MAE:0.251 eV/atom, F_MAE:0.312 eV/Å, Time per force per atom:34.678 µs
-E_MAE:0.147 eV/atom, F_MAE:0.207 eV/Å, Time per force per atom:239.637 µs

Post-process results

Save and show results.

@save_var res_path iap.β
+                       loss = custom_loss, ws = [1.0, 1.0], int = true);
E_MAE:0.178 eV/atom, F_MAE:0.171 eV/Å, Time per force per atom:262.872 µs
+E_MAE:0.221 eV/atom, F_MAE:0.299 eV/Å, Time per force per atom:105.712 µs
+E_MAE:0.224 eV/atom, F_MAE:0.252 eV/Å, Time per force per atom:85.564 µs
+E_MAE:0.212 eV/atom, F_MAE:0.306 eV/Å, Time per force per atom:72.861 µs
+E_MAE:0.164 eV/atom, F_MAE:0.254 eV/Å, Time per force per atom:48.434 µs
+E_MAE:0.203 eV/atom, F_MAE:0.307 eV/Å, Time per force per atom:54.446 µs
+E_MAE:0.058 eV/atom, F_MAE:0.096 eV/Å, Time per force per atom:601.629 µs
+E_MAE:0.212 eV/atom, F_MAE:0.25 eV/Å, Time per force per atom:115.372 µs
+E_MAE:0.079 eV/atom, F_MAE:0.122 eV/Å, Time per force per atom:157.913 µs
+E_MAE:0.095 eV/atom, F_MAE:0.134 eV/Å, Time per force per atom:220.838 µs

Post-process results

Save and show results.

@save_var res_path iap.β
 @save_var res_path iap.β0
 @save_var res_path iap.basis
 @save_dataframe res_path res
-res
10×13 DataFrame
Rowe_maee_rmsee_rsqf_maef_rmsef_rsqtime_usbody_orderpolynomial_degreercutoffwLcspr0
AnyAnyAnyAnyAnyAnyAnyAnyAnyAnyAnyAnyAny
10.06330280.07324780.9496710.08673010.1116270.9655391172.993.04.05.555560.8333331.277781.5
20.1028660.1177420.8699560.1162670.1493850.938283218.4393.04.05.333330.7222220.7222220.5
30.1467780.1791920.6987930.2069470.2693440.799367239.6372.03.04.888891.50.9444441.38889
40.1609970.1926760.6517550.2140990.2789210.784846128.0353.04.05.333330.7222220.7222220.5
50.1791090.2279620.5125250.3052190.400260.5569350.31484.05.04.01.055561.055561.27778
60.194050.2273290.5152260.1746530.2262950.858376141.7654.05.04.01.055561.055561.27778
70.1996320.2367130.4743790.189460.2456640.833095109.9713.04.05.555560.8333331.277781.5
80.2089260.2580630.3752870.302420.3967610.56464465.64134.04.05.777780.9444440.51.16667
90.2225310.2684940.3237630.1724910.2217830.863967225.244.04.05.777780.9444440.51.16667
100.2509760.2905950.2078560.3115070.4070490.54177334.67782.03.04.888891.50.9444441.38889

Plot error vs time.

err_time = plot_err_time(res)
+res
10×13 DataFrame
Rowe_maee_rmsee_rsqf_maef_rmsef_rsqtime_usbody_orderpolynomial_degreercutoffwLcspr0
AnyAnyAnyAnyAnyAnyAnyAnyAnyAnyAnyAnyAny
10.05788390.07024940.9401850.0962570.1242450.959365601.6292.05.04.666671.277781.277780.611111
20.07854520.09853880.882310.1223470.1588180.933604157.9134.04.04.01.055561.388891.27778
30.0946520.1195240.8268450.1336890.173080.921144220.8384.04.04.01.055561.388891.27778
40.1643510.2061420.4849370.2544550.3305110.71245148.43383.03.05.111110.6111111.50.833333
50.1784350.221680.4043670.1713460.2180990.874787262.8723.04.06.00.9444440.8333330.5
60.2030850.2492790.2468180.3068530.4027190.57308254.44653.03.05.111110.6111111.50.833333
70.2116570.2631060.1609470.3059030.4017760.57507872.86092.05.05.333331.166671.166671.5
80.212320.2654650.1458360.2503220.3208230.72906115.3722.05.04.666671.277781.277780.611111
90.2214990.2664240.1396550.2994880.3944440.590446105.7123.04.06.00.9444440.8333330.5
100.2244250.2744080.08731540.2517960.3252870.72146885.56362.05.05.333331.166671.166671.5

Plot error vs time.

err_time = plot_err_time(res)
 @save_fig res_path err_time
-DisplayAs.PNG(err_time)
Example block output

This page was generated using Literate.jl.

+DisplayAs.PNG(err_time)Example block output

This page was generated using Literate.jl.

diff --git a/previews/PR84/generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/0f72aa9c.png b/previews/PR84/generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/0f72aa9c.png deleted file mode 100644 index 9b01466..0000000 Binary files a/previews/PR84/generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/0f72aa9c.png and /dev/null differ diff --git a/previews/PR84/generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/189f1641.png b/previews/PR84/generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/189f1641.png deleted file mode 100644 index f4352ed..0000000 Binary files a/previews/PR84/generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/189f1641.png and /dev/null differ diff --git a/previews/PR84/generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/59d51e99.png b/previews/PR84/generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/59d51e99.png new file mode 100644 index 0000000..8870017 Binary files /dev/null and b/previews/PR84/generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/59d51e99.png differ diff --git a/previews/PR84/generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/7cfd9079.png b/previews/PR84/generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/7cfd9079.png deleted file mode 100644 index 4eb2e69..0000000 Binary files a/previews/PR84/generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/7cfd9079.png and /dev/null differ diff --git a/previews/PR84/generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/c018d4bd.png b/previews/PR84/generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/c018d4bd.png new file mode 100644 index 0000000..109b22d Binary files /dev/null and b/previews/PR84/generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/c018d4bd.png differ diff --git a/previews/PR84/generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/ce345a95.png b/previews/PR84/generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/ce345a95.png new file mode 100644 index 0000000..5706a24 Binary files /dev/null and b/previews/PR84/generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/ce345a95.png differ diff --git a/previews/PR84/generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/db75b14d.png b/previews/PR84/generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/db75b14d.png new file mode 100644 index 0000000..abcbb72 Binary files /dev/null and b/previews/PR84/generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/db75b14d.png differ diff --git a/previews/PR84/generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/ff42ec5e.png b/previews/PR84/generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/ff42ec5e.png deleted file mode 100644 index f978d9f..0000000 Binary files a/previews/PR84/generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/ff42ec5e.png and /dev/null differ diff --git a/previews/PR84/generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/index.html b/previews/PR84/generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/index.html index c1ac664..747868d 100644 --- a/previews/PR84/generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/index.html +++ b/previews/PR84/generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/index.html @@ -53,7 +53,7 @@ learn!(lb, ds_train, ws, int) @save_var res_path lb.β @save_var res_path lb.β0 -lb.β, lb.β0
([-0.17332287074792183, -0.7187328082972403, -0.3431634322832522, -1.9345185590228444, -1.1135352503446025, 1.9276462934748708, 2.503219205701496, -16.924270107739915, -41.53065082639696, 10.035626771382775, -23.529123938332173, 64.93767573951772, 12.086219322274372, -38.92120959611022, -44.055742372843696, 53.363736847757295, 90.01649390430349, 182.49912989468586, -63.20046762126952, -54.06865246257429], [-952.4961130292013])

Post-process 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.41567367671170485, -0.8091783552334213, -0.4507259080897137, -1.1340578062328925, 3.1647489013126515, 0.5619081149108189, -19.294384009514996, -18.28195277646576, -42.856508911985735, 7.553932829266812, 35.49129536461825, -56.93557108754054, 12.394287737973649, -33.593650446280215, -17.123689572529408, 30.127381909941363, 107.44458320562872, -50.636062411995105, 140.63328499916818, -191.84955167099113], [-952.5087470200009])

Post-process 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...")
@@ -87,13 +87,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.00210835
-  "e_train_rmse"     => 0.00257056
-  "e_train_rsq"      => 0.528477
-  "f_train_mae"      => 0.245595
-  "f_train_rmse"     => 0.311675
-  "f_train_rsq"      => 0.637315
-  "f_train_mean_cos" => 0.796001

Compute and save test metrics.

e_test_metrics = get_metrics(e_test, e_test_pred,
+  "e_train_mae"      => 0.00279765
+  "e_train_rmse"     => 0.00334979
+  "e_train_rsq"      => 0.482815
+  "f_train_mae"      => 0.244978
+  "f_train_rmse"     => 0.311008
+  "f_train_rsq"      => 0.639103
+  "f_train_mean_cos" => 0.79428

Compute and save 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,
@@ -102,28 +102,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.00174889
-  "e_test_rmse"     => 0.00213818
-  "e_test_rsq"      => 0.589254
-  "f_test_mae"      => 0.241626
-  "f_test_rmse"     => 0.306581
-  "f_test_rsq"      => 0.637504
-  "f_test_mean_cos" => 0.788053

Plot and save energy results.

e_plot = plot_energy(e_train, e_train_pred,
+  "e_test_mae"      => 0.00258705
+  "e_test_rmse"     => 0.0029147
+  "e_test_rsq"      => 0.234708
+  "f_test_mae"      => 0.243491
+  "f_test_rmse"     => 0.308161
+  "f_test_rsq"      => 0.644162
+  "f_test_mean_cos" => 0.794746

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/PR84/index.html b/previews/PR84/index.html index 3d7e9e6..aac7933 100644 --- a/previews/PR84/index.html +++ b/previews/PR84/index.html @@ -11,4 +11,4 @@ end iap, res = hyperlearn!(model, pars, conf_train; loss = custom_loss);

2 - Export optimal values to your molecular dynamic workflow.

See example.

The models are compatible with the interfaces of our sister package InteratomicPotentials.jl. In particular, we are interested in maintaining compatibility with ACESuit, as well as integrating LAMMPS based potentials such as ML-POD and ML-PACE. We are also working to provide neural network potential architecture optimization.

Compress interatomic potential data and model

Compress interatomic potential data and model using dimensionality reduction of energy and force descriptors:

1 - Define a PCA state, fit PCA with your the energy and force descriptors of your dataset, and transform all dataset descriptors.

pca = PCAState(tol = n_desc)
 fit!(ds_train, pca)
-transform!(ds_train, pca)

2 - Export PCA fitted data to be used in your workflow.

See example.

We are working to provide feature selection of energy and force descriptors based on CUR.

Additionally, this package includes utilities for loading input data (such as XYZ files), computing various metrics (including MAE, MSE, RSQ, and COV), exporting results, and generating plots.

Acknowledgment

Center for the Exascale Simulation of Materials in Extreme Environments (CESMIX). Massachusetts Institute of Technology (MIT).

+transform!(ds_train, pca)

2 - Export PCA fitted data to be used in your workflow.

See example.

We are working to provide feature selection of energy and force descriptors based on CUR.

Additionally, this package includes utilities for loading input data (such as XYZ files), computing various metrics (including MAE, MSE, RSQ, and COV), exporting results, and generating plots.

Acknowledgment

Center for the Exascale Simulation of Materials in Extreme Environments (CESMIX). Massachusetts Institute of Technology (MIT).

diff --git a/previews/PR84/install-and-run-examples/index.html b/previews/PR84/install-and-run-examples/index.html index 8bc69c9..270a202 100644 --- a/previews/PR84/install-and-run-examples/index.html +++ b/previews/PR84/install-and-run-examples/index.html @@ -2,4 +2,4 @@ Install and run examples · PotentialLearning.jl

Install and run 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 to access example folders

Clone PotentialLearning.jl repository in your working directory.

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

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

    $ cd PotentialLearning.jl/examples/DPP-ACE-aHfO2-1

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-ahfo2.jl")
+ pkg> registry add https://github.com/ACEsuit/ACEregistry

Clone repository to access example folders

Clone PotentialLearning.jl repository in your working directory.

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

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

    $ cd PotentialLearning.jl/examples/DPP-ACE-aHfO2-1

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-ahfo2.jl")
diff --git a/previews/PR84/search_index.js b/previews/PR84/search_index.js index dcb659e..65d207c 100644 --- a/previews/PR84/search_index.js +++ b/previews/PR84/search_index.js @@ -1,3 +1,3 @@ var documenterSearchIndex = {"docs": -[{"location":"generated/ACE-aHfO2/fit-ace-ahfo2/","page":"Fit a-HfO2 dataset with ACE","title":"Fit a-HfO2 dataset with ACE","text":"EditURL = \"../../../../examples/ACE-aHfO2/fit-ace-ahfo2.jl\"","category":"page"},{"location":"generated/ACE-aHfO2/fit-ace-ahfo2/#Fit-a-HfO2-dataset-with-ACE","page":"Fit a-HfO2 dataset with ACE","title":"Fit a-HfO2 dataset with ACE","text":"","category":"section"},{"location":"generated/ACE-aHfO2/fit-ace-ahfo2/#Setup-experiment","page":"Fit a-HfO2 dataset with ACE","title":"Setup experiment","text":"","category":"section"},{"location":"generated/ACE-aHfO2/fit-ace-ahfo2/","page":"Fit a-HfO2 dataset with ACE","title":"Fit a-HfO2 dataset with ACE","text":"Load packages.","category":"page"},{"location":"generated/ACE-aHfO2/fit-ace-ahfo2/","page":"Fit a-HfO2 dataset with ACE","title":"Fit a-HfO2 dataset with ACE","text":"using AtomsBase, InteratomicPotentials, PotentialLearning\nusing Unitful, UnitfulAtomic\nusing LinearAlgebra, Random, DisplayAs","category":"page"},{"location":"generated/ACE-aHfO2/fit-ace-ahfo2/","page":"Fit a-HfO2 dataset with ACE","title":"Fit a-HfO2 dataset with ACE","text":"Define paths.","category":"page"},{"location":"generated/ACE-aHfO2/fit-ace-ahfo2/","page":"Fit a-HfO2 dataset with ACE","title":"Fit a-HfO2 dataset with ACE","text":"base_path = haskey(ENV, \"BASE_PATH\") ? ENV[\"BASE_PATH\"] : \"../../\"\nds_path = \"$base_path/examples/data/a-HfO2/a-HfO2-300K-NVT-6000.extxyz\"\nres_path = \"$base_path/examples/ACE-aHfO2/results/\";\nnothing #hide","category":"page"},{"location":"generated/ACE-aHfO2/fit-ace-ahfo2/","page":"Fit a-HfO2 dataset with ACE","title":"Fit a-HfO2 dataset with ACE","text":"Load utility functions.","category":"page"},{"location":"generated/ACE-aHfO2/fit-ace-ahfo2/","page":"Fit a-HfO2 dataset with ACE","title":"Fit a-HfO2 dataset with ACE","text":"include(\"$base_path/examples/utils/utils.jl\")","category":"page"},{"location":"generated/ACE-aHfO2/fit-ace-ahfo2/","page":"Fit a-HfO2 dataset with ACE","title":"Fit a-HfO2 dataset with ACE","text":"Create experiment folder.","category":"page"},{"location":"generated/ACE-aHfO2/fit-ace-ahfo2/","page":"Fit a-HfO2 dataset with ACE","title":"Fit a-HfO2 dataset with ACE","text":"run(`mkdir -p $res_path`);\nnothing #hide","category":"page"},{"location":"generated/ACE-aHfO2/fit-ace-ahfo2/#Load-datasets","page":"Fit a-HfO2 dataset with ACE","title":"Load datasets","text":"","category":"section"},{"location":"generated/ACE-aHfO2/fit-ace-ahfo2/","page":"Fit a-HfO2 dataset with ACE","title":"Fit a-HfO2 dataset with ACE","text":"Load atomistic dataset: atomistic configurations (atom positions, geometry, etc.) + DFT data (energies, forces, etc.)","category":"page"},{"location":"generated/ACE-aHfO2/fit-ace-ahfo2/","page":"Fit a-HfO2 dataset with ACE","title":"Fit a-HfO2 dataset with ACE","text":"ds = load_data(ds_path, uparse(\"eV\"), uparse(\"Å\"))[1:1000]; # Load first 1K samples.\nnothing #hide","category":"page"},{"location":"generated/ACE-aHfO2/fit-ace-ahfo2/","page":"Fit a-HfO2 dataset with ACE","title":"Fit a-HfO2 dataset with ACE","text":"Split atomistic dataset into training and test.","category":"page"},{"location":"generated/ACE-aHfO2/fit-ace-ahfo2/","page":"Fit a-HfO2 dataset with ACE","title":"Fit a-HfO2 dataset with ACE","text":"n_train, n_test = 50, 50 # Only 50 samples per dataset are used in this example.\nconf_train, conf_test = split(ds, n_train, n_test)","category":"page"},{"location":"generated/ACE-aHfO2/fit-ace-ahfo2/#Compute-descriptors","page":"Fit a-HfO2 dataset with ACE","title":"Compute descriptors","text":"","category":"section"},{"location":"generated/ACE-aHfO2/fit-ace-ahfo2/","page":"Fit a-HfO2 dataset with ACE","title":"Fit a-HfO2 dataset with ACE","text":"Create and save ACE basis.","category":"page"},{"location":"generated/ACE-aHfO2/fit-ace-ahfo2/","page":"Fit a-HfO2 dataset with ACE","title":"Fit a-HfO2 dataset with ACE","text":"basis = ACE(species = [:Hf, :O],\n body_order = 3,\n polynomial_degree = 4,\n rcutoff = 5.0,\n wL = 1.0,\n csp = 1.0,\n r0 = 1.0)\n@save_var res_path basis;\nnothing #hide","category":"page"},{"location":"generated/ACE-aHfO2/fit-ace-ahfo2/","page":"Fit a-HfO2 dataset with ACE","title":"Fit a-HfO2 dataset with ACE","text":"Compute ACE descriptors for energy and forces based on the atomistic training configurations.","category":"page"},{"location":"generated/ACE-aHfO2/fit-ace-ahfo2/","page":"Fit a-HfO2 dataset with ACE","title":"Fit a-HfO2 dataset with ACE","text":"println(\"Computing energy descriptors of training dataset...\")\ne_descr_train = compute_local_descriptors(conf_train, basis;\n pbar=false)\nprintln(\"Computing force descriptors of training dataset...\")\nf_descr_train = compute_force_descriptors(conf_train, basis;\n pbar=false)","category":"page"},{"location":"generated/ACE-aHfO2/fit-ace-ahfo2/","page":"Fit a-HfO2 dataset with ACE","title":"Fit a-HfO2 dataset with ACE","text":"Update training dataset by adding energy and force descriptors.","category":"page"},{"location":"generated/ACE-aHfO2/fit-ace-ahfo2/","page":"Fit a-HfO2 dataset with ACE","title":"Fit a-HfO2 dataset with ACE","text":"ds_train = DataSet(conf_train .+ e_descr_train .+ f_descr_train);\nnothing #hide","category":"page"},{"location":"generated/ACE-aHfO2/fit-ace-ahfo2/#Learn-coefficients","page":"Fit a-HfO2 dataset with ACE","title":"Learn coefficients","text":"","category":"section"},{"location":"generated/ACE-aHfO2/fit-ace-ahfo2/","page":"Fit a-HfO2 dataset with ACE","title":"Fit a-HfO2 dataset with ACE","text":"Learn and save ACE coefficients based on ACE descriptors and DFT data.","category":"page"},{"location":"generated/ACE-aHfO2/fit-ace-ahfo2/","page":"Fit a-HfO2 dataset with ACE","title":"Fit a-HfO2 dataset with ACE","text":"println(\"Learning energies and forces...\")\nlb = LBasisPotential(basis)\nws, int = [1.0, 1.0], false\nlearn!(lb, ds_train, ws, int)\n@save_var res_path lb.β\n@save_var res_path lb.β0\nlb.β, lb.β0","category":"page"},{"location":"generated/ACE-aHfO2/fit-ace-ahfo2/#Post-process-results","page":"Fit a-HfO2 dataset with ACE","title":"Post-process results","text":"","category":"section"},{"location":"generated/ACE-aHfO2/fit-ace-ahfo2/","page":"Fit a-HfO2 dataset with ACE","title":"Fit a-HfO2 dataset with ACE","text":"Compute ACE descriptors for energy and forces based on the atomistic test configurations.","category":"page"},{"location":"generated/ACE-aHfO2/fit-ace-ahfo2/","page":"Fit a-HfO2 dataset with ACE","title":"Fit a-HfO2 dataset with ACE","text":"println(\"Computing energy descriptors of test dataset...\")\ne_descr_test = compute_local_descriptors(conf_test, basis;\n pbar = false)\nprintln(\"Computing force descriptors of test dataset...\")\nf_descr_test = compute_force_descriptors(conf_test, basis;\n pbar = false);\nnothing #hide","category":"page"},{"location":"generated/ACE-aHfO2/fit-ace-ahfo2/","page":"Fit a-HfO2 dataset with ACE","title":"Fit a-HfO2 dataset with ACE","text":"Update test dataset by adding energy and force descriptors.","category":"page"},{"location":"generated/ACE-aHfO2/fit-ace-ahfo2/","page":"Fit a-HfO2 dataset with ACE","title":"Fit a-HfO2 dataset with ACE","text":"ds_test = DataSet(conf_test .+ e_descr_test .+ f_descr_test);\nnothing #hide","category":"page"},{"location":"generated/ACE-aHfO2/fit-ace-ahfo2/","page":"Fit a-HfO2 dataset with ACE","title":"Fit a-HfO2 dataset with ACE","text":"Get and save true and predicted values for energies and forces.","category":"page"},{"location":"generated/ACE-aHfO2/fit-ace-ahfo2/","page":"Fit a-HfO2 dataset with ACE","title":"Fit a-HfO2 dataset with ACE","text":"n_atoms_train = length.(get_system.(ds_train))\nn_atoms_test = length.(get_system.(ds_test))\n\ne_train, e_train_pred = get_all_energies(ds_train) ./ n_atoms_train,\n get_all_energies(ds_train, lb) ./ n_atoms_train\nf_train, f_train_pred = get_all_forces(ds_train),\n get_all_forces(ds_train, lb)\n@save_var res_path e_train\n@save_var res_path e_train_pred\n@save_var res_path f_train\n@save_var res_path f_train_pred\n\ne_test, e_test_pred = get_all_energies(ds_test) ./ n_atoms_test,\n get_all_energies(ds_test, lb) ./ n_atoms_test\nf_test, f_test_pred = get_all_forces(ds_test),\n get_all_forces(ds_test, lb)\n@save_var res_path e_test\n@save_var res_path e_test_pred\n@save_var res_path f_test\n@save_var res_path f_test_pred;\nnothing #hide","category":"page"},{"location":"generated/ACE-aHfO2/fit-ace-ahfo2/","page":"Fit a-HfO2 dataset with ACE","title":"Fit a-HfO2 dataset with ACE","text":"Compute and save training metrics.","category":"page"},{"location":"generated/ACE-aHfO2/fit-ace-ahfo2/","page":"Fit a-HfO2 dataset with ACE","title":"Fit a-HfO2 dataset with ACE","text":"e_train_metrics = get_metrics(e_train, e_train_pred,\n metrics = [mae, rmse, rsq],\n label = \"e_train\")\nf_train_metrics = get_metrics(f_train, f_train_pred,\n metrics = [mae, rmse, rsq, mean_cos],\n label = \"f_train\")\ntrain_metrics = merge(e_train_metrics, f_train_metrics)\n@save_dict res_path train_metrics\ntrain_metrics","category":"page"},{"location":"generated/ACE-aHfO2/fit-ace-ahfo2/","page":"Fit a-HfO2 dataset with ACE","title":"Fit a-HfO2 dataset with ACE","text":"Compute and save test metrics.","category":"page"},{"location":"generated/ACE-aHfO2/fit-ace-ahfo2/","page":"Fit a-HfO2 dataset with ACE","title":"Fit a-HfO2 dataset with ACE","text":"e_test_metrics = get_metrics(e_test, e_test_pred,\n metrics = [mae, rmse, rsq],\n label = \"e_test\")\nf_test_metrics = get_metrics(f_test, f_test_pred,\n metrics = [mae, rmse, rsq, mean_cos],\n label = \"f_test\")\ntest_metrics = merge(e_test_metrics, f_test_metrics)\n@save_dict res_path test_metrics\ntest_metrics","category":"page"},{"location":"generated/ACE-aHfO2/fit-ace-ahfo2/","page":"Fit a-HfO2 dataset with ACE","title":"Fit a-HfO2 dataset with ACE","text":"Plot and save energy results.","category":"page"},{"location":"generated/ACE-aHfO2/fit-ace-ahfo2/","page":"Fit a-HfO2 dataset with ACE","title":"Fit a-HfO2 dataset with ACE","text":"e_plot = plot_energy(e_train, e_train_pred,\n e_test, e_test_pred)\n@save_fig res_path e_plot\nDisplayAs.PNG(e_plot)","category":"page"},{"location":"generated/ACE-aHfO2/fit-ace-ahfo2/","page":"Fit a-HfO2 dataset with ACE","title":"Fit a-HfO2 dataset with ACE","text":"Plot and save force results.","category":"page"},{"location":"generated/ACE-aHfO2/fit-ace-ahfo2/","page":"Fit a-HfO2 dataset with ACE","title":"Fit a-HfO2 dataset with ACE","text":"f_plot = plot_forces(f_train, f_train_pred,\n f_test, f_test_pred)\n@save_fig res_path f_plot\nDisplayAs.PNG(f_plot)","category":"page"},{"location":"generated/ACE-aHfO2/fit-ace-ahfo2/","page":"Fit a-HfO2 dataset with ACE","title":"Fit a-HfO2 dataset with ACE","text":"Plot and save training force cosine.","category":"page"},{"location":"generated/ACE-aHfO2/fit-ace-ahfo2/","page":"Fit a-HfO2 dataset with ACE","title":"Fit a-HfO2 dataset with ACE","text":"e_train_plot = plot_energy(e_train, e_train_pred)\nf_train_plot = plot_forces(f_train, f_train_pred)\nf_train_cos = plot_cos(f_train, f_train_pred)\n@save_fig res_path e_train_plot\n@save_fig res_path f_train_plot\n@save_fig res_path f_train_cos\nDisplayAs.PNG(f_train_cos)","category":"page"},{"location":"generated/ACE-aHfO2/fit-ace-ahfo2/","page":"Fit a-HfO2 dataset with ACE","title":"Fit a-HfO2 dataset with ACE","text":"Plot and save test force cosine.","category":"page"},{"location":"generated/ACE-aHfO2/fit-ace-ahfo2/","page":"Fit a-HfO2 dataset with ACE","title":"Fit a-HfO2 dataset with ACE","text":"e_test_plot = plot_energy(e_test, e_test_pred)\nf_test_plot = plot_forces(f_test, f_test_pred)\nf_test_cos = plot_cos(f_test, f_test_pred)\n@save_fig res_path e_test_plot\n@save_fig res_path f_test_plot\n@save_fig res_path f_test_cos\nDisplayAs.PNG(f_test_cos)","category":"page"},{"location":"generated/ACE-aHfO2/fit-ace-ahfo2/","page":"Fit a-HfO2 dataset with ACE","title":"Fit a-HfO2 dataset with ACE","text":"","category":"page"},{"location":"generated/ACE-aHfO2/fit-ace-ahfo2/","page":"Fit a-HfO2 dataset with ACE","title":"Fit a-HfO2 dataset with ACE","text":"This page was generated using Literate.jl.","category":"page"},{"location":"generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/","page":"Subsample a-HfO2 dataset with DPP and fit with ACE","title":"Subsample a-HfO2 dataset with DPP and fit with ACE","text":"EditURL = \"../../../../examples/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2.jl\"","category":"page"},{"location":"generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/#Subsample-a-HfO2-dataset-and-fit-with-ACE","page":"Subsample a-HfO2 dataset with DPP and fit with ACE","title":"Subsample a-HfO2 dataset and fit with ACE","text":"","category":"section"},{"location":"generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/#Setup-experiment","page":"Subsample a-HfO2 dataset with DPP and fit with ACE","title":"Setup experiment","text":"","category":"section"},{"location":"generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/","page":"Subsample a-HfO2 dataset with DPP and fit with ACE","title":"Subsample a-HfO2 dataset with DPP and fit with ACE","text":"Load packages.","category":"page"},{"location":"generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/","page":"Subsample a-HfO2 dataset with DPP and fit with ACE","title":"Subsample a-HfO2 dataset with DPP and fit with ACE","text":"using AtomsBase, InteratomicPotentials, PotentialLearning\nusing Unitful, UnitfulAtomic\nusing LinearAlgebra, Random, DisplayAs","category":"page"},{"location":"generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/","page":"Subsample a-HfO2 dataset with DPP and fit with ACE","title":"Subsample a-HfO2 dataset with DPP and fit with ACE","text":"Define paths.","category":"page"},{"location":"generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/","page":"Subsample a-HfO2 dataset with DPP and fit with ACE","title":"Subsample a-HfO2 dataset with DPP and fit with ACE","text":"base_path = haskey(ENV, \"BASE_PATH\") ? ENV[\"BASE_PATH\"] : \"../../\"\nds_path = \"$base_path/examples/data/a-HfO2/a-HfO2-300K-NVT-6000.extxyz\"\nres_path = \"$base_path/examples/DPP-ACE-aHfO2-1/results/\";\nnothing #hide","category":"page"},{"location":"generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/","page":"Subsample a-HfO2 dataset with DPP and fit with ACE","title":"Subsample a-HfO2 dataset with DPP and fit with ACE","text":"Load utility functions.","category":"page"},{"location":"generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/","page":"Subsample a-HfO2 dataset with DPP and fit with ACE","title":"Subsample a-HfO2 dataset with DPP and fit with ACE","text":"include(\"$base_path/examples/utils/utils.jl\");\nnothing #hide","category":"page"},{"location":"generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/","page":"Subsample a-HfO2 dataset with DPP and fit with ACE","title":"Subsample a-HfO2 dataset with DPP and fit with ACE","text":"Create experiment folder.","category":"page"},{"location":"generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/","page":"Subsample a-HfO2 dataset with DPP and fit with ACE","title":"Subsample a-HfO2 dataset with DPP and fit with ACE","text":"run(`mkdir -p $res_path`);\nnothing #hide","category":"page"},{"location":"generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/#Load-datasets","page":"Subsample a-HfO2 dataset with DPP and fit with ACE","title":"Load datasets","text":"","category":"section"},{"location":"generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/","page":"Subsample a-HfO2 dataset with DPP and fit with ACE","title":"Subsample a-HfO2 dataset with DPP and fit with ACE","text":"Load atomistic dataset: atomistic configurations (atom positions, geometry, etc.) + DFT data (energies, forces, etc.)","category":"page"},{"location":"generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/","page":"Subsample a-HfO2 dataset with DPP and fit with ACE","title":"Subsample a-HfO2 dataset with DPP and fit with ACE","text":"ds = load_data(ds_path, uparse(\"eV\"), uparse(\"Å\"))[1:1000]; # Load first 1K samples.\nnothing #hide","category":"page"},{"location":"generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/","page":"Subsample a-HfO2 dataset with DPP and fit with ACE","title":"Subsample a-HfO2 dataset with DPP and fit with ACE","text":"Split atomistic dataset into training and test","category":"page"},{"location":"generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/","page":"Subsample a-HfO2 dataset with DPP and fit with ACE","title":"Subsample a-HfO2 dataset with DPP and fit with ACE","text":"n_train, n_test = 100, 50 # Few samples per dataset are used in this example.\nconf_train, conf_test = split(ds, n_train, n_test)","category":"page"},{"location":"generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/#Subsample-dataset","page":"Subsample a-HfO2 dataset with DPP and fit with ACE","title":"Subsample dataset","text":"","category":"section"},{"location":"generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/","page":"Subsample a-HfO2 dataset with DPP and fit with ACE","title":"Subsample a-HfO2 dataset with DPP and fit with ACE","text":"Compute ACE descriptors for energies to be used as subsampling input.","category":"page"},{"location":"generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/","page":"Subsample a-HfO2 dataset with DPP and fit with ACE","title":"Subsample a-HfO2 dataset with DPP and fit with ACE","text":"basis = ACE(species = [:Hf, :O],\n body_order = 2,\n polynomial_degree = 3,\n rcutoff = 5.0,\n wL = 1.0,\n csp = 1.0,\n r0 = 1.0)\ne_descr = compute_local_descriptors(conf_train,\n basis,\n pbar = false);\nnothing #hide","category":"page"},{"location":"generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/","page":"Subsample a-HfO2 dataset with DPP and fit with ACE","title":"Subsample a-HfO2 dataset with DPP and fit with ACE","text":"Update subsampling dataset.","category":"page"},{"location":"generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/","page":"Subsample a-HfO2 dataset with DPP and fit with ACE","title":"Subsample a-HfO2 dataset with DPP and fit with ACE","text":"conf_train_kDPP = DataSet(conf_train .+ e_descr);\nnothing #hide","category":"page"},{"location":"generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/","page":"Subsample a-HfO2 dataset with DPP and fit with ACE","title":"Subsample a-HfO2 dataset with DPP and fit with ACE","text":"Create DPP subselector.","category":"page"},{"location":"generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/","page":"Subsample a-HfO2 dataset with DPP and fit with ACE","title":"Subsample a-HfO2 dataset with DPP and fit with ACE","text":"dataset_selector = kDPP( conf_train_kDPP,\n GlobalMean(),\n DotProduct();\n batch_size = 50)","category":"page"},{"location":"generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/","page":"Subsample a-HfO2 dataset with DPP and fit with ACE","title":"Subsample a-HfO2 dataset with DPP and fit with ACE","text":"Subsample trainig dataset.","category":"page"},{"location":"generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/","page":"Subsample a-HfO2 dataset with DPP and fit with ACE","title":"Subsample a-HfO2 dataset with DPP and fit with ACE","text":"inds = get_random_subset(dataset_selector)\nconf_train = @views conf_train[inds];\nnothing #hide","category":"page"},{"location":"generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/#Compute-descriptors","page":"Subsample a-HfO2 dataset with DPP and fit with ACE","title":"Compute descriptors","text":"","category":"section"},{"location":"generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/","page":"Subsample a-HfO2 dataset with DPP and fit with ACE","title":"Subsample a-HfO2 dataset with DPP and fit with ACE","text":"Create ACE basis.","category":"page"},{"location":"generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/","page":"Subsample a-HfO2 dataset with DPP and fit with ACE","title":"Subsample a-HfO2 dataset with DPP and fit with ACE","text":"basis = ACE(species = [:Hf, :O],\n body_order = 3,\n polynomial_degree = 4,\n rcutoff = 5.0,\n wL = 1.0,\n csp = 1.0,\n r0 = 1.0)\n@save_var res_path basis;\nnothing #hide","category":"page"},{"location":"generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/","page":"Subsample a-HfO2 dataset with DPP and fit with ACE","title":"Subsample a-HfO2 dataset with DPP and fit with ACE","text":"Compute ACE descriptors for energy and forces based on the atomistic training configurations.","category":"page"},{"location":"generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/","page":"Subsample a-HfO2 dataset with DPP and fit with ACE","title":"Subsample a-HfO2 dataset with DPP and fit with ACE","text":"println(\"Computing energy descriptors of training dataset...\")\ne_descr_train = compute_local_descriptors(conf_train, basis;\n pbar=false)\nprintln(\"Computing force descriptors of training dataset...\")\nf_descr_train = compute_force_descriptors(conf_train, basis;\n pbar=false)","category":"page"},{"location":"generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/","page":"Subsample a-HfO2 dataset with DPP and fit with ACE","title":"Subsample a-HfO2 dataset with DPP and fit with ACE","text":"Update training dataset by adding energy and force descriptors.","category":"page"},{"location":"generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/","page":"Subsample a-HfO2 dataset with DPP and fit with ACE","title":"Subsample a-HfO2 dataset with DPP and fit with ACE","text":"ds_train = DataSet(conf_train .+ e_descr_train .+ f_descr_train);\nnothing #hide","category":"page"},{"location":"generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/#Learn-coefficients","page":"Subsample a-HfO2 dataset with DPP and fit with ACE","title":"Learn coefficients","text":"","category":"section"},{"location":"generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/","page":"Subsample a-HfO2 dataset with DPP and fit with ACE","title":"Subsample a-HfO2 dataset with DPP and fit with ACE","text":"Learn ACE coefficients based on ACE descriptors and DFT data.","category":"page"},{"location":"generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/","page":"Subsample a-HfO2 dataset with DPP and fit with ACE","title":"Subsample a-HfO2 dataset with DPP and fit with ACE","text":"println(\"Learning energies and forces...\")\nlb = LBasisPotential(basis)\nws, int = [1.0, 1.0], false\nlearn!(lb, ds_train, ws, int)\n@save_var res_path lb.β\n@save_var res_path lb.β0\nlb.β, lb.β0","category":"page"},{"location":"generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/#Post-process-results","page":"Subsample a-HfO2 dataset with DPP and fit with ACE","title":"Post-process results","text":"","category":"section"},{"location":"generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/","page":"Subsample a-HfO2 dataset with DPP and fit with ACE","title":"Subsample a-HfO2 dataset with DPP and fit with ACE","text":"Compute ACE descriptors for energy and forces based on the atomistic test configurations.","category":"page"},{"location":"generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/","page":"Subsample a-HfO2 dataset with DPP and fit with ACE","title":"Subsample a-HfO2 dataset with DPP and fit with ACE","text":"println(\"Computing energy descriptors of test dataset...\")\ne_descr_test = compute_local_descriptors(conf_test, basis;\n pbar = false)\nprintln(\"Computing force descriptors of test dataset...\")\nf_descr_test = compute_force_descriptors(conf_test, basis;\n pbar = false);\nnothing #hide","category":"page"},{"location":"generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/","page":"Subsample a-HfO2 dataset with DPP and fit with ACE","title":"Subsample a-HfO2 dataset with DPP and fit with ACE","text":"Update test dataset by adding energy and force descriptors.","category":"page"},{"location":"generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/","page":"Subsample a-HfO2 dataset with DPP and fit with ACE","title":"Subsample a-HfO2 dataset with DPP and fit with ACE","text":"ds_test = DataSet(conf_test .+ e_descr_test .+ f_descr_test);\nnothing #hide","category":"page"},{"location":"generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/","page":"Subsample a-HfO2 dataset with DPP and fit with ACE","title":"Subsample a-HfO2 dataset with DPP and fit with ACE","text":"Get and save true and predicted values for energies and forces.","category":"page"},{"location":"generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/","page":"Subsample a-HfO2 dataset with DPP and fit with ACE","title":"Subsample a-HfO2 dataset with DPP and fit with ACE","text":"n_atoms_train = length.(get_system.(ds_train))\nn_atoms_test = length.(get_system.(ds_test))\n\ne_train, e_train_pred = get_all_energies(ds_train) ./ n_atoms_train,\n get_all_energies(ds_train, lb) ./ n_atoms_train\nf_train, f_train_pred = get_all_forces(ds_train),\n get_all_forces(ds_train, lb)\n@save_var res_path e_train\n@save_var res_path e_train_pred\n@save_var res_path f_train\n@save_var res_path f_train_pred\n\ne_test, e_test_pred = get_all_energies(ds_test) ./ n_atoms_test,\n get_all_energies(ds_test, lb) ./ n_atoms_test\nf_test, f_test_pred = get_all_forces(ds_test),\n get_all_forces(ds_test, lb)\n@save_var res_path e_test\n@save_var res_path e_test_pred\n@save_var res_path f_test\n@save_var res_path f_test_pred;\nnothing #hide","category":"page"},{"location":"generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/","page":"Subsample a-HfO2 dataset with DPP and fit with ACE","title":"Subsample a-HfO2 dataset with DPP and fit with ACE","text":"Compute and save training metrics.","category":"page"},{"location":"generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/","page":"Subsample a-HfO2 dataset with DPP and fit with ACE","title":"Subsample a-HfO2 dataset with DPP and fit with ACE","text":"e_train_metrics = get_metrics(e_train, e_train_pred,\n metrics = [mae, rmse, rsq],\n label = \"e_train\")\nf_train_metrics = get_metrics(f_train, f_train_pred,\n metrics = [mae, rmse, rsq, mean_cos],\n label = \"f_train\")\ntrain_metrics = merge(e_train_metrics, f_train_metrics)\n@save_dict res_path train_metrics\ntrain_metrics","category":"page"},{"location":"generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/","page":"Subsample a-HfO2 dataset with DPP and fit with ACE","title":"Subsample a-HfO2 dataset with DPP and fit with ACE","text":"Compute and save test metrics.","category":"page"},{"location":"generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/","page":"Subsample a-HfO2 dataset with DPP and fit with ACE","title":"Subsample a-HfO2 dataset with DPP and fit with ACE","text":"e_test_metrics = get_metrics(e_test, e_test_pred,\n metrics = [mae, rmse, rsq],\n label = \"e_test\")\nf_test_metrics = get_metrics(f_test, f_test_pred,\n metrics = [mae, rmse, rsq, mean_cos],\n label = \"f_test\")\ntest_metrics = merge(e_test_metrics, f_test_metrics)\n@save_dict res_path test_metrics\ntest_metrics","category":"page"},{"location":"generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/","page":"Subsample a-HfO2 dataset with DPP and fit with ACE","title":"Subsample a-HfO2 dataset with DPP and fit with ACE","text":"Plot and save energy results.","category":"page"},{"location":"generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/","page":"Subsample a-HfO2 dataset with DPP and fit with ACE","title":"Subsample a-HfO2 dataset with DPP and fit with ACE","text":"e_plot = plot_energy(e_train, e_train_pred,\n e_test, e_test_pred)\n@save_fig res_path e_plot\nDisplayAs.PNG(e_plot)","category":"page"},{"location":"generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/","page":"Subsample a-HfO2 dataset with DPP and fit with ACE","title":"Subsample a-HfO2 dataset with DPP and fit with ACE","text":"Plot and save force results.","category":"page"},{"location":"generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/","page":"Subsample a-HfO2 dataset with DPP and fit with ACE","title":"Subsample a-HfO2 dataset with DPP and fit with ACE","text":"f_plot = plot_forces(f_train, f_train_pred,\n f_test, f_test_pred)\n@save_fig res_path f_plot\nDisplayAs.PNG(f_plot)","category":"page"},{"location":"generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/","page":"Subsample a-HfO2 dataset with DPP and fit with ACE","title":"Subsample a-HfO2 dataset with DPP and fit with ACE","text":"Plot and save training force cosine.","category":"page"},{"location":"generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/","page":"Subsample a-HfO2 dataset with DPP and fit with ACE","title":"Subsample a-HfO2 dataset with DPP and fit with ACE","text":"e_train_plot = plot_energy(e_train, e_train_pred)\nf_train_plot = plot_forces(f_train, f_train_pred)\nf_train_cos = plot_cos(f_train, f_train_pred)\n@save_fig res_path e_train_plot\n@save_fig res_path f_train_plot\n@save_fig res_path f_train_cos\nDisplayAs.PNG(f_train_cos)","category":"page"},{"location":"generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/","page":"Subsample a-HfO2 dataset with DPP and fit with ACE","title":"Subsample a-HfO2 dataset with DPP and fit with ACE","text":"Plot and save test force cosine.","category":"page"},{"location":"generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/","page":"Subsample a-HfO2 dataset with DPP and fit with ACE","title":"Subsample a-HfO2 dataset with DPP and fit with ACE","text":"e_test_plot = plot_energy(e_test, e_test_pred)\nf_test_plot = plot_forces(f_test, f_test_pred)\nf_test_cos = plot_cos(f_test, f_test_pred)\n@save_fig res_path e_test_plot\n@save_fig res_path f_test_plot\n@save_fig res_path f_test_cos\nDisplayAs.PNG(f_test_cos)","category":"page"},{"location":"generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/","page":"Subsample a-HfO2 dataset with DPP and fit with ACE","title":"Subsample a-HfO2 dataset with DPP and fit with ACE","text":"","category":"page"},{"location":"generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/","page":"Subsample a-HfO2 dataset with DPP and fit with ACE","title":"Subsample a-HfO2 dataset with DPP and fit with ACE","text":"This page was generated using Literate.jl.","category":"page"},{"location":"api/#API-Reference","page":"API","title":"API Reference","text":"","category":"section"},{"location":"api/","page":"API","title":"API","text":"This page provides a list of all documented types and functions and in PotentialLearning.jl.","category":"page"},{"location":"api/","page":"API","title":"API","text":"Modules = [PotentialLearning]\nOrder = [:type, :function, :constant]","category":"page"},{"location":"api/#PotentialLearning.ActiveSubspace","page":"API","title":"PotentialLearning.ActiveSubspace","text":"ActiveSubspace{T<:Real} <: DimensionReducer\n Q :: Function \n ∇Q :: Function (gradient of Q)\n tol :: T\n\nUse 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.\n\n\n\n\n\n","category":"type"},{"location":"api/#PotentialLearning.AtomicData","page":"API","title":"PotentialLearning.AtomicData","text":"AtomicData <: Data\n\nAbstract type declaring the type of information that is unique to a particular atom (instead of a whole configuration).\n\n\n\n\n\n","category":"type"},{"location":"api/#PotentialLearning.Configuration-Tuple{Vararg{Union{ConfigurationData, AtomsBase.FlexibleSystem}}}","page":"API","title":"PotentialLearning.Configuration","text":"Configuration(data::Union{AtomsBase.FlexibleSystem, ConfigurationData} )\n\nA 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) '''\n\nConfigurations 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 '''\n\n\n\n\n\n","category":"method"},{"location":"api/#PotentialLearning.ConfigurationData","page":"API","title":"PotentialLearning.ConfigurationData","text":"ConfigurationData <: Data\n\nAbstract type declaring the type of data that is unique to a particular configuration (instead of just an atom).\n\n\n\n\n\n","category":"type"},{"location":"api/#PotentialLearning.CorrelationMatrix","page":"API","title":"PotentialLearning.CorrelationMatrix","text":"CorrelationMatrix \n α :: Vector{Float64} # weights\n\nCorrelationMatrix 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). \n\n\n\n\n\n","category":"type"},{"location":"api/#PotentialLearning.CovariateLinearProblem","page":"API","title":"PotentialLearning.CovariateLinearProblem","text":"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\n\nA 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 Σ. \n\n\n\n\n\n","category":"type"},{"location":"api/#PotentialLearning.DBSCANSelector","page":"API","title":"PotentialLearning.DBSCANSelector","text":"struct DBSCANSelector <: SubsetSelector\n clusters\n eps\n minpts\n sample_size\nend\n\nDefinition of the type DBSCANSelector, a subselector based on the clustering method DBSCAN.\n\n\n\n\n\n","category":"type"},{"location":"api/#PotentialLearning.DBSCANSelector-Tuple{DataSet, Any, Any, Any}","page":"API","title":"PotentialLearning.DBSCANSelector","text":"function DBSCANSelector(\n ds::DataSet,\n eps,\n minpts,\n sample_size\n)\n\nConstructor of DBSCANSelector based on the atomic configurations in ds, the DBSCAN params eps and minpts, and the sample size sample_size.\n\n\n\n\n\n","category":"method"},{"location":"api/#PotentialLearning.Data","page":"API","title":"PotentialLearning.Data","text":"Data\n\nAbstract supertype of ConfigurationData.\n\n\n\n\n\n","category":"type"},{"location":"api/#PotentialLearning.DataBase","page":"API","title":"PotentialLearning.DataBase","text":"DataBase\n\nAbstract type for DataSets. \n\n\n\n\n\n","category":"type"},{"location":"api/#PotentialLearning.DataSet","page":"API","title":"PotentialLearning.DataSet","text":"DataSet\n\nStruct that holds vector of configuration. Most operations in PotentialLearning are built around the DataSet structure.\n\n\n\n\n\n","category":"type"},{"location":"api/#PotentialLearning.Distance","page":"API","title":"PotentialLearning.Distance","text":"Distance\n\nA 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.\n\n\n\n\n\n","category":"type"},{"location":"api/#PotentialLearning.Divergence","page":"API","title":"PotentialLearning.Divergence","text":"Divergence\n\nA 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.\n\n\n\n\n\n","category":"type"},{"location":"api/#PotentialLearning.DotProduct","page":"API","title":"PotentialLearning.DotProduct","text":"DotProduct <: Kernel \n α :: Power of DotProduct kernel \n\n\nComputes the dot product kernel between two features, i.e.,\n\ncos(θ) = ( A ⋅ B / (||A||^2||B||^2) )^α\n\n\n\n\n\n","category":"type"},{"location":"api/#PotentialLearning.Energy","page":"API","title":"PotentialLearning.Energy","text":"Energy <: ConfigurationData\n d :: Real\n u :: Unitful.FreeUnits\n\nConvenience struct that holds energy information (and corresponding units). Default unit is eV\n\n\n\n\n\n","category":"type"},{"location":"api/#PotentialLearning.Euclidean","page":"API","title":"PotentialLearning.Euclidean","text":"Euclidean <: Distance \n Cinv :: Covariance Matrix \n\nComputes the squared euclidean distance with weight matrix Cinv, the inverse of some covariance matrix.\n\n\n\n\n\n","category":"type"},{"location":"api/#PotentialLearning.ExtXYZ","page":"API","title":"PotentialLearning.ExtXYZ","text":"ExtXYZ <: IO\n\n\n\n\n\n","category":"type"},{"location":"api/#PotentialLearning.Feature","page":"API","title":"PotentialLearning.Feature","text":"Feature\n\nA 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. \n\n\n\n\n\n","category":"type"},{"location":"api/#PotentialLearning.Force","page":"API","title":"PotentialLearning.Force","text":"Force <: AtomicData \n f :: Vector{<:Real}\n u :: Unitful.FreeUnits\n\nContains the force with (x,y,z)-components in f with units u. Default unit is \"eV/Å\". \n\n\n\n\n\n","category":"type"},{"location":"api/#PotentialLearning.ForceDescriptor","page":"API","title":"PotentialLearning.ForceDescriptor","text":"ForceDescriptor <: AtomicData\n b :: Vector{<:Vector{<:Real}}\n\nContains the x,y,z components (out vector) of the force descriptor (inner vector).\n\n\n\n\n\n","category":"type"},{"location":"api/#PotentialLearning.ForceDescriptors","page":"API","title":"PotentialLearning.ForceDescriptors","text":"ForceDescriptors <: ConfigurationData\n b :: Vector{ForceDescriptor}\n\nA container holding all of the ForceDescriptors for all atoms in a configuration.\n\n\n\n\n\n","category":"type"},{"location":"api/#PotentialLearning.Forces","page":"API","title":"PotentialLearning.Forces","text":"Forces <: ConfigurationData\n f :: Vector{force}\n\nForces is a struct that contains all force information in a configuration.\n\n\n\n\n\n","category":"type"},{"location":"api/#PotentialLearning.Forstner","page":"API","title":"PotentialLearning.Forstner","text":"Forstner <: Distance \n α :: Regularization parameter\n\nComputes the squared Forstner distance between two positive semi-definite matrices.\n\n\n\n\n\n","category":"type"},{"location":"api/#PotentialLearning.GlobalMean","page":"API","title":"PotentialLearning.GlobalMean","text":" GlobalMean{T}\n\nGlobalMean produces the mean of the local descriptors.\n\n\n\n\n\n","category":"type"},{"location":"api/#PotentialLearning.GlobalSum","page":"API","title":"PotentialLearning.GlobalSum","text":" GlobalSum{T}\n\nGlobalSum produces the sum of the local descriptors.\n\n\n\n\n\n","category":"type"},{"location":"api/#PotentialLearning.InverseMultiquadric","page":"API","title":"PotentialLearning.InverseMultiquadric","text":"InverseMultiquadric <: Kernel \n d :: Distance function \n c2 :: Squared constant parameter\n ℓ :: Length-scale parameter\n\nComputes the inverse multiquadric (IMQ) kernel, i.e.,\n\n k(A, B) = (c^2 + d(A,B)/β^2)^{-1/2}\n\n\n\n\n\n","category":"type"},{"location":"api/#PotentialLearning.Kernel","page":"API","title":"PotentialLearning.Kernel","text":"Kernel\n\nA 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.\n\n\n\n\n\n","category":"type"},{"location":"api/#PotentialLearning.KernelSteinDiscrepancy","page":"API","title":"PotentialLearning.KernelSteinDiscrepancy","text":"KernelSteinDiscrepancy <: Divergence\n score :: Function\n knl :: Kernel\n\nComputes 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.\n\n\n\n\n\n","category":"type"},{"location":"api/#PotentialLearning.LAMMPS","page":"API","title":"PotentialLearning.LAMMPS","text":"struct LAMMPS <: IO\n elements :: Vector{Symbol}\n boundary_conditions :: Vector\nend\n\n\n\n\n\n","category":"type"},{"location":"api/#PotentialLearning.LearningProblem","page":"API","title":"PotentialLearning.LearningProblem","text":"struct LearningProblem{T<:Real} <: AbstractLearningProblem ds::DataSet logprob::Function ∇logprob::Function params::Vector{T} end\n\nGeneric 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).\n\n\n\n\n\n","category":"type"},{"location":"api/#PotentialLearning.LearningProblem-Union{Tuple{T}, Tuple{DataSet, Function, Vector{T}}} where T","page":"API","title":"PotentialLearning.LearningProblem","text":"function LearningProblem( ds::DataSet, logprob::Function, params::Vector{T} ) where {T}\n\nGeneric LearningProblem construnctor.\n\n\n\n\n\n","category":"method"},{"location":"api/#PotentialLearning.LinearProblem","page":"API","title":"PotentialLearning.LinearProblem","text":"abstract type LinearProblem{T<:Real} <: AbstractLearningProblem end\n\nAn abstract type to specify linear potential inference problems. \n\n\n\n\n\n","category":"type"},{"location":"api/#PotentialLearning.LinearProblem-Tuple{DataSet}","page":"API","title":"PotentialLearning.LinearProblem","text":"function LinearProblem( ds::DataSet; T = Float64 )\n\nConstruct 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).\n\n\n\n\n\n","category":"method"},{"location":"api/#PotentialLearning.LocalDescriptor","page":"API","title":"PotentialLearning.LocalDescriptor","text":"LocalDescriptor <: AtomicData\n\nA vector corresponding to the descriptor for a particular atom's neighborhood.\n\n\n\n\n\n","category":"type"},{"location":"api/#PotentialLearning.LocalDescriptors","page":"API","title":"PotentialLearning.LocalDescriptors","text":"LocalDescriptors <: ConfigurationData\n\nA vector of LocalDescriptor, which now should represent all local descriptors for atoms in a configuration.\n\n\n\n\n\n","category":"type"},{"location":"api/#PotentialLearning.PCA","page":"API","title":"PotentialLearning.PCA","text":"PCA <: DimensionReducer\n tol :: Float64\n\nUse SVD to compute the PCA of the design matrix of descriptors. (using Force descriptors TBA)\n\nIf 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.\n\n\n\n\n\n","category":"type"},{"location":"api/#PotentialLearning.PCAState","page":"API","title":"PotentialLearning.PCAState","text":"PCAState <: DimensionReducer\n tol :: Float64\n\nUse SVD to compute the PCA of the design matrix of descriptors.\n\nIf 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.\n\n\n\n\n\n","category":"type"},{"location":"api/#PotentialLearning.RBF","page":"API","title":"PotentialLearning.RBF","text":"RBF <: Kernel \n d :: Distance function \n α :: Regularization parameter \n ℓ :: Length-scale parameter\n β :: Scale parameter\n\n\nComputes the squared exponential kernel, i.e.,\n\n k(A, B) = β \u001bxp( -\frac{1}{2} d(A,B)/ℓ^2 ) + α δ(A, B)\n\n\n\n\n\n","category":"type"},{"location":"api/#PotentialLearning.RandomSelector","page":"API","title":"PotentialLearning.RandomSelector","text":"struct Random\n num_configs :: Int \n batch_size :: Int \nend\n\nA convenience function that allows the user to randomly select indices uniformly over [1, num_configs]. \n\n\n\n\n\n","category":"type"},{"location":"api/#PotentialLearning.UnivariateLinearProblem","page":"API","title":"PotentialLearning.UnivariateLinearProblem","text":"struct UnivariateLinearProblem{T<:Real} <: LinearProblem{T} ivdata::Vector dvdata::Vector β::Vector{T} β0::Vector{T} σ::Vector{T} Σ::Symmetric{T,Matrix{T}} end\n\nA 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. \n\n\n\n\n\n","category":"type"},{"location":"api/#PotentialLearning.YAML","page":"API","title":"PotentialLearning.YAML","text":"YAML <: IO\n energy_units :: Unitful.FreeUnits\n distance_units :: Unitful.FreeUnits\n\n\n\n\n\n","category":"type"},{"location":"api/#PotentialLearning.kDPP","page":"API","title":"PotentialLearning.kDPP","text":"struct kDPP\n K :: EllEnsemble\nend\n\nA 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. \n\n\n\n\n\n","category":"type"},{"location":"api/#PotentialLearning.kDPP-Tuple{DataSet, Feature, Kernel}","page":"API","title":"PotentialLearning.kDPP","text":"kDPP(ds::Dataset, f::Feature, k::Kernel)\n\nA 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).\n\n\n\n\n\n","category":"method"},{"location":"api/#PotentialLearning.kDPP-Union{Tuple{T}, Tuple{Union{Array{Vector{T}, 1}, Array{LinearAlgebra.Symmetric{T, Matrix{T}}, 1}}, Kernel}} where T","page":"API","title":"PotentialLearning.kDPP","text":"kDPP(features::Union{Vector{Vector{T}}, Vector{Symmetric{T, Matrix{T}}}}, k::Kernel)\n\nA 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)).\n\n\n\n\n\n","category":"method"},{"location":"api/#InteratomicPotentials.compute_force_descriptors-Tuple{DataSet, InteratomicPotentials.BasisSystem}","page":"API","title":"InteratomicPotentials.compute_force_descriptors","text":"function computeforcedescriptors( ds::DataSet, basis::BasisSystem; pbar = true )\n\nCompute force descriptors of a basis system and dataset using threads.\n\n\n\n\n\n","category":"method"},{"location":"api/#InteratomicPotentials.compute_local_descriptors-Tuple{DataSet, InteratomicPotentials.BasisSystem}","page":"API","title":"InteratomicPotentials.compute_local_descriptors","text":"function computelocaldescriptors( ds::DataSet, basis::BasisSystem; pbar = true )\n\nds: dataset. basis: basis system (e.g. ACE) pbar: progress bar\n\nCompute local descriptors of a basis system and dataset using threads.\n\n\n\n\n\n","category":"method"},{"location":"api/#PotentialLearning.KernelMatrix-Tuple{DataSet, DataSet, Feature, Kernel}","page":"API","title":"PotentialLearning.KernelMatrix","text":"KernelMatrix(ds1::DataSet, ds2::DataSet, F::Feature, k::Kernel)\n\nCompute nonsymmetric kernel matrix K using features of the datasets ds1 and ds2 calculated using the Feature method F.\n\n\n\n\n\n","category":"method"},{"location":"api/#PotentialLearning.KernelMatrix-Tuple{DataSet, Feature, Kernel}","page":"API","title":"PotentialLearning.KernelMatrix","text":"KernelMatrix(ds::DataSet, F::Feature, k::Kernel)\n\nCompute symmetric kernel matrix K using features of the dataset ds calculated using the Feature method F. \n\n\n\n\n\n","category":"method"},{"location":"api/#PotentialLearning.KernelMatrix-Union{Tuple{T}, Tuple{Union{Array{Vector{T}, 1}, Array{LinearAlgebra.Symmetric{T, Matrix{T}}, 1}}, Kernel}} where T","page":"API","title":"PotentialLearning.KernelMatrix","text":"KernelMatrix(F, k::Kernel)\n\nCompute symmetric kernel matrix K where K{ij} = k(Fi, F_j). \n\n\n\n\n\n","category":"method"},{"location":"api/#PotentialLearning.KernelMatrix-Union{Tuple{T}, Tuple{Union{Array{Vector{T}, 1}, Array{LinearAlgebra.Symmetric{T, Matrix{T}}, 1}}, Union{Array{Vector{T}, 1}, Array{LinearAlgebra.Symmetric{T, Matrix{T}}, 1}}, Kernel}} where T","page":"API","title":"PotentialLearning.KernelMatrix","text":"KernelMatrix(F1, F2, k::Kernel)\n\nCompute non-symmetric kernel matrix K where K{ij} = k(F1i, F2_j). \n\n\n\n\n\n","category":"method"},{"location":"api/#PotentialLearning.calc_centroid-Tuple{Matrix{Float64}}","page":"API","title":"PotentialLearning.calc_centroid","text":"function calc_centroid(\n m::Array{Float64,2}\n)\n\nCalculate a centroid of a matrix.\n\n\n\n\n\n","category":"method"},{"location":"api/#PotentialLearning.calc_metrics-Tuple{Any, Any}","page":"API","title":"PotentialLearning.calc_metrics","text":"calc_metrics(x_pred, x)\n\nx_pred: vector of predicted values of a variable. E.g. energy. x: vector of true values of a variable. E.g. energy.\n\nReturns MAE, RMSE, and RSQ.\n\n\n\n\n\n","category":"method"},{"location":"api/#PotentialLearning.compute_distance-Union{Tuple{T}, Tuple{Vector{T}, Vector{T}, Euclidean}} where T<:Real","page":"API","title":"PotentialLearning.compute_distance","text":"compute_distance(A, B, d)\n\nCompute the distance between features A and B using distance metric d. \n\n\n\n\n\n","category":"method"},{"location":"api/#PotentialLearning.compute_features-Tuple{DataSet, Feature}","page":"API","title":"PotentialLearning.compute_features","text":"compute_feature(ds::DataSet, f::Feature; dt = LocalDescriptors)\n\nComputes features of the dataset ds using the feature method F on descriptors dt (default option are the LocalDescriptors, if available).\n\n\n\n\n\n","category":"method"},{"location":"api/#PotentialLearning.compute_gradx_distance-Union{Tuple{T}, Tuple{T, T, Euclidean}} where T<:(Vector{<:Real})","page":"API","title":"PotentialLearning.compute_gradx_distance","text":"compute_gradx_distance(A, B, d)\n\nCompute gradient of the distance between features A and B using distance metric d, with respect to the first argument (A). \n\n\n\n\n\n","category":"method"},{"location":"api/#PotentialLearning.compute_gradx_kernel-Union{Tuple{T}, Tuple{T, T, RBF}} where T<:(Vector{<:Real})","page":"API","title":"PotentialLearning.compute_gradx_kernel","text":"compute_gradx_kernel(A, B, k)\n\nCompute gradient of the kernel between features A and B using kernel k, with respect to the first argument (A). \n\n\n\n\n\n","category":"method"},{"location":"api/#PotentialLearning.compute_gradxy_distance-Union{Tuple{T}, Tuple{T, T, Euclidean}} where T<:(Vector{<:Real})","page":"API","title":"PotentialLearning.compute_gradxy_distance","text":"compute_gradxy_distance(A, B, d)\n\nCompute second-order cross derivative of the distance between features A and B using distance metric d. \n\n\n\n\n\n","category":"method"},{"location":"api/#PotentialLearning.compute_gradxy_kernel-Union{Tuple{T}, Tuple{T, T, RBF}} where T<:(Vector{<:Real})","page":"API","title":"PotentialLearning.compute_gradxy_kernel","text":"compute_gradxy_kernel(A, B, k)\n\nCompute the second-order cross derivative of the kernel between features A and B using kernel k. \n\n\n\n\n\n","category":"method"},{"location":"api/#PotentialLearning.compute_grady_distance-Union{Tuple{T}, Tuple{T, T, Euclidean}} where T<:(Vector{<:Real})","page":"API","title":"PotentialLearning.compute_grady_distance","text":"compute_grady_distance(A, B, d)\n\nCompute gradient of the distance between features A and B using distance metric d, with respect to the second argument (B). \n\n\n\n\n\n","category":"method"},{"location":"api/#PotentialLearning.compute_grady_kernel-Union{Tuple{T}, Tuple{T, T, RBF}} where T<:(Vector{<:Real})","page":"API","title":"PotentialLearning.compute_grady_kernel","text":"compute_grady_kernel(A, B, k)\n\nCompute gradient of the kernel between features A and B using kernel k, with respect to the second argument (B). \n\n\n\n\n\n","category":"method"},{"location":"api/#PotentialLearning.compute_kernel-Union{Tuple{T}, Tuple{T, T, RBF}} where T<:Union{LinearAlgebra.Symmetric{<:Real, <:Matrix{<:Real}}, Vector{<:Real}}","page":"API","title":"PotentialLearning.compute_kernel","text":"compute_kernel(A, B, k)\n\nCompute similarity kernel between features A and B using kernel k. \n\n\n\n\n\n","category":"method"},{"location":"api/#PotentialLearning.distance_matrix_kabsch-Tuple{DataSet}","page":"API","title":"PotentialLearning.distance_matrix_kabsch","text":"function distance_matrix_kabsch(\n ds::DataSet\n)\n\nCalculate a matrix of distances between atomic configurations using KABSCH method.\n\n\n\n\n\n","category":"method"},{"location":"api/#PotentialLearning.distance_matrix_periodic-Tuple{DataSet}","page":"API","title":"PotentialLearning.distance_matrix_periodic","text":"function distance_matrix_periodic(\n ds::DataSet\n)\n\nCalculates a matrix of distances between atomic configurations taking into account the periodic boundaries.\n\n\n\n\n\n","category":"method"},{"location":"api/#PotentialLearning.fit","page":"API","title":"PotentialLearning.fit","text":"fit(ds::DataSet, dr::DimensionReducer)\n\nFits a linear dimension reduction routine using information from DataSet. See individual types of DimensionReducers for specific details.\n\n\n\n\n\n","category":"function"},{"location":"api/#PotentialLearning.fit-Tuple{DataSet, ActiveSubspace}","page":"API","title":"PotentialLearning.fit","text":"fit(ds::DataSet, as::ActiveSubspace)\n\nFits 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.\n\n\n\n\n\n","category":"method"},{"location":"api/#PotentialLearning.fit-Tuple{DataSet, PCA}","page":"API","title":"PotentialLearning.fit","text":"fit(ds::DataSet, pca::PCA)\n\nFits a linear dimension reduction routine using PCA on the global descriptors in the dataset ds. \n\n\n\n\n\n","category":"method"},{"location":"api/#PotentialLearning.fit_transform-Tuple{DataSet, DimensionReducer}","page":"API","title":"PotentialLearning.fit_transform","text":"fit_transform(ds::DataSet, dr::DimensionReducer)\n\nFits 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.\n\n\n\n\n\n","category":"method"},{"location":"api/#PotentialLearning.force-Tuple{Configuration, InteratomicPotentials.BasisPotential}","page":"API","title":"PotentialLearning.force","text":"function force( c::Configuration, bp::BasisPotential )\n\nc: atomic configuration. bp: basis potential.\n\n\n\n\n\n","category":"method"},{"location":"api/#PotentialLearning.force-Tuple{Configuration, InteratomicPotentials.NNBasisPotential}","page":"API","title":"PotentialLearning.force","text":"function force( c::Configuration, nnbp::NNBasisPotential )\n\nc: atomic configuration. nnbp: neural network basis potential.\n\n\n\n\n\n","category":"method"},{"location":"api/#PotentialLearning.get_all_energies-Tuple{DataSet, InteratomicPotentials.BasisPotential}","page":"API","title":"PotentialLearning.get_all_energies","text":"function get_all_energies(\n ds::DataSet,\n bp::BasisPotential\n)\n\nds: dataset. bp: basis potential.\n\n\n\n\n\n","category":"method"},{"location":"api/#PotentialLearning.get_all_energies-Tuple{DataSet}","page":"API","title":"PotentialLearning.get_all_energies","text":"function getallenergies( ds::DataSet )\n\nds: dataset.\n\n\n\n\n\n","category":"method"},{"location":"api/#PotentialLearning.get_all_forces-Tuple{DataSet, InteratomicPotentials.BasisPotential}","page":"API","title":"PotentialLearning.get_all_forces","text":"function getallforces( ds::DataSet, bp::BasisPotential )\n\nds: dataset. bp: basis potential.\n\n\n\n\n\n","category":"method"},{"location":"api/#PotentialLearning.get_all_forces-Tuple{DataSet}","page":"API","title":"PotentialLearning.get_all_forces","text":"function get_all_forces(\n ds::DataSet\n)\n\nds: dataset.\n\n\n\n\n\n","category":"method"},{"location":"api/#PotentialLearning.get_batches-NTuple{11, Any}","page":"API","title":"PotentialLearning.get_batches","text":"get_batches(n_batches, B_train, B_train_ext, e_train, dB_train, f_train,\n B_test, B_test_ext, e_test, dB_test, f_test)\n\nn_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.\n\nReturns the data loaders for training and test of energies and forces.\n\n\n\n\n\n","category":"method"},{"location":"api/#PotentialLearning.get_clusters-Tuple{Any, Any, Any}","page":"API","title":"PotentialLearning.get_clusters","text":"function get_clusters(\n ds,\n eps,\n minpts\n)\n\nComputes clusters from the configurations in ds using DBSCAN with parameters eps and minpts.\n\n\n\n\n\n","category":"method"},{"location":"api/#PotentialLearning.get_dpp_mode-Tuple{kDPP}","page":"API","title":"PotentialLearning.get_dpp_mode","text":"get_dpp_mode(dpp::kDPP, batch_size::Int) <: Vector{Int64}\n\nAccess an approximate mode of the k-DPP as calculated by a greedy subset algorithm. See Determinantal.jl for details.\n\n\n\n\n\n","category":"method"},{"location":"api/#PotentialLearning.get_energy-Tuple{Configuration}","page":"API","title":"PotentialLearning.get_energy","text":"get_energy(c::Configuration) <: Energy\n\nRetrieves the energy (if available) in the Configuration c. \n\n\n\n\n\n","category":"method"},{"location":"api/#PotentialLearning.get_force_descriptors-Tuple{Configuration}","page":"API","title":"PotentialLearning.get_force_descriptors","text":"get_force_descriptors(c::Configuration) <: ForceDescriptors\n\nRetrieves the force descriptors (if available) in the Configuration c. \n\n\n\n\n\n","category":"method"},{"location":"api/#PotentialLearning.get_forces-Tuple{Configuration}","page":"API","title":"PotentialLearning.get_forces","text":"get_forces(c::Configuration) <: Forces\n\nRetrieves the forces (if available) in the Configuration c. \n\n\n\n\n\n","category":"method"},{"location":"api/#PotentialLearning.get_inclusion_prob-Tuple{kDPP}","page":"API","title":"PotentialLearning.get_inclusion_prob","text":"get_inclusion_prob(dpp::kDPP) <: Vector{Float64}\n\nAccess an approximation to the inclusion probabilities as calculated by Determinantal.jl (see package for details).\n\n\n\n\n\n","category":"method"},{"location":"api/#PotentialLearning.get_input-Tuple{Any}","page":"API","title":"PotentialLearning.get_input","text":"get_input(args)\n\nargs: vector of arguments (strings)\n\nReturns an OrderedDict with the arguments. See https://github.com/cesmix-mit/AtomisticComposableWorkflows documentation for information about how to define the input arguments.\n\n\n\n\n\n","category":"method"},{"location":"api/#PotentialLearning.get_local_descriptors-Tuple{Configuration}","page":"API","title":"PotentialLearning.get_local_descriptors","text":"get_local_descriptors(c::Configuration) <: LocalDescriptors\n\nRetrieves the local descriptors (if available) in the Configuration c. \n\n\n\n\n\n","category":"method"},{"location":"api/#PotentialLearning.get_metrics-NTuple{11, Any}","page":"API","title":"PotentialLearning.get_metrics","text":"get_metrics( e_train_pred, e_train, f_train_pred, f_train,\n e_test_pred, e_test, f_test_pred, f_test,\n B_time, dB_time, time_fitting)\n\ne_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.\n\nComputes 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.\n\n\n\n\n\n","category":"method"},{"location":"api/#PotentialLearning.get_metrics-NTuple{4, Any}","page":"API","title":"PotentialLearning.get_metrics","text":"get_metrics( e_train_pred, e_train, e_test_pred, e_test)\n\ne_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.\n\nComputes MAE, RMSE, and RSQ for training and testing energies. Returns an OrderedDict with the information above.\n\n\n\n\n\n","category":"method"},{"location":"api/#PotentialLearning.get_metrics-Tuple{Any, Any}","page":"API","title":"PotentialLearning.get_metrics","text":"get_metrics(\n x_pred,\n x;\n metrics = [mae, rmse, rsq],\n label = \"x\"\n)\n\nx_pred: vector of predicted forces, x: vector of true forces. metrics: vector of metrics. label: label used as prefix in dictionary keys.\n\nReturns and OrderedDict with different metrics.\n\n\n\n\n\n","category":"method"},{"location":"api/#PotentialLearning.get_positions-Tuple{Configuration}","page":"API","title":"PotentialLearning.get_positions","text":"get_positions(c::Configuration) <: Vector{SVector}\n\nRetrieves the AtomsBase system positions (if available) in the Configuration c. \n\n\n\n\n\n","category":"method"},{"location":"api/#PotentialLearning.get_random_subset","page":"API","title":"PotentialLearning.get_random_subset","text":"function get_random_subset(\n s::DBSCANSelector,\n batch_size = s.sample_size\n)\n\nReturns a random subset of indexes composed of samples of size batch_size ÷ length(s.clusters) from each cluster in s.\n\n\n\n\n\n","category":"function"},{"location":"api/#PotentialLearning.get_random_subset-2","page":"API","title":"PotentialLearning.get_random_subset","text":"get_random_subset(r::Random, batch_size :: Int) <: Vector{Int64}\n\nAccess a random subset of the data as sampled from the provided k-DPP. Returns the indices of the random subset and the subset itself.\n\n\n\n\n\n","category":"function"},{"location":"api/#PotentialLearning.get_random_subset-Tuple{kDPP}","page":"API","title":"PotentialLearning.get_random_subset","text":"get_random_subset(dpp::kDPP, batch_size :: Int) <: Vector{Int64}\n\nAccess a random subset of the data as sampled from the provided k-DPP. Returns the indices of the random subset and the subset itself.\n\n\n\n\n\n","category":"method"},{"location":"api/#PotentialLearning.get_species-Tuple{DataSet}","page":"API","title":"PotentialLearning.get_species","text":"function get_species( ds::DataSet )\n\nGet species from a dataset.\n\n\n\n\n\n","category":"method"},{"location":"api/#PotentialLearning.get_system-Tuple{Configuration}","page":"API","title":"PotentialLearning.get_system","text":"get_system(c::Configuration) <: AtomsBase.AbstractSystem\n\nRetrieves the AtomsBase system (if available) in the Configuration c. \n\n\n\n\n\n","category":"method"},{"location":"api/#PotentialLearning.get_values-Tuple{Energy}","page":"API","title":"PotentialLearning.get_values","text":"get_values(e::Energy) <: Real\n\nGet the underlying real value (= e.d)\n\n\n\n\n\n","category":"method"},{"location":"api/#PotentialLearning.get_values-Tuple{StaticArraysCore.SVector}","page":"API","title":"PotentialLearning.get_values","text":"get_values(v::SVector)\n\nRemoves units from a position.\n\n\n\n\n\n","category":"method"},{"location":"api/#PotentialLearning.hyperlearn!-Tuple{DataType, OrderedCollections.OrderedDict, DataSet}","page":"API","title":"PotentialLearning.hyperlearn!","text":"function hyperlearn!( model::DataType, pars::OrderedDict, conftrain::DataSet; nsamples = 5, sampler = RandomSampler(), loss = loss, ws = [1.0, 1.0], int = true )\n\nHyper-parameter optimization of linear interatomic potentials.\n\n\n\n\n\n","category":"method"},{"location":"api/#PotentialLearning.hyperloss-Tuple{OrderedCollections.OrderedDict}","page":"API","title":"PotentialLearning.hyperloss","text":"function hyperloss( metrics::OrderedDict: we = 1.0, wf = 1.0, wt = 1.0E-3, emaemax = 0.05, fmae_max = 0.05 )\n\nmetrics: OrderedDict object with metrics of the fitting process. - Mean absolute error of energies: emae. - Mean absolute error of forces: fmae. - Time per force per atom: timeus. `we: energy weight.wf: force weight.wt: time weight.emaemax: maximum mean absolute error for energies.fmaemax`: maximum mean absolute error for forces.\n\nLoss function for hyper-parameter optimization: minimizes fitting error and time.\n\n\n\n\n\n","category":"method"},{"location":"api/#PotentialLearning.kabsch-Tuple{Matrix{Float64}, Matrix{Float64}}","page":"API","title":"PotentialLearning.kabsch","text":"function kabsch(\n reference::Array{Float64,2},\n coords::Array{Float64,2}\n)\n\nInput: two sets of points: reference, coords as Nx3 Matrices (so) Returns optimally rotated matrix \n\n\n\n\n\n","category":"method"},{"location":"api/#PotentialLearning.kabsch_rmsd-Tuple{Matrix{Float64}, Matrix{Float64}}","page":"API","title":"PotentialLearning.kabsch_rmsd","text":"function kabsch_rmsd(\n P::Array{Float64,2},\n Q::Array{Float64,2}\n)\n\nDirectly return RMSD for matrices P, Q for convenience.\n\n\n\n\n\n","category":"method"},{"location":"api/#PotentialLearning.learn!-Tuple{InteratomicPotentials.LinearBasisPotential, DataSet, Vararg{Any}}","page":"API","title":"PotentialLearning.learn!","text":"function learn!( iap::InteratomicPotentials.LinearBasisPotential, ds::DataSet, args... )\n\nLearning dispatch function, common to ordinary and weghted least squares implementations.\n\n\n\n\n\n","category":"method"},{"location":"api/#PotentialLearning.learn!-Tuple{PotentialLearning.CovariateLinearProblem, Real}","page":"API","title":"PotentialLearning.learn!","text":"function learn!( lp::CovariateLinearProblem, α::Real )\n\nFit 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)\n\nthrough an optimization procedure. \n\n\n\n\n\n","category":"method"},{"location":"api/#PotentialLearning.learn!-Tuple{PotentialLearning.CovariateLinearProblem, SubsetSelector, Real}","page":"API","title":"PotentialLearning.learn!","text":"function learn!( lp::CovariateLinearProblem, ss::SubsetSelector, α::Real; num_steps=100, opt=Flux.Optimise.Adam() )\n\nFit 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)\n\nthrough an iterative batch gradient descent optimization proceedure where the batches are provided by the subset selector. \n\n\n\n\n\n","category":"method"},{"location":"api/#PotentialLearning.learn!-Tuple{PotentialLearning.CovariateLinearProblem, Vector, Bool}","page":"API","title":"PotentialLearning.learn!","text":"function learn!( lp::CovariateLinearProblem, ws::Vector, int::Bool )\n\nFit energies and forces using weighted least squares.\n\n\n\n\n\n","category":"method"},{"location":"api/#PotentialLearning.learn!-Tuple{PotentialLearning.LearningProblem, SubsetSelector}","page":"API","title":"PotentialLearning.learn!","text":"function learn!( lp::LearningProblem, ss::SubsetSelector; num_steps = 100::Int, opt = Flux.Optimisers.Adam() )\n\nAttempts 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. \n\n\n\n\n\n","category":"method"},{"location":"api/#PotentialLearning.learn!-Tuple{PotentialLearning.LearningProblem}","page":"API","title":"PotentialLearning.learn!","text":"function learn!( lp::LearningProblem; num_steps=100::Int, opt=Flux.Optimisers.Adam() )\n\nAttempts to fit the parameters lp.params in the learning problem lp using gradient descent with the optimizer opt and num_steps number of iterations.\n\n\n\n\n\n","category":"method"},{"location":"api/#PotentialLearning.learn!-Tuple{PotentialLearning.LinearProblem}","page":"API","title":"PotentialLearning.learn!","text":"function learn!( lp::LinearProblem )\n\nDefault learning problem: weighted least squares.\n\n\n\n\n\n","category":"method"},{"location":"api/#PotentialLearning.learn!-Tuple{PotentialLearning.UnivariateLinearProblem, Real}","page":"API","title":"PotentialLearning.learn!","text":"function learn!( lp::UnivariateLinearProblem, α::Real )\n\nFit 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. \n\n\n\n\n\n","category":"method"},{"location":"api/#PotentialLearning.learn!-Tuple{PotentialLearning.UnivariateLinearProblem, SubsetSelector, Real}","page":"API","title":"PotentialLearning.learn!","text":"function learn!( lp::UnivariateLinearProblem, ss::SubsetSelector, α::Real; num_steps = 100, opt = Flux.Optimise.Adam() )\n\nFit 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. \n\n\n\n\n\n","category":"method"},{"location":"api/#PotentialLearning.learn!-Tuple{PotentialLearning.UnivariateLinearProblem, Vector, Bool}","page":"API","title":"PotentialLearning.learn!","text":"function learn!( lp::UnivariateLinearProblem, ws::Vector, int::Bool )\n\nFit energies using weighted least squares.\n\n\n\n\n\n","category":"method"},{"location":"api/#PotentialLearning.linearize_forces-Tuple{Any}","page":"API","title":"PotentialLearning.linearize_forces","text":"linearize_forces(forces)\n\nforces: vector of forces per system\n\nReturns a vector with the components of the forces of the systems.\n\n\n\n\n\n","category":"method"},{"location":"api/#PotentialLearning.load_data-Tuple{Any, ExtXYZ}","page":"API","title":"PotentialLearning.load_data","text":"load_data(file::string, extxyz::ExtXYZ)\nLoad configuration from an extxyz file into a DataSet\n\n\n\n\n\n","category":"method"},{"location":"api/#PotentialLearning.load_data-Tuple{String, YAML}","page":"API","title":"PotentialLearning.load_data","text":"load_data(file::string, yaml::YAML)\n\nLoad configurations from a yaml file into a Vector of Flexible Systems, with Energies and Force.\nReturns \n ds - DataSet\n t = Vector{Dict} (any miscellaneous info from yaml file)\n\n\n\n\n\n","category":"method"},{"location":"api/#PotentialLearning.load_datasets-Tuple{Any}","page":"API","title":"PotentialLearning.load_datasets","text":"load_datasets(input)\n\ninput: OrderedDict with input arguments. See get_defaults_args().\n\nReturns training and test systems, energies, forces, and stresses.\n\n\n\n\n\n","category":"method"},{"location":"api/#PotentialLearning.mae-Tuple{Any, Any}","page":"API","title":"PotentialLearning.mae","text":"mae(x_pred, x)\n\nx_pred: vector of predicted values. E.g. predicted energies. x: vector of true values. E.g. DFT energies.\n\nReturns mean absolute error.\n\n\n\n\n\n","category":"method"},{"location":"api/#PotentialLearning.mean_cos-Tuple{Any, Any}","page":"API","title":"PotentialLearning.mean_cos","text":"mean_cos(x_pred, x)\n\nx_pred: vector of predicted forces, x: vector of true forces.\n\nReturns mean cosine.\n\n\n\n\n\n","category":"method"},{"location":"api/#PotentialLearning.periodic_rmsd-Tuple{Matrix{Float64}, Matrix{Float64}, Vector{Float64}}","page":"API","title":"PotentialLearning.periodic_rmsd","text":"function periodic_rmsd(\n p1::Array{Float64,2},\n p2::Array{Float64,2},\n box_lengths::Array{Float64,1}\n)\n\nCalculates the RMSD between atom positions of two configurations taking into account the periodic boundaries.\n\n\n\n\n\n","category":"method"},{"location":"api/#PotentialLearning.potential_energy-Tuple{Configuration, InteratomicPotentials.BasisPotential}","page":"API","title":"PotentialLearning.potential_energy","text":"function potential_energy( c::Configuration, bp::BasisPotential )\n\nc: atomic configuration. bp: basis potential.\n\n\n\n\n\n","category":"method"},{"location":"api/#PotentialLearning.potential_energy-Tuple{Configuration, InteratomicPotentials.NNBasisPotential}","page":"API","title":"PotentialLearning.potential_energy","text":"function potential_energy( c::Configuration, nnbp::NNBasisPotential )\n\nc: atomic configuration. nnbp: neural network basis potential.\n\n\n\n\n\n","category":"method"},{"location":"api/#PotentialLearning.rmsd-Tuple{Matrix{Float64}, Matrix{Float64}}","page":"API","title":"PotentialLearning.rmsd","text":"function rmsd(\n A::Array{Float64,2},\n B::Array{Float64,2}\n)\n\nCalculate root mean square deviation of two matrices A, B. See http://en.wikipedia.org/wiki/Root-mean-squaredeviationofatomicpositions\n\n\n\n\n\n","category":"method"},{"location":"api/#PotentialLearning.rmse-Tuple{Any, Any}","page":"API","title":"PotentialLearning.rmse","text":"rmse(x_pred, x)\n\nx_pred: vector of predicted values. E.g. predicted energies. x: vector of true values. E.g. DFT energies.\n\nReturns mean root mean square error.\n\n\n\n\n\n","category":"method"},{"location":"api/#PotentialLearning.rsq-Tuple{Any, Any}","page":"API","title":"PotentialLearning.rsq","text":"rsq(x_pred, x)\n\nx_pred: vector of predicted values. E.g. predicted energies. x: vector of true values. E.g. DFT energies.\n\nReturns R-squared.\n\n\n\n\n\n","category":"method"},{"location":"api/#PotentialLearning.sample-Tuple{Any, Any}","page":"API","title":"PotentialLearning.sample","text":"function sample(\n c,\n batch_size\n)\n\nSelect from cluster c a sample of size batch_size.\n\n\n\n\n\n","category":"method"},{"location":"api/#PotentialLearning.to_num-Tuple{Any}","page":"API","title":"PotentialLearning.to_num","text":"to_num(str)\n\nstr: string with a number: integer or float\n\nReturns an integer or float.\n\n\n\n\n\n","category":"method"},{"location":"api/#PotentialLearning.translate_points-Tuple{Matrix{Float64}, Matrix{Float64}}","page":"API","title":"PotentialLearning.translate_points","text":"function translate_points(\n P::Array{Float64,2},\n Q::Array{Float64,2}\n)\n\nTranslate 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\n\n\n\n\n\n","category":"method"},{"location":"generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/","page":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","title":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","text":"EditURL = \"../../../../examples/PCA-ACE-aHfO2/fit-pca-ace-ahfo2.jl\"","category":"page"},{"location":"generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/#Reduce-ACE-descriptors-with-PCA-and-fit-a-HfO2-dataset","page":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","title":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","text":"","category":"section"},{"location":"generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/#Setup-experiment","page":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","title":"Setup experiment","text":"","category":"section"},{"location":"generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/","page":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","title":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","text":"Load packages.","category":"page"},{"location":"generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/","page":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","title":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","text":"using AtomsBase, InteratomicPotentials, PotentialLearning\nusing Unitful, UnitfulAtomic\nusing LinearAlgebra, Random, DisplayAs","category":"page"},{"location":"generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/","page":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","title":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","text":"Define paths.","category":"page"},{"location":"generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/","page":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","title":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","text":"base_path = haskey(ENV, \"BASE_PATH\") ? ENV[\"BASE_PATH\"] : \"../../\"\nds_path = \"$base_path/examples/data/a-HfO2/a-HfO2-300K-NVT-6000.extxyz\"\nres_path = \"$base_path/examples/PCA-ACE-aHfO2/results/\";\nnothing #hide","category":"page"},{"location":"generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/","page":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","title":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","text":"Load utility functions.","category":"page"},{"location":"generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/","page":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","title":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","text":"include(\"$base_path/examples/utils/utils.jl\");\nnothing #hide","category":"page"},{"location":"generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/","page":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","title":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","text":"Create experiment folder.","category":"page"},{"location":"generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/","page":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","title":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","text":"run(`mkdir -p $res_path`);\nnothing #hide","category":"page"},{"location":"generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/#Load-datasets","page":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","title":"Load datasets","text":"","category":"section"},{"location":"generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/","page":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","title":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","text":"Load atomistic dataset: atomistic configurations (atom positions, geometry, etc.) + DFT data (energies, forces, etc.)","category":"page"},{"location":"generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/","page":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","title":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","text":"ds = load_data(ds_path, uparse(\"eV\"), uparse(\"Å\"))[1:1000]; # Load first 1K samples.\nnothing #hide","category":"page"},{"location":"generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/","page":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","title":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","text":"Split atomistic dataset into training and test.","category":"page"},{"location":"generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/","page":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","title":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","text":"n_train, n_test = 50, 50 # Only 50 samples per dataset are used in this example.\nconf_train, conf_test = split(ds, n_train, n_test)","category":"page"},{"location":"generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/#Compute-descriptors","page":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","title":"Compute descriptors","text":"","category":"section"},{"location":"generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/","page":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","title":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","text":"Create and save ACE basis.","category":"page"},{"location":"generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/","page":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","title":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","text":"basis = ACE(species = [:Hf, :O],\n body_order = 3,\n polynomial_degree = 4,\n rcutoff = 5.0,\n wL = 1.0,\n csp = 1.0,\n r0 = 1.0)\n@save_var res_path basis;\nnothing #hide","category":"page"},{"location":"generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/","page":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","title":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","text":"Compute ACE descriptors for energy and forces based on the atomistic training configurations.","category":"page"},{"location":"generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/","page":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","title":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","text":"println(\"Computing energy descriptors of training dataset...\")\ne_descr_train = compute_local_descriptors(conf_train, basis;\n pbar=false)\nprintln(\"Computing force descriptors of training dataset...\")\nf_descr_train = compute_force_descriptors(conf_train, basis;\n pbar=false)","category":"page"},{"location":"generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/","page":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","title":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","text":"Update training dataset by adding energy and force descriptors.","category":"page"},{"location":"generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/","page":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","title":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","text":"ds_train = DataSet(conf_train .+ e_descr_train .+ f_descr_train);\nnothing #hide","category":"page"},{"location":"generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/#Reduce-descriptor-dimension","page":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","title":"Reduce descriptor dimension","text":"","category":"section"},{"location":"generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/","page":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","title":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","text":"Reduce dimension of energy and force descriptors in the training dataset.","category":"page"},{"location":"generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/","page":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","title":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","text":"n_desc = 20\npca = PCAState(tol = n_desc)\nfit!(ds_train, pca)\ntransform!(ds_train, pca);\nnothing #hide","category":"page"},{"location":"generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/#Learn-coefficients","page":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","title":"Learn coefficients","text":"","category":"section"},{"location":"generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/","page":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","title":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","text":"Learn ACE coefficients based on ACE descriptors and DFT data.","category":"page"},{"location":"generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/","page":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","title":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","text":"println(\"Learning energies and forces...\")\nlb = LBasisPotential(basis)\nws, int = [1.0, 1.0], true\nlearn!(lb, ds_train, ws, int)\n@save_var res_path lb.β\n@save_var res_path lb.β0\nlb.β, lb.β0","category":"page"},{"location":"generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/#Post-process-results","page":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","title":"Post-process results","text":"","category":"section"},{"location":"generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/","page":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","title":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","text":"Compute ACE descriptors for energy and forces based on the atomistic test configurations.","category":"page"},{"location":"generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/","page":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","title":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","text":"println(\"Computing energy descriptors of test dataset...\")\ne_descr_test = compute_local_descriptors(conf_test, basis;\n pbar = false)\nprintln(\"Computing force descriptors of test dataset...\")\nf_descr_test = compute_force_descriptors(conf_test, basis;\n pbar = false);\nnothing #hide","category":"page"},{"location":"generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/","page":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","title":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","text":"Update test dataset by adding energy and force descriptors.","category":"page"},{"location":"generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/","page":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","title":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","text":"ds_test = DataSet(conf_test .+ e_descr_test .+ f_descr_test);\nnothing #hide","category":"page"},{"location":"generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/","page":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","title":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","text":"Dimension reduction of energy and force descriptors of test dataset.","category":"page"},{"location":"generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/","page":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","title":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","text":"transform!(ds_test, pca);\nnothing #hide","category":"page"},{"location":"generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/","page":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","title":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","text":"Get and save true and predicted values for energies and forces.","category":"page"},{"location":"generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/","page":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","title":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","text":"n_atoms_train = length.(get_system.(ds_train))\nn_atoms_test = length.(get_system.(ds_test))\n\ne_train, e_train_pred = get_all_energies(ds_train) ./ n_atoms_train,\n get_all_energies(ds_train, lb) ./ n_atoms_train\nf_train, f_train_pred = get_all_forces(ds_train),\n get_all_forces(ds_train, lb)\n@save_var res_path e_train\n@save_var res_path e_train_pred\n@save_var res_path f_train\n@save_var res_path f_train_pred\n\ne_test, e_test_pred = get_all_energies(ds_test) ./ n_atoms_test,\n get_all_energies(ds_test, lb) ./ n_atoms_test\nf_test, f_test_pred = get_all_forces(ds_test),\n get_all_forces(ds_test, lb)\n@save_var res_path e_test\n@save_var res_path e_test_pred\n@save_var res_path f_test\n@save_var res_path f_test_pred;\nnothing #hide","category":"page"},{"location":"generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/","page":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","title":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","text":"Compute and save training metrics.","category":"page"},{"location":"generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/","page":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","title":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","text":"e_train_metrics = get_metrics(e_train, e_train_pred,\n metrics = [mae, rmse, rsq],\n label = \"e_train\")\nf_train_metrics = get_metrics(f_train, f_train_pred,\n metrics = [mae, rmse, rsq, mean_cos],\n label = \"f_train\")\ntrain_metrics = merge(e_train_metrics, f_train_metrics)\n@save_dict res_path train_metrics\ntrain_metrics","category":"page"},{"location":"generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/","page":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","title":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","text":"Compute and save test metrics.","category":"page"},{"location":"generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/","page":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","title":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","text":"e_test_metrics = get_metrics(e_test, e_test_pred,\n metrics = [mae, rmse, rsq],\n label = \"e_test\")\nf_test_metrics = get_metrics(f_test, f_test_pred,\n metrics = [mae, rmse, rsq, mean_cos],\n label = \"f_test\")\ntest_metrics = merge(e_test_metrics, f_test_metrics)\n@save_dict res_path test_metrics\ntest_metrics","category":"page"},{"location":"generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/","page":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","title":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","text":"Plot and save energy results.","category":"page"},{"location":"generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/","page":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","title":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","text":"e_plot = plot_energy(e_train, e_train_pred,\n e_test, e_test_pred)\n@save_fig res_path e_plot\nDisplayAs.PNG(e_plot)","category":"page"},{"location":"generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/","page":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","title":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","text":"Plot and save force results.","category":"page"},{"location":"generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/","page":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","title":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","text":"f_plot = plot_forces(f_train, f_train_pred,\n f_test, f_test_pred)\n@save_fig res_path f_plot\nDisplayAs.PNG(f_plot)","category":"page"},{"location":"generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/","page":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","title":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","text":"Plot and save training force cosine.","category":"page"},{"location":"generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/","page":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","title":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","text":"e_train_plot = plot_energy(e_train, e_train_pred)\nf_train_plot = plot_forces(f_train, f_train_pred)\nf_train_cos = plot_cos(f_train, f_train_pred)\n@save_fig res_path e_train_plot\n@save_fig res_path f_train_plot\n@save_fig res_path f_train_cos\nDisplayAs.PNG(f_train_cos)","category":"page"},{"location":"generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/","page":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","title":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","text":"Plot and save test force cosine.","category":"page"},{"location":"generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/","page":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","title":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","text":"e_test_plot = plot_energy(e_test, e_test_pred)\nf_test_plot = plot_forces(f_test, f_test_pred)\nf_test_cos = plot_cos(f_test, f_test_pred)\n@save_fig res_path e_test_plot\n@save_fig res_path f_test_plot\n@save_fig res_path f_test_cos\nDisplayAs.PNG(f_test_cos)","category":"page"},{"location":"generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/","page":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","title":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","text":"","category":"page"},{"location":"generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/","page":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","title":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","text":"This page was generated using Literate.jl.","category":"page"},{"location":"generated/Opt-ACE-aHfO2/fit-opt-ace-ahfo2/","page":"Optimize ACE hyper-parameters: minimize force time and fitting error","title":"Optimize ACE hyper-parameters: minimize force time and fitting error","text":"EditURL = \"../../../../examples/Opt-ACE-aHfO2/fit-opt-ace-ahfo2.jl\"","category":"page"},{"location":"generated/Opt-ACE-aHfO2/fit-opt-ace-ahfo2/#Optimize-ACE-hyper-parameters:-minimize-force-time-and-fitting-error.","page":"Optimize ACE hyper-parameters: minimize force time and fitting error","title":"Optimize ACE hyper-parameters: minimize force time and fitting error.","text":"","category":"section"},{"location":"generated/Opt-ACE-aHfO2/fit-opt-ace-ahfo2/#Setup-experiment","page":"Optimize ACE hyper-parameters: minimize force time and fitting error","title":"Setup experiment","text":"","category":"section"},{"location":"generated/Opt-ACE-aHfO2/fit-opt-ace-ahfo2/","page":"Optimize ACE hyper-parameters: minimize force time and fitting error","title":"Optimize ACE hyper-parameters: minimize force time and fitting error","text":"Load packages.","category":"page"},{"location":"generated/Opt-ACE-aHfO2/fit-opt-ace-ahfo2/","page":"Optimize ACE hyper-parameters: minimize force time and fitting error","title":"Optimize ACE hyper-parameters: minimize force time and fitting error","text":"using AtomsBase, InteratomicPotentials, PotentialLearning\nusing Unitful, UnitfulAtomic\nusing LinearAlgebra, Random, DisplayAs\nusing DataFrames, Hyperopt","category":"page"},{"location":"generated/Opt-ACE-aHfO2/fit-opt-ace-ahfo2/","page":"Optimize ACE hyper-parameters: minimize force time and fitting error","title":"Optimize ACE hyper-parameters: minimize force time and fitting error","text":"Define paths.","category":"page"},{"location":"generated/Opt-ACE-aHfO2/fit-opt-ace-ahfo2/","page":"Optimize ACE hyper-parameters: minimize force time and fitting error","title":"Optimize ACE hyper-parameters: minimize force time and fitting error","text":"base_path = haskey(ENV, \"BASE_PATH\") ? ENV[\"BASE_PATH\"] : \"../../\"\nds_path = \"$base_path/examples/data/a-HfO2/a-HfO2-300K-NVT-6000.extxyz\"\nres_path = \"$base_path/examples/Opt-ACE-aHfO2/results/\";\nnothing #hide","category":"page"},{"location":"generated/Opt-ACE-aHfO2/fit-opt-ace-ahfo2/","page":"Optimize ACE hyper-parameters: minimize force time and fitting error","title":"Optimize ACE hyper-parameters: minimize force time and fitting error","text":"Load utility functions.","category":"page"},{"location":"generated/Opt-ACE-aHfO2/fit-opt-ace-ahfo2/","page":"Optimize ACE hyper-parameters: minimize force time and fitting error","title":"Optimize ACE hyper-parameters: minimize force time and fitting error","text":"include(\"$base_path/examples/utils/utils.jl\");\nnothing #hide","category":"page"},{"location":"generated/Opt-ACE-aHfO2/fit-opt-ace-ahfo2/","page":"Optimize ACE hyper-parameters: minimize force time and fitting error","title":"Optimize ACE hyper-parameters: minimize force time and fitting error","text":"Create experiment folder.","category":"page"},{"location":"generated/Opt-ACE-aHfO2/fit-opt-ace-ahfo2/","page":"Optimize ACE hyper-parameters: minimize force time and fitting error","title":"Optimize ACE hyper-parameters: minimize force time and fitting error","text":"run(`mkdir -p $res_path`);\nnothing #hide","category":"page"},{"location":"generated/Opt-ACE-aHfO2/fit-opt-ace-ahfo2/#Load-datasets","page":"Optimize ACE hyper-parameters: minimize force time and fitting error","title":"Load datasets","text":"","category":"section"},{"location":"generated/Opt-ACE-aHfO2/fit-opt-ace-ahfo2/","page":"Optimize ACE hyper-parameters: minimize force time and fitting error","title":"Optimize ACE hyper-parameters: minimize force time and fitting error","text":"Load atomistic dataset: atomistic configurations (atom positions, geometry, etc.) + DFT data (energies, forces, etc.)","category":"page"},{"location":"generated/Opt-ACE-aHfO2/fit-opt-ace-ahfo2/","page":"Optimize ACE hyper-parameters: minimize force time and fitting error","title":"Optimize ACE hyper-parameters: minimize force time and fitting error","text":"ds = load_data(ds_path, uparse(\"eV\"), uparse(\"Å\"))[1:1000]; # Load first 1K samples.\nnothing #hide","category":"page"},{"location":"generated/Opt-ACE-aHfO2/fit-opt-ace-ahfo2/","page":"Optimize ACE hyper-parameters: minimize force time and fitting error","title":"Optimize ACE hyper-parameters: minimize force time and fitting error","text":"Split atomistic dataset into training and test","category":"page"},{"location":"generated/Opt-ACE-aHfO2/fit-opt-ace-ahfo2/","page":"Optimize ACE hyper-parameters: minimize force time and fitting error","title":"Optimize ACE hyper-parameters: minimize force time and fitting error","text":"n_train, n_test = 50, 50 # Only 50 samples per dataset are used in this example.\nconf_train, conf_test = split(ds, n_train, n_test)","category":"page"},{"location":"generated/Opt-ACE-aHfO2/fit-opt-ace-ahfo2/#Optimize-hyper-parameters","page":"Optimize ACE hyper-parameters: minimize force time and fitting error","title":"Optimize hyper-parameters","text":"","category":"section"},{"location":"generated/Opt-ACE-aHfO2/fit-opt-ace-ahfo2/","page":"Optimize ACE hyper-parameters: minimize force time and fitting error","title":"Optimize ACE hyper-parameters: minimize force time and fitting error","text":"Define a custom loss function. Here, we minimize fitting error and force calculation time. Possible metrics are e_mae, e_rmse, e_rsq, f_mae, f_rmse, f_rsq, and time_us.","category":"page"},{"location":"generated/Opt-ACE-aHfO2/fit-opt-ace-ahfo2/","page":"Optimize ACE hyper-parameters: minimize force time and fitting error","title":"Optimize ACE hyper-parameters: minimize force time and fitting error","text":"function custom_loss(\n metrics::OrderedDict\n)\n e_mae = metrics[:e_mae]\n f_mae = metrics[:f_mae]\n time_us = metrics[:time_us]\n e_mae_max = 0.05 # eV/atom\n f_mae_max = 0.05 # eV/Å\n w_e = e_mae/e_mae_max\n w_f = f_mae/f_mae_max\n w_t = 1.0E-3\n loss = w_e * e_mae + w_f * e_mae + w_t * time_us\n return loss\nend;\nnothing #hide","category":"page"},{"location":"generated/Opt-ACE-aHfO2/fit-opt-ace-ahfo2/","page":"Optimize ACE hyper-parameters: minimize force time and fitting error","title":"Optimize ACE hyper-parameters: minimize force time and fitting error","text":"Define model and hyper-parameter value ranges to be optimized.","category":"page"},{"location":"generated/Opt-ACE-aHfO2/fit-opt-ace-ahfo2/","page":"Optimize ACE hyper-parameters: minimize force time and fitting error","title":"Optimize ACE hyper-parameters: minimize force time and fitting error","text":"model = ACE\npars = OrderedDict( :body_order => [2, 3, 4],\n :polynomial_degree => [3, 4, 5],\n :rcutoff => LinRange(4, 6, 10),\n :wL => LinRange(0.5, 1.5, 10),\n :csp => LinRange(0.5, 1.5, 10),\n :r0 => LinRange(0.5, 1.5, 10));\nnothing #hide","category":"page"},{"location":"generated/Opt-ACE-aHfO2/fit-opt-ace-ahfo2/","page":"Optimize ACE hyper-parameters: minimize force time and fitting error","title":"Optimize ACE hyper-parameters: minimize force time and fitting error","text":"Use latin hypercube sampling to find the optimal hyper-parameters. Alternatively, use random sampling (sampler = RandomSampler()).","category":"page"},{"location":"generated/Opt-ACE-aHfO2/fit-opt-ace-ahfo2/","page":"Optimize ACE hyper-parameters: minimize force time and fitting error","title":"Optimize ACE hyper-parameters: minimize force time and fitting error","text":"sampler = CLHSampler(dims=[Categorical(3), Categorical(3), Continuous(),\n Continuous(), Continuous(), Continuous()])\niap, res = hyperlearn!(model, pars, conf_train;\n n_samples = 10, sampler = sampler,\n loss = custom_loss, ws = [1.0, 1.0], int = true);\nnothing #hide","category":"page"},{"location":"generated/Opt-ACE-aHfO2/fit-opt-ace-ahfo2/#Post-process-results","page":"Optimize ACE hyper-parameters: minimize force time and fitting error","title":"Post-process results","text":"","category":"section"},{"location":"generated/Opt-ACE-aHfO2/fit-opt-ace-ahfo2/","page":"Optimize ACE hyper-parameters: minimize force time and fitting error","title":"Optimize ACE hyper-parameters: minimize force time and fitting error","text":"Save and show results.","category":"page"},{"location":"generated/Opt-ACE-aHfO2/fit-opt-ace-ahfo2/","page":"Optimize ACE hyper-parameters: minimize force time and fitting error","title":"Optimize ACE hyper-parameters: minimize force time and fitting error","text":"@save_var res_path iap.β\n@save_var res_path iap.β0\n@save_var res_path iap.basis\n@save_dataframe res_path res\nres","category":"page"},{"location":"generated/Opt-ACE-aHfO2/fit-opt-ace-ahfo2/","page":"Optimize ACE hyper-parameters: minimize force time and fitting error","title":"Optimize ACE hyper-parameters: minimize force time and fitting error","text":"Plot error vs time.","category":"page"},{"location":"generated/Opt-ACE-aHfO2/fit-opt-ace-ahfo2/","page":"Optimize ACE hyper-parameters: minimize force time and fitting error","title":"Optimize ACE hyper-parameters: minimize force time and fitting error","text":"err_time = plot_err_time(res)\n@save_fig res_path err_time\nDisplayAs.PNG(err_time)","category":"page"},{"location":"generated/Opt-ACE-aHfO2/fit-opt-ace-ahfo2/","page":"Optimize ACE hyper-parameters: minimize force time and fitting error","title":"Optimize ACE hyper-parameters: minimize force time and fitting error","text":"","category":"page"},{"location":"generated/Opt-ACE-aHfO2/fit-opt-ace-ahfo2/","page":"Optimize ACE hyper-parameters: minimize force time and fitting error","title":"Optimize ACE hyper-parameters: minimize force time and fitting error","text":"This page was generated using Literate.jl.","category":"page"},{"location":"generated/DPP-ACE-Na/fit-dpp-ace-na/","page":"Subsample Na dataset with DPP and fit with ACE","title":"Subsample Na dataset with DPP and fit with ACE","text":"EditURL = \"../../../../examples/DPP-ACE-Na/fit-dpp-ace-na.jl\"","category":"page"},{"location":"generated/DPP-ACE-Na/fit-dpp-ace-na/#Subsample-Na-dataset-with-DPP-and-fit-energies-with-ACE","page":"Subsample Na dataset with DPP and fit with ACE","title":"Subsample Na dataset with DPP and fit energies with ACE","text":"","category":"section"},{"location":"generated/DPP-ACE-Na/fit-dpp-ace-na/#Setup-experiment","page":"Subsample Na dataset with DPP and fit with ACE","title":"Setup experiment","text":"","category":"section"},{"location":"generated/DPP-ACE-Na/fit-dpp-ace-na/","page":"Subsample Na dataset with DPP and fit with ACE","title":"Subsample Na dataset with DPP and fit with ACE","text":"Load packages.","category":"page"},{"location":"generated/DPP-ACE-Na/fit-dpp-ace-na/","page":"Subsample Na dataset with DPP and fit with ACE","title":"Subsample Na dataset with DPP and fit with ACE","text":"using Unitful, UnitfulAtomic\nusing AtomsBase, InteratomicPotentials, PotentialLearning\nusing LinearAlgebra, Plots","category":"page"},{"location":"generated/DPP-ACE-Na/fit-dpp-ace-na/","page":"Subsample Na dataset with DPP and fit with ACE","title":"Subsample Na dataset with DPP and fit with ACE","text":"Define paths.","category":"page"},{"location":"generated/DPP-ACE-Na/fit-dpp-ace-na/","page":"Subsample Na dataset with DPP and fit with ACE","title":"Subsample Na dataset with DPP and fit with ACE","text":"base_path = haskey(ENV, \"BASE_PATH\") ? ENV[\"BASE_PATH\"] : \"../../\"\nds_path = \"$base_path/examples/data/Na/liquify_sodium.yaml\"","category":"page"},{"location":"generated/DPP-ACE-Na/fit-dpp-ace-na/#Load-datasets","page":"Subsample Na dataset with DPP and fit with ACE","title":"Load datasets","text":"","category":"section"},{"location":"generated/DPP-ACE-Na/fit-dpp-ace-na/","page":"Subsample Na dataset with DPP and fit with ACE","title":"Subsample Na dataset with DPP and fit with ACE","text":"Load atomistic dataset: atomistic configurations (atom positions, geometry, etc.) + DFT data (energies, forces, etc.).","category":"page"},{"location":"generated/DPP-ACE-Na/fit-dpp-ace-na/","page":"Subsample Na dataset with DPP and fit with ACE","title":"Subsample Na dataset with DPP and fit with ACE","text":"confs, thermo = load_data(ds_path, YAML(:Na, u\"eV\", u\"Å\"))\nconfs, thermo = confs[220:end], thermo[220:end]","category":"page"},{"location":"generated/DPP-ACE-Na/fit-dpp-ace-na/","page":"Subsample Na dataset with DPP and fit with ACE","title":"Subsample Na dataset with DPP and fit with ACE","text":"Split atomistic dataset into training and test.","category":"page"},{"location":"generated/DPP-ACE-Na/fit-dpp-ace-na/","page":"Subsample Na dataset with DPP and fit with ACE","title":"Subsample Na dataset with DPP and fit with ACE","text":"conf_train, conf_test = confs[1:1000], confs[1001:end]","category":"page"},{"location":"generated/DPP-ACE-Na/fit-dpp-ace-na/#Compute-descriptors","page":"Subsample Na dataset with DPP and fit with ACE","title":"Compute descriptors","text":"","category":"section"},{"location":"generated/DPP-ACE-Na/fit-dpp-ace-na/","page":"Subsample Na dataset with DPP and fit with ACE","title":"Subsample Na dataset with DPP and fit with ACE","text":"Create ACE basis.","category":"page"},{"location":"generated/DPP-ACE-Na/fit-dpp-ace-na/","page":"Subsample Na dataset with DPP and fit with ACE","title":"Subsample Na dataset with DPP and fit with ACE","text":"ace = ACE(species = [:Na], # species\n body_order = 4, # 4-body\n polynomial_degree = 8, # 8 degree polynomials\n wL = 1.0, # Defaults, See ACE.jl documentation\n csp = 1.0, # Defaults, See ACE.jl documentation\n r0 = 1.0, # minimum distance between atoms\n rcutoff = 5.0); # cutoff radius\nnothing #hide","category":"page"},{"location":"generated/DPP-ACE-Na/fit-dpp-ace-na/","page":"Subsample Na dataset with DPP and fit with ACE","title":"Subsample Na dataset with DPP and fit with ACE","text":"Update training dataset by adding energy (local) descriptors.","category":"page"},{"location":"generated/DPP-ACE-Na/fit-dpp-ace-na/","page":"Subsample Na dataset with DPP and fit with ACE","title":"Subsample Na dataset with DPP and fit with ACE","text":"println(\"Computing local descriptors of training dataset\")\ne_descr_train = compute_local_descriptors(conf_train, ace) # JLD.load(\"data/sodium_empirical_full.jld\", \"descriptors\")","category":"page"},{"location":"generated/DPP-ACE-Na/fit-dpp-ace-na/","page":"Subsample Na dataset with DPP and fit with ACE","title":"Subsample Na dataset with DPP and fit with ACE","text":"Update training dataset by adding energy and force descriptors.","category":"page"},{"location":"generated/DPP-ACE-Na/fit-dpp-ace-na/","page":"Subsample Na dataset with DPP and fit with ACE","title":"Subsample Na dataset with DPP and fit with ACE","text":"ds_train = DataSet(conf_train .+ e_descr_train);\nnothing #hide","category":"page"},{"location":"generated/DPP-ACE-Na/fit-dpp-ace-na/#Subsample-dataset","page":"Subsample Na dataset with DPP and fit with ACE","title":"Subsample dataset","text":"","category":"section"},{"location":"generated/DPP-ACE-Na/fit-dpp-ace-na/","page":"Subsample Na dataset with DPP and fit with ACE","title":"Subsample Na dataset with DPP and fit with ACE","text":"Create DPP subselector.","category":"page"},{"location":"generated/DPP-ACE-Na/fit-dpp-ace-na/","page":"Subsample Na dataset with DPP and fit with ACE","title":"Subsample Na dataset with DPP and fit with ACE","text":"dpp = kDPP(ds_train, GlobalMean(), DotProduct(); batch_size = 200)","category":"page"},{"location":"generated/DPP-ACE-Na/fit-dpp-ace-na/","page":"Subsample Na dataset with DPP and fit with ACE","title":"Subsample Na dataset with DPP and fit with ACE","text":"Subsample trainig dataset.","category":"page"},{"location":"generated/DPP-ACE-Na/fit-dpp-ace-na/","page":"Subsample Na dataset with DPP and fit with ACE","title":"Subsample Na dataset with DPP and fit with ACE","text":"dpp_inds = get_random_subset(dpp)","category":"page"},{"location":"generated/DPP-ACE-Na/fit-dpp-ace-na/#Learn-coefficients","page":"Subsample Na dataset with DPP and fit with ACE","title":"Learn coefficients","text":"","category":"section"},{"location":"generated/DPP-ACE-Na/fit-dpp-ace-na/","page":"Subsample Na dataset with DPP and fit with ACE","title":"Subsample Na dataset with DPP and fit with ACE","text":"Learn ACE coefficients based on ACE descriptors and DFT data.","category":"page"},{"location":"generated/DPP-ACE-Na/fit-dpp-ace-na/","page":"Subsample Na dataset with DPP and fit with ACE","title":"Subsample Na dataset with DPP and fit with ACE","text":"lb = LBasisPotential(ace)\nα = 1e-8\nΣ = learn!(lb, ds_train[dpp_inds], α)","category":"page"},{"location":"generated/DPP-ACE-Na/fit-dpp-ace-na/#Post-process-results","page":"Subsample Na dataset with DPP and fit with ACE","title":"Post-process results","text":"","category":"section"},{"location":"generated/DPP-ACE-Na/fit-dpp-ace-na/","page":"Subsample Na dataset with DPP and fit with ACE","title":"Subsample Na dataset with DPP and fit with ACE","text":"Update test dataset by adding energy descriptors.","category":"page"},{"location":"generated/DPP-ACE-Na/fit-dpp-ace-na/","page":"Subsample Na dataset with DPP and fit with ACE","title":"Subsample Na dataset with DPP and fit with ACE","text":"println(\"Computing local descriptors of test dataset\")\ne_descr_test = compute_local_descriptors(conf_test, ace)\nds_test = DataSet(conf_test .+ e_descr_test);\nnothing #hide","category":"page"},{"location":"generated/DPP-ACE-Na/fit-dpp-ace-na/","page":"Subsample Na dataset with DPP and fit with ACE","title":"Subsample Na dataset with DPP and fit with ACE","text":"Get true and predicted energy values (assuming that all configurations have the same no. of atoms).","category":"page"},{"location":"generated/DPP-ACE-Na/fit-dpp-ace-na/","page":"Subsample Na dataset with DPP and fit with ACE","title":"Subsample Na dataset with DPP and fit with ACE","text":"n = size(get_system(ds_train[1]))[1]\ne_train, e_train_pred = get_all_energies(ds_train)/n, get_all_energies(ds_train, lb)/n\ne_test, e_test_pred = get_all_energies(ds_test)/n, get_all_energies(ds_test, lb)/n;\nnothing #hide","category":"page"},{"location":"generated/DPP-ACE-Na/fit-dpp-ace-na/","page":"Subsample Na dataset with DPP and fit with ACE","title":"Subsample Na dataset with DPP and fit with ACE","text":"Compute and print metrics.","category":"page"},{"location":"generated/DPP-ACE-Na/fit-dpp-ace-na/","page":"Subsample Na dataset with DPP and fit with ACE","title":"Subsample Na dataset with DPP and fit with ACE","text":"e_mae, e_rmse, e_rsq = calc_metrics(e_train, e_train_pred)\nprintln(\"MAE: $e_mae, RMSE: $e_rmse, RSQ: $e_rsq\")","category":"page"},{"location":"generated/DPP-ACE-Na/fit-dpp-ace-na/","page":"Subsample Na dataset with DPP and fit with ACE","title":"Subsample Na dataset with DPP and fit with ACE","text":"Plot energy error.","category":"page"},{"location":"generated/DPP-ACE-Na/fit-dpp-ace-na/","page":"Subsample Na dataset with DPP and fit with ACE","title":"Subsample Na dataset with DPP and fit with ACE","text":"e_err_train, e_err_test = (e_train_pred - e_train), (e_test_pred - e_test)\ndpp_inds2 = get_random_subset(dpp; batch_size = 20)\np = scatter( e_train, e_err_train, label = \"Training\", color = :blue,\n markersize = 1.5, markerstrokewidth=0)\nscatter!(e_test, e_err_test, label = \"Test\", color = :yellow,\n markersize = 1.5, markerstrokewidth=0)\nscatter!(e_train[dpp_inds2], e_err_train[dpp_inds2],\n color = :darkred, label = \"DPP Samples\",\n markersize = 2.5, markerstrokewidth=0)\nscatter!(xlabel = \"Energy (eV/atom)\", ylabel = \"Error (eV/atom)\",\n dpi = 1000, fontsize = 16)","category":"page"},{"location":"generated/DPP-ACE-Na/fit-dpp-ace-na/","page":"Subsample Na dataset with DPP and fit with ACE","title":"Subsample Na dataset with DPP and fit with ACE","text":"","category":"page"},{"location":"generated/DPP-ACE-Na/fit-dpp-ace-na/","page":"Subsample Na dataset with DPP and fit with ACE","title":"Subsample Na dataset with DPP and fit with ACE","text":"This page was generated using Literate.jl.","category":"page"},{"location":"generated/LJ-Ar/lennard-jones-ar/","page":"Load Ar+Lennard-Jones dataset and postprocess","title":"Load Ar+Lennard-Jones dataset and postprocess","text":"EditURL = \"../../../../examples/LJ-Ar/lennard-jones-ar.jl\"","category":"page"},{"location":"generated/LJ-Ar/lennard-jones-ar/#Load-Ar-dataset-with-energies-computed-by-Lennard-Jones-and-postprocess","page":"Load Ar+Lennard-Jones dataset and postprocess","title":"Load Ar dataset with energies computed by Lennard-Jones and postprocess","text":"","category":"section"},{"location":"generated/LJ-Ar/lennard-jones-ar/#Setup-experiment","page":"Load Ar+Lennard-Jones dataset and postprocess","title":"Setup experiment","text":"","category":"section"},{"location":"generated/LJ-Ar/lennard-jones-ar/","page":"Load Ar+Lennard-Jones dataset and postprocess","title":"Load Ar+Lennard-Jones dataset and postprocess","text":"Load packages.","category":"page"},{"location":"generated/LJ-Ar/lennard-jones-ar/","page":"Load Ar+Lennard-Jones dataset and postprocess","title":"Load Ar+Lennard-Jones dataset and postprocess","text":"using Unitful, UnitfulAtomic\nusing AtomsBase, InteratomicPotentials, PotentialLearning\nusing LinearAlgebra, Plots, DisplayAs","category":"page"},{"location":"generated/LJ-Ar/lennard-jones-ar/","page":"Load Ar+Lennard-Jones dataset and postprocess","title":"Load Ar+Lennard-Jones dataset and postprocess","text":"Define paths.","category":"page"},{"location":"generated/LJ-Ar/lennard-jones-ar/","page":"Load Ar+Lennard-Jones dataset and postprocess","title":"Load Ar+Lennard-Jones dataset and postprocess","text":"base_path = haskey(ENV, \"BASE_PATH\") ? ENV[\"BASE_PATH\"] : \"../../\"\nds_path = \"$base_path/examples/data/LJ-AR/lj-ar.yaml\"","category":"page"},{"location":"generated/LJ-Ar/lennard-jones-ar/#Load-datasets","page":"Load Ar+Lennard-Jones dataset and postprocess","title":"Load datasets","text":"","category":"section"},{"location":"generated/LJ-Ar/lennard-jones-ar/","page":"Load Ar+Lennard-Jones dataset and postprocess","title":"Load Ar+Lennard-Jones dataset and postprocess","text":"ds, thermo = load_data(ds_path, YAML(:Ar, u\"eV\", u\"Å\"))\nds = @views ds[2:end] # Filter first configuration (zero energy)","category":"page"},{"location":"generated/LJ-Ar/lennard-jones-ar/#Compute-distances,-energies,-and-time-range.","page":"Load Ar+Lennard-Jones dataset and postprocess","title":"Compute distances, energies, and time range.","text":"","category":"section"},{"location":"generated/LJ-Ar/lennard-jones-ar/","page":"Load Ar+Lennard-Jones dataset and postprocess","title":"Load Ar+Lennard-Jones dataset and postprocess","text":"Get atom positions and compute distance from origin.","category":"page"},{"location":"generated/LJ-Ar/lennard-jones-ar/","page":"Load Ar+Lennard-Jones dataset and postprocess","title":"Load Ar+Lennard-Jones dataset and postprocess","text":"systems = get_system.(ds)\nn_atoms = length(first(systems)) # Note: in this dataset all systems contain the same no. of atoms\npositions = position.(systems)\ndists_origin = map(x->ustrip.(norm.(x)), positions);\nnothing #hide","category":"page"},{"location":"generated/LJ-Ar/lennard-jones-ar/","page":"Load Ar+Lennard-Jones dataset and postprocess","title":"Load Ar+Lennard-Jones dataset and postprocess","text":"Extract LJ energies from dataset.","category":"page"},{"location":"generated/LJ-Ar/lennard-jones-ar/","page":"Load Ar+Lennard-Jones dataset and postprocess","title":"Load Ar+Lennard-Jones dataset and postprocess","text":"energies = get_values.(get_energy.(ds));\nnothing #hide","category":"page"},{"location":"generated/LJ-Ar/lennard-jones-ar/","page":"Load Ar+Lennard-Jones dataset and postprocess","title":"Load Ar+Lennard-Jones dataset and postprocess","text":"Define time range.","category":"page"},{"location":"generated/LJ-Ar/lennard-jones-ar/","page":"Load Ar+Lennard-Jones dataset and postprocess","title":"Load Ar+Lennard-Jones dataset and postprocess","text":"time_range = 0.5:0.5:5000;\nnothing #hide","category":"page"},{"location":"generated/LJ-Ar/lennard-jones-ar/#Post-process-results","page":"Load Ar+Lennard-Jones dataset and postprocess","title":"Post-process results","text":"","category":"section"},{"location":"generated/LJ-Ar/lennard-jones-ar/","page":"Load Ar+Lennard-Jones dataset and postprocess","title":"Load Ar+Lennard-Jones dataset and postprocess","text":"Plot distance from origin vs time.","category":"page"},{"location":"generated/LJ-Ar/lennard-jones-ar/","page":"Load Ar+Lennard-Jones dataset and postprocess","title":"Load Ar+Lennard-Jones dataset and postprocess","text":"p = plot(xlabel = \"τ | ps\",\n ylabel = \"Distance from origin | Å\",\n dpi = 300, fontsize = 12)\nfor i = 1:n_atoms\n plot!(time_range, map(x->x[i], dists_origin), label=\"\")\nend\nDisplayAs.PNG(p)","category":"page"},{"location":"generated/LJ-Ar/lennard-jones-ar/","page":"Load Ar+Lennard-Jones dataset and postprocess","title":"Load Ar+Lennard-Jones dataset and postprocess","text":"Plot LJ energies vs time.","category":"page"},{"location":"generated/LJ-Ar/lennard-jones-ar/","page":"Load Ar+Lennard-Jones dataset and postprocess","title":"Load Ar+Lennard-Jones dataset and postprocess","text":"p = plot(time_range, energies,\n xlabel = \"τ | ps\",\n ylabel = \"Lennard Jones energy | eV\",\n dpi = 300, fontsize = 12)\nDisplayAs.PNG(p)","category":"page"},{"location":"generated/LJ-Ar/lennard-jones-ar/","page":"Load Ar+Lennard-Jones dataset and postprocess","title":"Load Ar+Lennard-Jones dataset and postprocess","text":"","category":"page"},{"location":"generated/LJ-Ar/lennard-jones-ar/","page":"Load Ar+Lennard-Jones dataset and postprocess","title":"Load Ar+Lennard-Jones dataset and postprocess","text":"This page was generated using Literate.jl.","category":"page"},{"location":"#PotentialLearning.jl","page":"Home","title":"PotentialLearning.jl","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"Optimize your atomistic data and interatomic potential models in your molecular dynamic workflows.","category":"page"},{"location":"#Reduce-expensive-Density-functional-theory-calculations","page":"Home","title":"Reduce expensive Density functional theory calculations","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"Reduce expensive Density functional theory calculations while maintaining training accuracy by intelligently subsampling your atomistic dataset:","category":"page"},{"location":"","page":"Home","title":"Home","text":"1 - Subsample your atomistic configurations using a Determinantal Point Process (DPP) based algorithm that compares energy descriptors computed with the Atomic Cluster Expansion (ACE).","category":"page"},{"location":"","page":"Home","title":"Home","text":"ds = DataSet(conf_train .+ e_descr)\ndataset_selector = kDPP(ds, GlobalMean(), DotProduct())\ninds = get_random_subset(dataset_selector)\nconf_train = @views conf_train[inds]","category":"page"},{"location":"","page":"Home","title":"Home","text":"2 - Export the reduced dataset, use Density functional theory (DFT) on it, and fit your model.","category":"page"},{"location":"","page":"Home","title":"Home","text":"See example.","category":"page"},{"location":"","page":"Home","title":"Home","text":"We are working to provide different intelligent subsampling algorithms based on DPP, DBSCAN, and CUR; highly scalable parallel subsampling via hierarchical subsampling and distributed parallelism; and optimal subsampler selection.","category":"page"},{"location":"#Get-fast-and-accurate-interatomic-potential-models","page":"Home","title":"Get fast and accurate interatomic potential models","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"Get fast and accurate interatomic potential models through parallel multi-objective hyper-parameter optimization:","category":"page"},{"location":"","page":"Home","title":"Home","text":"1 - Define the interatomic potential model, hyper-parameter value ranges, and custom loss function. Then, optimize your model.","category":"page"},{"location":"","page":"Home","title":"Home","text":"model = ACE\npars = OrderedDict( :body_order => [2, 3, 4],\n :polynomial_degree => [3, 4, 5], ...)\nfunction custom_loss(metrics::OrderedDict)\n ...\n return w_e * e_mae + w_f * f_mae + w_t * time_us\nend\niap, res = hyperlearn!(model, pars, conf_train; loss = custom_loss);","category":"page"},{"location":"","page":"Home","title":"Home","text":"2 - Export optimal values to your molecular dynamic workflow.","category":"page"},{"location":"","page":"Home","title":"Home","text":"See example.","category":"page"},{"location":"","page":"Home","title":"Home","text":"The models are compatible with the interfaces of our sister package InteratomicPotentials.jl. In particular, we are interested in maintaining compatibility with ACESuit, as well as integrating LAMMPS based potentials such as ML-POD and ML-PACE. We are also working to provide neural network potential architecture optimization.","category":"page"},{"location":"#Compress-interatomic-potential-data-and-model","page":"Home","title":"Compress interatomic potential data and model","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"Compress interatomic potential data and model using dimensionality reduction of energy and force descriptors:","category":"page"},{"location":"","page":"Home","title":"Home","text":"1 - Define a PCA state, fit PCA with your the energy and force descriptors of your dataset, and transform all dataset descriptors.","category":"page"},{"location":"","page":"Home","title":"Home","text":"pca = PCAState(tol = n_desc)\nfit!(ds_train, pca)\ntransform!(ds_train, pca)","category":"page"},{"location":"","page":"Home","title":"Home","text":"2 - Export PCA fitted data to be used in your workflow.","category":"page"},{"location":"","page":"Home","title":"Home","text":"See example.","category":"page"},{"location":"","page":"Home","title":"Home","text":"We are working to provide feature selection of energy and force descriptors based on CUR.","category":"page"},{"location":"","page":"Home","title":"Home","text":"Additionally, this package includes utilities for loading input data (such as XYZ files), computing various metrics (including MAE, MSE, RSQ, and COV), exporting results, and generating plots.","category":"page"},{"location":"#Acknowledgment","page":"Home","title":"Acknowledgment","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"Center for the Exascale Simulation of Materials in Extreme Environments (CESMIX). Massachusetts Institute of Technology (MIT).","category":"page"},{"location":"install-and-run-examples/#Install-and-run-examples","page":"Install and run examples","title":"Install and run examples","text":"","category":"section"},{"location":"install-and-run-examples/#Add-registries","page":"Install and run examples","title":"Add registries","text":"","category":"section"},{"location":"install-and-run-examples/","page":"Install and run examples","title":"Install and run examples","text":"Open a Julia REPL ($ julia), type ] to enter the Pkg REPL, and add the following registries:","category":"page"},{"location":"install-and-run-examples/","page":"Install and run examples","title":"Install and run examples","text":" pkg> registry add https://github.com/JuliaRegistries/General\n pkg> registry add https://github.com/cesmix-mit/CESMIX.git \n pkg> registry add https://github.com/JuliaMolSim/MolSim.git\n pkg> registry add https://github.com/ACEsuit/ACEregistry","category":"page"},{"location":"install-and-run-examples/#Clone-repository-to-access-example-folders","page":"Install and run examples","title":"Clone repository to access example folders","text":"","category":"section"},{"location":"install-and-run-examples/","page":"Install and run examples","title":"Install and run examples","text":"Clone PotentialLearning.jl repository in your working directory.","category":"page"},{"location":"install-and-run-examples/","page":"Install and run examples","title":"Install and run examples","text":" $ git clone https://github.com/cesmix-mit/PotentialLearning.jl.git","category":"page"},{"location":"install-and-run-examples/","page":"Install and run examples","title":"Install and run examples","text":"Access to any folder within PotentialLearning.jl/examples. E.g.","category":"page"},{"location":"install-and-run-examples/","page":"Install and run examples","title":"Install and run examples","text":" $ cd PotentialLearning.jl/examples/DPP-ACE-aHfO2-1","category":"page"},{"location":"install-and-run-examples/#Run-example","page":"Install and run examples","title":"Run example","text":"","category":"section"},{"location":"install-and-run-examples/","page":"Install and run examples","title":"Install and run examples","text":"Open a Julia REPL, activate the examples folder project, and define the number of threads.","category":"page"},{"location":"install-and-run-examples/","page":"Install and run examples","title":"Install and run examples","text":" $ julia --project=./ --threads=4","category":"page"},{"location":"install-and-run-examples/","page":"Install and run examples","title":"Install and run examples","text":"Type ] to enter the Pkg REPL and instantiate.","category":"page"},{"location":"install-and-run-examples/","page":"Install and run examples","title":"Install and run examples","text":" pkg> instantiate","category":"page"},{"location":"install-and-run-examples/","page":"Install and run examples","title":"Install and run examples","text":"Finally, include the example file.","category":"page"},{"location":"install-and-run-examples/","page":"Install and run examples","title":"Install and run examples","text":" julia> include(\"fit-dpp-ace-ahfo2.jl\")","category":"page"},{"location":"generated/DPP-ACE-Si/fit-dpp-ace-si/","page":"Subsample Si dataset with DPP, fit with ACE, and cross validate","title":"Subsample Si dataset with DPP, fit with ACE, and cross validate","text":"EditURL = \"../../../../examples/DPP-ACE-Si/fit-dpp-ace-si.jl\"","category":"page"},{"location":"generated/DPP-ACE-Si/fit-dpp-ace-si/#Subsample-Si-dataset-and-fit-with-ACE","page":"Subsample Si dataset with DPP, fit with ACE, and cross validate","title":"Subsample Si dataset and fit with ACE","text":"","category":"section"},{"location":"generated/DPP-ACE-Si/fit-dpp-ace-si/#Setup-experiment","page":"Subsample Si dataset with DPP, fit with ACE, and cross validate","title":"Setup experiment","text":"","category":"section"},{"location":"generated/DPP-ACE-Si/fit-dpp-ace-si/","page":"Subsample Si dataset with DPP, fit with ACE, and cross validate","title":"Subsample Si dataset with DPP, fit with ACE, and cross validate","text":"Load packages.","category":"page"},{"location":"generated/DPP-ACE-Si/fit-dpp-ace-si/","page":"Subsample Si dataset with DPP, fit with ACE, and cross validate","title":"Subsample Si dataset with DPP, fit with ACE, and cross validate","text":"using LinearAlgebra, Random, InvertedIndices\nusing Statistics, StatsBase, Distributions, Determinantal\nusing Unitful, UnitfulAtomic\nusing AtomsBase, InteratomicPotentials, PotentialLearning\nusing CSV, JLD, DataFrames","category":"page"},{"location":"generated/DPP-ACE-Si/fit-dpp-ace-si/","page":"Subsample Si dataset with DPP, fit with ACE, and cross validate","title":"Subsample Si dataset with DPP, fit with ACE, and cross validate","text":"Define atomic type information.","category":"page"},{"location":"generated/DPP-ACE-Si/fit-dpp-ace-si/","page":"Subsample Si dataset with DPP, fit with ACE, and cross validate","title":"Subsample Si dataset with DPP, fit with ACE, and cross validate","text":"elname, elspec = \"Si\", [:Si];\nnothing #hide","category":"page"},{"location":"generated/DPP-ACE-Si/fit-dpp-ace-si/","page":"Subsample Si dataset with DPP, fit with ACE, and cross validate","title":"Subsample Si dataset with DPP, fit with ACE, and cross validate","text":"Define paths.","category":"page"},{"location":"generated/DPP-ACE-Si/fit-dpp-ace-si/","page":"Subsample Si dataset with DPP, fit with ACE, and cross validate","title":"Subsample Si dataset with DPP, fit with ACE, and cross validate","text":"base_path = haskey(ENV, \"BASE_PATH\") ? ENV[\"BASE_PATH\"] : \"../../\"\ninpath = \"$base_path/examples/data/Si-3Body-LAMMPS/\"\noutpath = \"$base_path/examples/DPP-ACE-Si/output/$elname/\"","category":"page"},{"location":"generated/DPP-ACE-Si/fit-dpp-ace-si/","page":"Subsample Si dataset with DPP, fit with ACE, and cross validate","title":"Subsample Si dataset with DPP, fit with ACE, and cross validate","text":"Load utility functions.","category":"page"},{"location":"generated/DPP-ACE-Si/fit-dpp-ace-si/","page":"Subsample Si dataset with DPP, fit with ACE, and cross validate","title":"Subsample Si dataset with DPP, fit with ACE, and cross validate","text":"include(\"$base_path/examples/DPP-ACE-Si/subsampling_utils.jl\");\nnothing #hide","category":"page"},{"location":"generated/DPP-ACE-Si/fit-dpp-ace-si/#Load-datasets","page":"Subsample Si dataset with DPP, fit with ACE, and cross validate","title":"Load datasets","text":"","category":"section"},{"location":"generated/DPP-ACE-Si/fit-dpp-ace-si/","page":"Subsample Si dataset with DPP, fit with ACE, and cross validate","title":"Subsample Si dataset with DPP, fit with ACE, and cross validate","text":"Load all atomistic datasets: atomistic configurations (atom positions, geometry, etc.) + DFT data (energies, forces, etc.)","category":"page"},{"location":"generated/DPP-ACE-Si/fit-dpp-ace-si/","page":"Subsample Si dataset with DPP, fit with ACE, and cross validate","title":"Subsample Si dataset with DPP, fit with ACE, and cross validate","text":"file_arr = readext(inpath, \"xyz\")\nnfile = length(file_arr)\nconfs_arr = [load_data(inpath*file, ExtXYZ(u\"eV\", u\"Å\")) for file in file_arr]\nconfs = concat_dataset(confs_arr)","category":"page"},{"location":"generated/DPP-ACE-Si/fit-dpp-ace-si/","page":"Subsample Si dataset with DPP, fit with ACE, and cross validate","title":"Subsample Si dataset with DPP, fit with ACE, and cross validate","text":"Id of configurations per file.","category":"page"},{"location":"generated/DPP-ACE-Si/fit-dpp-ace-si/","page":"Subsample Si dataset with DPP, fit with ACE, and cross validate","title":"Subsample Si dataset with DPP, fit with ACE, and cross validate","text":"n = 0\nconfs_id = Vector{Vector{Int64}}(undef, nfile)\nfor k = 1:nfile\n global n\n confs_id[k] = (n+1):(n+length(confs_arr[k]))\n n += length(confs_arr[k])\nend","category":"page"},{"location":"generated/DPP-ACE-Si/fit-dpp-ace-si/#Subsample-dataset","page":"Subsample Si dataset with DPP, fit with ACE, and cross validate","title":"Subsample dataset","text":"","category":"section"},{"location":"generated/DPP-ACE-Si/fit-dpp-ace-si/","page":"Subsample Si dataset with DPP, fit with ACE, and cross validate","title":"Subsample Si dataset with DPP, fit with ACE, and cross validate","text":"Create ACE basis.","category":"page"},{"location":"generated/DPP-ACE-Si/fit-dpp-ace-si/","page":"Subsample Si dataset with DPP, fit with ACE, and cross validate","title":"Subsample Si dataset with DPP, fit with ACE, and cross validate","text":"nbody = 4\ndeg = 5\nace = ACE(species = elspec, # species\n body_order = nbody, # n-body\n polynomial_degree = deg, # degree of polynomials\n wL = 1.0, # Defaults, See ACE.jl documentation\n csp = 1.0, # Defaults, See ACE.jl documentation\n r0 = 1.0, # minimum distance between atoms\n rcutoff = 10.0);\nnothing #hide","category":"page"},{"location":"generated/DPP-ACE-Si/fit-dpp-ace-si/","page":"Subsample Si dataset with DPP, fit with ACE, and cross validate","title":"Subsample Si dataset with DPP, fit with ACE, and cross validate","text":"Compute and save ACE descriptors for energies and forces.","category":"page"},{"location":"generated/DPP-ACE-Si/fit-dpp-ace-si/","page":"Subsample Si dataset with DPP, fit with ACE, and cross validate","title":"Subsample Si dataset with DPP, fit with ACE, and cross validate","text":"println(\"Computing local descriptors\")\ne_descr = compute_local_descriptors(confs, ace; pbar=false)\nf_descr = compute_force_descriptors(confs, ace; pbar=false)\nJLD.save(outpath*\"$(elname)_energy_descriptors.jld\", \"e_descr\", e_descr)\nJLD.save(outpath*\"$(elname)_force_descriptors.jld\", \"f_descr\", f_descr)","category":"page"},{"location":"generated/DPP-ACE-Si/fit-dpp-ace-si/","page":"Subsample Si dataset with DPP, fit with ACE, and cross validate","title":"Subsample Si dataset with DPP, fit with ACE, and cross validate","text":"Update training dataset by adding energy and force descriptors.","category":"page"},{"location":"generated/DPP-ACE-Si/fit-dpp-ace-si/","page":"Subsample Si dataset with DPP, fit with ACE, and cross validate","title":"Subsample Si dataset with DPP, fit with ACE, and cross validate","text":"ds = DataSet(confs .+ e_descr .+ f_descr)\nndata = length(ds);\nnothing #hide","category":"page"},{"location":"generated/DPP-ACE-Si/fit-dpp-ace-si/#Post-process-results","page":"Subsample Si dataset with DPP, fit with ACE, and cross validate","title":"Post-process results","text":"","category":"section"},{"location":"generated/DPP-ACE-Si/fit-dpp-ace-si/","page":"Subsample Si dataset with DPP, fit with ACE, and cross validate","title":"Subsample Si dataset with DPP, fit with ACE, and cross validate","text":"Compute cross validation error from training dataset.","category":"page"},{"location":"generated/DPP-ACE-Si/fit-dpp-ace-si/","page":"Subsample Si dataset with DPP, fit with ACE, and cross validate","title":"Subsample Si dataset with DPP, fit with ACE, and cross validate","text":"batch_size = [80, 40]\nsel_ind = Dict{Int64, Vector}()\ncond_num = Dict{Int64, Vector}()\n\nfor bs in batch_size\n println(\"=============== Starting batch size $bs ===============\")\n sel_ind[bs], cond_num[bs] = cross_validation_training(ds; ndiv=5, dpp_batch=bs)\n println(\"condnum: $(cond_num[bs])\")\nend\n\nJLD.save(outpath*\"$(elname)_ACE-$(nbody)-$(deg)_DPP_indices_and_condnum.jld\",\n \"ind\", sel_ind,\n \"condnum\", cond_num)","category":"page"},{"location":"generated/DPP-ACE-Si/fit-dpp-ace-si/","page":"Subsample Si dataset with DPP, fit with ACE, and cross validate","title":"Subsample Si dataset with DPP, fit with ACE, and cross validate","text":"","category":"page"},{"location":"generated/DPP-ACE-Si/fit-dpp-ace-si/","page":"Subsample Si dataset with DPP, fit with ACE, and cross validate","title":"Subsample Si dataset with DPP, fit with ACE, and cross validate","text":"This page was generated using Literate.jl.","category":"page"}] +[{"location":"generated/ACE-aHfO2/fit-ace-ahfo2/","page":"Fit a-HfO2 dataset with ACE","title":"Fit a-HfO2 dataset with ACE","text":"EditURL = \"../../../../examples/ACE-aHfO2/fit-ace-ahfo2.jl\"","category":"page"},{"location":"generated/ACE-aHfO2/fit-ace-ahfo2/#Fit-a-HfO2-dataset-with-ACE","page":"Fit a-HfO2 dataset with ACE","title":"Fit a-HfO2 dataset with ACE","text":"","category":"section"},{"location":"generated/ACE-aHfO2/fit-ace-ahfo2/#Setup-experiment","page":"Fit a-HfO2 dataset with ACE","title":"Setup experiment","text":"","category":"section"},{"location":"generated/ACE-aHfO2/fit-ace-ahfo2/","page":"Fit a-HfO2 dataset with ACE","title":"Fit a-HfO2 dataset with ACE","text":"Load packages.","category":"page"},{"location":"generated/ACE-aHfO2/fit-ace-ahfo2/","page":"Fit a-HfO2 dataset with ACE","title":"Fit a-HfO2 dataset with ACE","text":"using AtomsBase, InteratomicPotentials, PotentialLearning\nusing Unitful, UnitfulAtomic\nusing LinearAlgebra, Random, DisplayAs","category":"page"},{"location":"generated/ACE-aHfO2/fit-ace-ahfo2/","page":"Fit a-HfO2 dataset with ACE","title":"Fit a-HfO2 dataset with ACE","text":"Define paths.","category":"page"},{"location":"generated/ACE-aHfO2/fit-ace-ahfo2/","page":"Fit a-HfO2 dataset with ACE","title":"Fit a-HfO2 dataset with ACE","text":"base_path = haskey(ENV, \"BASE_PATH\") ? ENV[\"BASE_PATH\"] : \"../../\"\nds_path = \"$base_path/examples/data/a-HfO2/a-HfO2-300K-NVT-6000.extxyz\"\nres_path = \"$base_path/examples/ACE-aHfO2/results/\";\nnothing #hide","category":"page"},{"location":"generated/ACE-aHfO2/fit-ace-ahfo2/","page":"Fit a-HfO2 dataset with ACE","title":"Fit a-HfO2 dataset with ACE","text":"Load utility functions.","category":"page"},{"location":"generated/ACE-aHfO2/fit-ace-ahfo2/","page":"Fit a-HfO2 dataset with ACE","title":"Fit a-HfO2 dataset with ACE","text":"include(\"$base_path/examples/utils/utils.jl\")","category":"page"},{"location":"generated/ACE-aHfO2/fit-ace-ahfo2/","page":"Fit a-HfO2 dataset with ACE","title":"Fit a-HfO2 dataset with ACE","text":"Create experiment folder.","category":"page"},{"location":"generated/ACE-aHfO2/fit-ace-ahfo2/","page":"Fit a-HfO2 dataset with ACE","title":"Fit a-HfO2 dataset with ACE","text":"run(`mkdir -p $res_path`);\nnothing #hide","category":"page"},{"location":"generated/ACE-aHfO2/fit-ace-ahfo2/#Load-datasets","page":"Fit a-HfO2 dataset with ACE","title":"Load datasets","text":"","category":"section"},{"location":"generated/ACE-aHfO2/fit-ace-ahfo2/","page":"Fit a-HfO2 dataset with ACE","title":"Fit a-HfO2 dataset with ACE","text":"Load atomistic dataset: atomistic configurations (atom positions, geometry, etc.) + DFT data (energies, forces, etc.)","category":"page"},{"location":"generated/ACE-aHfO2/fit-ace-ahfo2/","page":"Fit a-HfO2 dataset with ACE","title":"Fit a-HfO2 dataset with ACE","text":"ds = load_data(ds_path, uparse(\"eV\"), uparse(\"Å\"))[1:1000]; # Load first 1K samples.\nnothing #hide","category":"page"},{"location":"generated/ACE-aHfO2/fit-ace-ahfo2/","page":"Fit a-HfO2 dataset with ACE","title":"Fit a-HfO2 dataset with ACE","text":"Split atomistic dataset into training and test.","category":"page"},{"location":"generated/ACE-aHfO2/fit-ace-ahfo2/","page":"Fit a-HfO2 dataset with ACE","title":"Fit a-HfO2 dataset with ACE","text":"n_train, n_test = 50, 50 # Only 50 samples per dataset are used in this example.\nconf_train, conf_test = split(ds, n_train, n_test)","category":"page"},{"location":"generated/ACE-aHfO2/fit-ace-ahfo2/#Compute-descriptors","page":"Fit a-HfO2 dataset with ACE","title":"Compute descriptors","text":"","category":"section"},{"location":"generated/ACE-aHfO2/fit-ace-ahfo2/","page":"Fit a-HfO2 dataset with ACE","title":"Fit a-HfO2 dataset with ACE","text":"Create and save ACE basis.","category":"page"},{"location":"generated/ACE-aHfO2/fit-ace-ahfo2/","page":"Fit a-HfO2 dataset with ACE","title":"Fit a-HfO2 dataset with ACE","text":"basis = ACE(species = [:Hf, :O],\n body_order = 3,\n polynomial_degree = 4,\n rcutoff = 5.0,\n wL = 1.0,\n csp = 1.0,\n r0 = 1.0)\n@save_var res_path basis;\nnothing #hide","category":"page"},{"location":"generated/ACE-aHfO2/fit-ace-ahfo2/","page":"Fit a-HfO2 dataset with ACE","title":"Fit a-HfO2 dataset with ACE","text":"Compute ACE descriptors for energy and forces based on the atomistic training configurations.","category":"page"},{"location":"generated/ACE-aHfO2/fit-ace-ahfo2/","page":"Fit a-HfO2 dataset with ACE","title":"Fit a-HfO2 dataset with ACE","text":"println(\"Computing energy descriptors of training dataset...\")\ne_descr_train = compute_local_descriptors(conf_train, basis;\n pbar=false)\nprintln(\"Computing force descriptors of training dataset...\")\nf_descr_train = compute_force_descriptors(conf_train, basis;\n pbar=false)","category":"page"},{"location":"generated/ACE-aHfO2/fit-ace-ahfo2/","page":"Fit a-HfO2 dataset with ACE","title":"Fit a-HfO2 dataset with ACE","text":"Update training dataset by adding energy and force descriptors.","category":"page"},{"location":"generated/ACE-aHfO2/fit-ace-ahfo2/","page":"Fit a-HfO2 dataset with ACE","title":"Fit a-HfO2 dataset with ACE","text":"ds_train = DataSet(conf_train .+ e_descr_train .+ f_descr_train);\nnothing #hide","category":"page"},{"location":"generated/ACE-aHfO2/fit-ace-ahfo2/#Learn-coefficients","page":"Fit a-HfO2 dataset with ACE","title":"Learn coefficients","text":"","category":"section"},{"location":"generated/ACE-aHfO2/fit-ace-ahfo2/","page":"Fit a-HfO2 dataset with ACE","title":"Fit a-HfO2 dataset with ACE","text":"Learn and save ACE coefficients based on ACE descriptors and DFT data.","category":"page"},{"location":"generated/ACE-aHfO2/fit-ace-ahfo2/","page":"Fit a-HfO2 dataset with ACE","title":"Fit a-HfO2 dataset with ACE","text":"println(\"Learning energies and forces...\")\nlb = LBasisPotential(basis)\nws, int = [1.0, 1.0], false\nlearn!(lb, ds_train, ws, int)\n@save_var res_path lb.β\n@save_var res_path lb.β0\nlb.β, lb.β0","category":"page"},{"location":"generated/ACE-aHfO2/fit-ace-ahfo2/#Post-process-results","page":"Fit a-HfO2 dataset with ACE","title":"Post-process results","text":"","category":"section"},{"location":"generated/ACE-aHfO2/fit-ace-ahfo2/","page":"Fit a-HfO2 dataset with ACE","title":"Fit a-HfO2 dataset with ACE","text":"Compute ACE descriptors for energy and forces based on the atomistic test configurations.","category":"page"},{"location":"generated/ACE-aHfO2/fit-ace-ahfo2/","page":"Fit a-HfO2 dataset with ACE","title":"Fit a-HfO2 dataset with ACE","text":"println(\"Computing energy descriptors of test dataset...\")\ne_descr_test = compute_local_descriptors(conf_test, basis;\n pbar = false)\nprintln(\"Computing force descriptors of test dataset...\")\nf_descr_test = compute_force_descriptors(conf_test, basis;\n pbar = false);\nnothing #hide","category":"page"},{"location":"generated/ACE-aHfO2/fit-ace-ahfo2/","page":"Fit a-HfO2 dataset with ACE","title":"Fit a-HfO2 dataset with ACE","text":"Update test dataset by adding energy and force descriptors.","category":"page"},{"location":"generated/ACE-aHfO2/fit-ace-ahfo2/","page":"Fit a-HfO2 dataset with ACE","title":"Fit a-HfO2 dataset with ACE","text":"ds_test = DataSet(conf_test .+ e_descr_test .+ f_descr_test);\nnothing #hide","category":"page"},{"location":"generated/ACE-aHfO2/fit-ace-ahfo2/","page":"Fit a-HfO2 dataset with ACE","title":"Fit a-HfO2 dataset with ACE","text":"Get and save true and predicted values for energies and forces.","category":"page"},{"location":"generated/ACE-aHfO2/fit-ace-ahfo2/","page":"Fit a-HfO2 dataset with ACE","title":"Fit a-HfO2 dataset with ACE","text":"n_atoms_train = length.(get_system.(ds_train))\nn_atoms_test = length.(get_system.(ds_test))\n\ne_train, e_train_pred = get_all_energies(ds_train) ./ n_atoms_train,\n get_all_energies(ds_train, lb) ./ n_atoms_train\nf_train, f_train_pred = get_all_forces(ds_train),\n get_all_forces(ds_train, lb)\n@save_var res_path e_train\n@save_var res_path e_train_pred\n@save_var res_path f_train\n@save_var res_path f_train_pred\n\ne_test, e_test_pred = get_all_energies(ds_test) ./ n_atoms_test,\n get_all_energies(ds_test, lb) ./ n_atoms_test\nf_test, f_test_pred = get_all_forces(ds_test),\n get_all_forces(ds_test, lb)\n@save_var res_path e_test\n@save_var res_path e_test_pred\n@save_var res_path f_test\n@save_var res_path f_test_pred;\nnothing #hide","category":"page"},{"location":"generated/ACE-aHfO2/fit-ace-ahfo2/","page":"Fit a-HfO2 dataset with ACE","title":"Fit a-HfO2 dataset with ACE","text":"Compute and save training metrics.","category":"page"},{"location":"generated/ACE-aHfO2/fit-ace-ahfo2/","page":"Fit a-HfO2 dataset with ACE","title":"Fit a-HfO2 dataset with ACE","text":"e_train_metrics = get_metrics(e_train, e_train_pred,\n metrics = [mae, rmse, rsq],\n label = \"e_train\")\nf_train_metrics = get_metrics(f_train, f_train_pred,\n metrics = [mae, rmse, rsq, mean_cos],\n label = \"f_train\")\ntrain_metrics = merge(e_train_metrics, f_train_metrics)\n@save_dict res_path train_metrics\ntrain_metrics","category":"page"},{"location":"generated/ACE-aHfO2/fit-ace-ahfo2/","page":"Fit a-HfO2 dataset with ACE","title":"Fit a-HfO2 dataset with ACE","text":"Compute and save test metrics.","category":"page"},{"location":"generated/ACE-aHfO2/fit-ace-ahfo2/","page":"Fit a-HfO2 dataset with ACE","title":"Fit a-HfO2 dataset with ACE","text":"e_test_metrics = get_metrics(e_test, e_test_pred,\n metrics = [mae, rmse, rsq],\n label = \"e_test\")\nf_test_metrics = get_metrics(f_test, f_test_pred,\n metrics = [mae, rmse, rsq, mean_cos],\n label = \"f_test\")\ntest_metrics = merge(e_test_metrics, f_test_metrics)\n@save_dict res_path test_metrics\ntest_metrics","category":"page"},{"location":"generated/ACE-aHfO2/fit-ace-ahfo2/","page":"Fit a-HfO2 dataset with ACE","title":"Fit a-HfO2 dataset with ACE","text":"Plot and save energy results.","category":"page"},{"location":"generated/ACE-aHfO2/fit-ace-ahfo2/","page":"Fit a-HfO2 dataset with ACE","title":"Fit a-HfO2 dataset with ACE","text":"e_plot = plot_energy(e_train, e_train_pred,\n e_test, e_test_pred)\n@save_fig res_path e_plot\nDisplayAs.PNG(e_plot)","category":"page"},{"location":"generated/ACE-aHfO2/fit-ace-ahfo2/","page":"Fit a-HfO2 dataset with ACE","title":"Fit a-HfO2 dataset with ACE","text":"Plot and save force results.","category":"page"},{"location":"generated/ACE-aHfO2/fit-ace-ahfo2/","page":"Fit a-HfO2 dataset with ACE","title":"Fit a-HfO2 dataset with ACE","text":"f_plot = plot_forces(f_train, f_train_pred,\n f_test, f_test_pred)\n@save_fig res_path f_plot\nDisplayAs.PNG(f_plot)","category":"page"},{"location":"generated/ACE-aHfO2/fit-ace-ahfo2/","page":"Fit a-HfO2 dataset with ACE","title":"Fit a-HfO2 dataset with ACE","text":"Plot and save training force cosine.","category":"page"},{"location":"generated/ACE-aHfO2/fit-ace-ahfo2/","page":"Fit a-HfO2 dataset with ACE","title":"Fit a-HfO2 dataset with ACE","text":"e_train_plot = plot_energy(e_train, e_train_pred)\nf_train_plot = plot_forces(f_train, f_train_pred)\nf_train_cos = plot_cos(f_train, f_train_pred)\n@save_fig res_path e_train_plot\n@save_fig res_path f_train_plot\n@save_fig res_path f_train_cos\nDisplayAs.PNG(f_train_cos)","category":"page"},{"location":"generated/ACE-aHfO2/fit-ace-ahfo2/","page":"Fit a-HfO2 dataset with ACE","title":"Fit a-HfO2 dataset with ACE","text":"Plot and save test force cosine.","category":"page"},{"location":"generated/ACE-aHfO2/fit-ace-ahfo2/","page":"Fit a-HfO2 dataset with ACE","title":"Fit a-HfO2 dataset with ACE","text":"e_test_plot = plot_energy(e_test, e_test_pred)\nf_test_plot = plot_forces(f_test, f_test_pred)\nf_test_cos = plot_cos(f_test, f_test_pred)\n@save_fig res_path e_test_plot\n@save_fig res_path f_test_plot\n@save_fig res_path f_test_cos\nDisplayAs.PNG(f_test_cos)","category":"page"},{"location":"generated/ACE-aHfO2/fit-ace-ahfo2/","page":"Fit a-HfO2 dataset with ACE","title":"Fit a-HfO2 dataset with ACE","text":"","category":"page"},{"location":"generated/ACE-aHfO2/fit-ace-ahfo2/","page":"Fit a-HfO2 dataset with ACE","title":"Fit a-HfO2 dataset with ACE","text":"This page was generated using Literate.jl.","category":"page"},{"location":"generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/","page":"Subsample a-HfO2 dataset with DPP and fit with ACE","title":"Subsample a-HfO2 dataset with DPP and fit with ACE","text":"EditURL = \"../../../../examples/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2.jl\"","category":"page"},{"location":"generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/#Subsample-a-HfO2-dataset-and-fit-with-ACE","page":"Subsample a-HfO2 dataset with DPP and fit with ACE","title":"Subsample a-HfO2 dataset and fit with ACE","text":"","category":"section"},{"location":"generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/#Setup-experiment","page":"Subsample a-HfO2 dataset with DPP and fit with ACE","title":"Setup experiment","text":"","category":"section"},{"location":"generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/","page":"Subsample a-HfO2 dataset with DPP and fit with ACE","title":"Subsample a-HfO2 dataset with DPP and fit with ACE","text":"Load packages.","category":"page"},{"location":"generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/","page":"Subsample a-HfO2 dataset with DPP and fit with ACE","title":"Subsample a-HfO2 dataset with DPP and fit with ACE","text":"using AtomsBase, InteratomicPotentials, PotentialLearning\nusing Unitful, UnitfulAtomic\nusing LinearAlgebra, Random, DisplayAs","category":"page"},{"location":"generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/","page":"Subsample a-HfO2 dataset with DPP and fit with ACE","title":"Subsample a-HfO2 dataset with DPP and fit with ACE","text":"Define paths.","category":"page"},{"location":"generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/","page":"Subsample a-HfO2 dataset with DPP and fit with ACE","title":"Subsample a-HfO2 dataset with DPP and fit with ACE","text":"base_path = haskey(ENV, \"BASE_PATH\") ? ENV[\"BASE_PATH\"] : \"../../\"\nds_path = \"$base_path/examples/data/a-HfO2/a-HfO2-300K-NVT-6000.extxyz\"\nres_path = \"$base_path/examples/DPP-ACE-aHfO2-1/results/\";\nnothing #hide","category":"page"},{"location":"generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/","page":"Subsample a-HfO2 dataset with DPP and fit with ACE","title":"Subsample a-HfO2 dataset with DPP and fit with ACE","text":"Load utility functions.","category":"page"},{"location":"generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/","page":"Subsample a-HfO2 dataset with DPP and fit with ACE","title":"Subsample a-HfO2 dataset with DPP and fit with ACE","text":"include(\"$base_path/examples/utils/utils.jl\");\nnothing #hide","category":"page"},{"location":"generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/","page":"Subsample a-HfO2 dataset with DPP and fit with ACE","title":"Subsample a-HfO2 dataset with DPP and fit with ACE","text":"Create experiment folder.","category":"page"},{"location":"generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/","page":"Subsample a-HfO2 dataset with DPP and fit with ACE","title":"Subsample a-HfO2 dataset with DPP and fit with ACE","text":"run(`mkdir -p $res_path`);\nnothing #hide","category":"page"},{"location":"generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/#Load-datasets","page":"Subsample a-HfO2 dataset with DPP and fit with ACE","title":"Load datasets","text":"","category":"section"},{"location":"generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/","page":"Subsample a-HfO2 dataset with DPP and fit with ACE","title":"Subsample a-HfO2 dataset with DPP and fit with ACE","text":"Load atomistic dataset: atomistic configurations (atom positions, geometry, etc.) + DFT data (energies, forces, etc.)","category":"page"},{"location":"generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/","page":"Subsample a-HfO2 dataset with DPP and fit with ACE","title":"Subsample a-HfO2 dataset with DPP and fit with ACE","text":"ds = load_data(ds_path, uparse(\"eV\"), uparse(\"Å\"))[1:1000]; # Load first 1K samples.\nnothing #hide","category":"page"},{"location":"generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/","page":"Subsample a-HfO2 dataset with DPP and fit with ACE","title":"Subsample a-HfO2 dataset with DPP and fit with ACE","text":"Split atomistic dataset into training and test","category":"page"},{"location":"generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/","page":"Subsample a-HfO2 dataset with DPP and fit with ACE","title":"Subsample a-HfO2 dataset with DPP and fit with ACE","text":"n_train, n_test = 100, 50 # Few samples per dataset are used in this example.\nconf_train, conf_test = split(ds, n_train, n_test)","category":"page"},{"location":"generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/#Subsample-dataset","page":"Subsample a-HfO2 dataset with DPP and fit with ACE","title":"Subsample dataset","text":"","category":"section"},{"location":"generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/","page":"Subsample a-HfO2 dataset with DPP and fit with ACE","title":"Subsample a-HfO2 dataset with DPP and fit with ACE","text":"Compute ACE descriptors for energies to be used as subsampling input.","category":"page"},{"location":"generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/","page":"Subsample a-HfO2 dataset with DPP and fit with ACE","title":"Subsample a-HfO2 dataset with DPP and fit with ACE","text":"basis = ACE(species = [:Hf, :O],\n body_order = 2,\n polynomial_degree = 3,\n rcutoff = 5.0,\n wL = 1.0,\n csp = 1.0,\n r0 = 1.0)\ne_descr = compute_local_descriptors(conf_train,\n basis,\n pbar = false);\nnothing #hide","category":"page"},{"location":"generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/","page":"Subsample a-HfO2 dataset with DPP and fit with ACE","title":"Subsample a-HfO2 dataset with DPP and fit with ACE","text":"Update subsampling dataset.","category":"page"},{"location":"generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/","page":"Subsample a-HfO2 dataset with DPP and fit with ACE","title":"Subsample a-HfO2 dataset with DPP and fit with ACE","text":"conf_train_kDPP = DataSet(conf_train .+ e_descr);\nnothing #hide","category":"page"},{"location":"generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/","page":"Subsample a-HfO2 dataset with DPP and fit with ACE","title":"Subsample a-HfO2 dataset with DPP and fit with ACE","text":"Create DPP subselector.","category":"page"},{"location":"generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/","page":"Subsample a-HfO2 dataset with DPP and fit with ACE","title":"Subsample a-HfO2 dataset with DPP and fit with ACE","text":"dataset_selector = kDPP( conf_train_kDPP,\n GlobalMean(),\n DotProduct();\n batch_size = 50)","category":"page"},{"location":"generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/","page":"Subsample a-HfO2 dataset with DPP and fit with ACE","title":"Subsample a-HfO2 dataset with DPP and fit with ACE","text":"Subsample trainig dataset.","category":"page"},{"location":"generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/","page":"Subsample a-HfO2 dataset with DPP and fit with ACE","title":"Subsample a-HfO2 dataset with DPP and fit with ACE","text":"inds = get_random_subset(dataset_selector)\nconf_train = @views conf_train[inds];\nnothing #hide","category":"page"},{"location":"generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/#Compute-descriptors","page":"Subsample a-HfO2 dataset with DPP and fit with ACE","title":"Compute descriptors","text":"","category":"section"},{"location":"generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/","page":"Subsample a-HfO2 dataset with DPP and fit with ACE","title":"Subsample a-HfO2 dataset with DPP and fit with ACE","text":"Create ACE basis.","category":"page"},{"location":"generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/","page":"Subsample a-HfO2 dataset with DPP and fit with ACE","title":"Subsample a-HfO2 dataset with DPP and fit with ACE","text":"basis = ACE(species = [:Hf, :O],\n body_order = 3,\n polynomial_degree = 4,\n rcutoff = 5.0,\n wL = 1.0,\n csp = 1.0,\n r0 = 1.0)\n@save_var res_path basis;\nnothing #hide","category":"page"},{"location":"generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/","page":"Subsample a-HfO2 dataset with DPP and fit with ACE","title":"Subsample a-HfO2 dataset with DPP and fit with ACE","text":"Compute ACE descriptors for energy and forces based on the atomistic training configurations.","category":"page"},{"location":"generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/","page":"Subsample a-HfO2 dataset with DPP and fit with ACE","title":"Subsample a-HfO2 dataset with DPP and fit with ACE","text":"println(\"Computing energy descriptors of training dataset...\")\ne_descr_train = compute_local_descriptors(conf_train, basis;\n pbar=false)\nprintln(\"Computing force descriptors of training dataset...\")\nf_descr_train = compute_force_descriptors(conf_train, basis;\n pbar=false)","category":"page"},{"location":"generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/","page":"Subsample a-HfO2 dataset with DPP and fit with ACE","title":"Subsample a-HfO2 dataset with DPP and fit with ACE","text":"Update training dataset by adding energy and force descriptors.","category":"page"},{"location":"generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/","page":"Subsample a-HfO2 dataset with DPP and fit with ACE","title":"Subsample a-HfO2 dataset with DPP and fit with ACE","text":"ds_train = DataSet(conf_train .+ e_descr_train .+ f_descr_train);\nnothing #hide","category":"page"},{"location":"generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/#Learn-coefficients","page":"Subsample a-HfO2 dataset with DPP and fit with ACE","title":"Learn coefficients","text":"","category":"section"},{"location":"generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/","page":"Subsample a-HfO2 dataset with DPP and fit with ACE","title":"Subsample a-HfO2 dataset with DPP and fit with ACE","text":"Learn ACE coefficients based on ACE descriptors and DFT data.","category":"page"},{"location":"generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/","page":"Subsample a-HfO2 dataset with DPP and fit with ACE","title":"Subsample a-HfO2 dataset with DPP and fit with ACE","text":"println(\"Learning energies and forces...\")\nlb = LBasisPotential(basis)\nws, int = [1.0, 1.0], false\nlearn!(lb, ds_train, ws, int)\n@save_var res_path lb.β\n@save_var res_path lb.β0\nlb.β, lb.β0","category":"page"},{"location":"generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/#Post-process-results","page":"Subsample a-HfO2 dataset with DPP and fit with ACE","title":"Post-process results","text":"","category":"section"},{"location":"generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/","page":"Subsample a-HfO2 dataset with DPP and fit with ACE","title":"Subsample a-HfO2 dataset with DPP and fit with ACE","text":"Compute ACE descriptors for energy and forces based on the atomistic test configurations.","category":"page"},{"location":"generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/","page":"Subsample a-HfO2 dataset with DPP and fit with ACE","title":"Subsample a-HfO2 dataset with DPP and fit with ACE","text":"println(\"Computing energy descriptors of test dataset...\")\ne_descr_test = compute_local_descriptors(conf_test, basis;\n pbar = false)\nprintln(\"Computing force descriptors of test dataset...\")\nf_descr_test = compute_force_descriptors(conf_test, basis;\n pbar = false);\nnothing #hide","category":"page"},{"location":"generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/","page":"Subsample a-HfO2 dataset with DPP and fit with ACE","title":"Subsample a-HfO2 dataset with DPP and fit with ACE","text":"Update test dataset by adding energy and force descriptors.","category":"page"},{"location":"generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/","page":"Subsample a-HfO2 dataset with DPP and fit with ACE","title":"Subsample a-HfO2 dataset with DPP and fit with ACE","text":"ds_test = DataSet(conf_test .+ e_descr_test .+ f_descr_test);\nnothing #hide","category":"page"},{"location":"generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/","page":"Subsample a-HfO2 dataset with DPP and fit with ACE","title":"Subsample a-HfO2 dataset with DPP and fit with ACE","text":"Get and save true and predicted values for energies and forces.","category":"page"},{"location":"generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/","page":"Subsample a-HfO2 dataset with DPP and fit with ACE","title":"Subsample a-HfO2 dataset with DPP and fit with ACE","text":"n_atoms_train = length.(get_system.(ds_train))\nn_atoms_test = length.(get_system.(ds_test))\n\ne_train, e_train_pred = get_all_energies(ds_train) ./ n_atoms_train,\n get_all_energies(ds_train, lb) ./ n_atoms_train\nf_train, f_train_pred = get_all_forces(ds_train),\n get_all_forces(ds_train, lb)\n@save_var res_path e_train\n@save_var res_path e_train_pred\n@save_var res_path f_train\n@save_var res_path f_train_pred\n\ne_test, e_test_pred = get_all_energies(ds_test) ./ n_atoms_test,\n get_all_energies(ds_test, lb) ./ n_atoms_test\nf_test, f_test_pred = get_all_forces(ds_test),\n get_all_forces(ds_test, lb)\n@save_var res_path e_test\n@save_var res_path e_test_pred\n@save_var res_path f_test\n@save_var res_path f_test_pred;\nnothing #hide","category":"page"},{"location":"generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/","page":"Subsample a-HfO2 dataset with DPP and fit with ACE","title":"Subsample a-HfO2 dataset with DPP and fit with ACE","text":"Compute and save training metrics.","category":"page"},{"location":"generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/","page":"Subsample a-HfO2 dataset with DPP and fit with ACE","title":"Subsample a-HfO2 dataset with DPP and fit with ACE","text":"e_train_metrics = get_metrics(e_train, e_train_pred,\n metrics = [mae, rmse, rsq],\n label = \"e_train\")\nf_train_metrics = get_metrics(f_train, f_train_pred,\n metrics = [mae, rmse, rsq, mean_cos],\n label = \"f_train\")\ntrain_metrics = merge(e_train_metrics, f_train_metrics)\n@save_dict res_path train_metrics\ntrain_metrics","category":"page"},{"location":"generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/","page":"Subsample a-HfO2 dataset with DPP and fit with ACE","title":"Subsample a-HfO2 dataset with DPP and fit with ACE","text":"Compute and save test metrics.","category":"page"},{"location":"generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/","page":"Subsample a-HfO2 dataset with DPP and fit with ACE","title":"Subsample a-HfO2 dataset with DPP and fit with ACE","text":"e_test_metrics = get_metrics(e_test, e_test_pred,\n metrics = [mae, rmse, rsq],\n label = \"e_test\")\nf_test_metrics = get_metrics(f_test, f_test_pred,\n metrics = [mae, rmse, rsq, mean_cos],\n label = \"f_test\")\ntest_metrics = merge(e_test_metrics, f_test_metrics)\n@save_dict res_path test_metrics\ntest_metrics","category":"page"},{"location":"generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/","page":"Subsample a-HfO2 dataset with DPP and fit with ACE","title":"Subsample a-HfO2 dataset with DPP and fit with ACE","text":"Plot and save energy results.","category":"page"},{"location":"generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/","page":"Subsample a-HfO2 dataset with DPP and fit with ACE","title":"Subsample a-HfO2 dataset with DPP and fit with ACE","text":"e_plot = plot_energy(e_train, e_train_pred,\n e_test, e_test_pred)\n@save_fig res_path e_plot\nDisplayAs.PNG(e_plot)","category":"page"},{"location":"generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/","page":"Subsample a-HfO2 dataset with DPP and fit with ACE","title":"Subsample a-HfO2 dataset with DPP and fit with ACE","text":"Plot and save force results.","category":"page"},{"location":"generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/","page":"Subsample a-HfO2 dataset with DPP and fit with ACE","title":"Subsample a-HfO2 dataset with DPP and fit with ACE","text":"f_plot = plot_forces(f_train, f_train_pred,\n f_test, f_test_pred)\n@save_fig res_path f_plot\nDisplayAs.PNG(f_plot)","category":"page"},{"location":"generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/","page":"Subsample a-HfO2 dataset with DPP and fit with ACE","title":"Subsample a-HfO2 dataset with DPP and fit with ACE","text":"Plot and save training force cosine.","category":"page"},{"location":"generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/","page":"Subsample a-HfO2 dataset with DPP and fit with ACE","title":"Subsample a-HfO2 dataset with DPP and fit with ACE","text":"e_train_plot = plot_energy(e_train, e_train_pred)\nf_train_plot = plot_forces(f_train, f_train_pred)\nf_train_cos = plot_cos(f_train, f_train_pred)\n@save_fig res_path e_train_plot\n@save_fig res_path f_train_plot\n@save_fig res_path f_train_cos\nDisplayAs.PNG(f_train_cos)","category":"page"},{"location":"generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/","page":"Subsample a-HfO2 dataset with DPP and fit with ACE","title":"Subsample a-HfO2 dataset with DPP and fit with ACE","text":"Plot and save test force cosine.","category":"page"},{"location":"generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/","page":"Subsample a-HfO2 dataset with DPP and fit with ACE","title":"Subsample a-HfO2 dataset with DPP and fit with ACE","text":"e_test_plot = plot_energy(e_test, e_test_pred)\nf_test_plot = plot_forces(f_test, f_test_pred)\nf_test_cos = plot_cos(f_test, f_test_pred)\n@save_fig res_path e_test_plot\n@save_fig res_path f_test_plot\n@save_fig res_path f_test_cos\nDisplayAs.PNG(f_test_cos)","category":"page"},{"location":"generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/","page":"Subsample a-HfO2 dataset with DPP and fit with ACE","title":"Subsample a-HfO2 dataset with DPP and fit with ACE","text":"","category":"page"},{"location":"generated/DPP-ACE-aHfO2-1/fit-dpp-ace-ahfo2/","page":"Subsample a-HfO2 dataset with DPP and fit with ACE","title":"Subsample a-HfO2 dataset with DPP and fit with ACE","text":"This page was generated using Literate.jl.","category":"page"},{"location":"api/#API-Reference","page":"API","title":"API Reference","text":"","category":"section"},{"location":"api/","page":"API","title":"API","text":"This page provides a list of all documented types and functions and in PotentialLearning.jl.","category":"page"},{"location":"api/","page":"API","title":"API","text":"Modules = [PotentialLearning]\nOrder = [:type, :function, :constant]","category":"page"},{"location":"api/#PotentialLearning.ActiveSubspace","page":"API","title":"PotentialLearning.ActiveSubspace","text":"ActiveSubspace{T<:Real} <: DimensionReducer\n Q :: Function \n ∇Q :: Function (gradient of Q)\n tol :: T\n\nUse 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.\n\n\n\n\n\n","category":"type"},{"location":"api/#PotentialLearning.AtomicData","page":"API","title":"PotentialLearning.AtomicData","text":"AtomicData <: Data\n\nAbstract type declaring the type of information that is unique to a particular atom (instead of a whole configuration).\n\n\n\n\n\n","category":"type"},{"location":"api/#PotentialLearning.Configuration-Tuple{Vararg{Union{ConfigurationData, AtomsBase.FlexibleSystem}}}","page":"API","title":"PotentialLearning.Configuration","text":"Configuration(data::Union{AtomsBase.FlexibleSystem, ConfigurationData} )\n\nA 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) '''\n\nConfigurations 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 '''\n\n\n\n\n\n","category":"method"},{"location":"api/#PotentialLearning.ConfigurationData","page":"API","title":"PotentialLearning.ConfigurationData","text":"ConfigurationData <: Data\n\nAbstract type declaring the type of data that is unique to a particular configuration (instead of just an atom).\n\n\n\n\n\n","category":"type"},{"location":"api/#PotentialLearning.CorrelationMatrix","page":"API","title":"PotentialLearning.CorrelationMatrix","text":"CorrelationMatrix \n α :: Vector{Float64} # weights\n\nCorrelationMatrix 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). \n\n\n\n\n\n","category":"type"},{"location":"api/#PotentialLearning.CovariateLinearProblem","page":"API","title":"PotentialLearning.CovariateLinearProblem","text":"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\n\nA 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 Σ. \n\n\n\n\n\n","category":"type"},{"location":"api/#PotentialLearning.DBSCANSelector","page":"API","title":"PotentialLearning.DBSCANSelector","text":"struct DBSCANSelector <: SubsetSelector\n clusters\n eps\n minpts\n sample_size\nend\n\nDefinition of the type DBSCANSelector, a subselector based on the clustering method DBSCAN.\n\n\n\n\n\n","category":"type"},{"location":"api/#PotentialLearning.DBSCANSelector-Tuple{DataSet, Any, Any, Any}","page":"API","title":"PotentialLearning.DBSCANSelector","text":"function DBSCANSelector(\n ds::DataSet,\n eps,\n minpts,\n sample_size\n)\n\nConstructor of DBSCANSelector based on the atomic configurations in ds, the DBSCAN params eps and minpts, and the sample size sample_size.\n\n\n\n\n\n","category":"method"},{"location":"api/#PotentialLearning.Data","page":"API","title":"PotentialLearning.Data","text":"Data\n\nAbstract supertype of ConfigurationData.\n\n\n\n\n\n","category":"type"},{"location":"api/#PotentialLearning.DataBase","page":"API","title":"PotentialLearning.DataBase","text":"DataBase\n\nAbstract type for DataSets. \n\n\n\n\n\n","category":"type"},{"location":"api/#PotentialLearning.DataSet","page":"API","title":"PotentialLearning.DataSet","text":"DataSet\n\nStruct that holds vector of configuration. Most operations in PotentialLearning are built around the DataSet structure.\n\n\n\n\n\n","category":"type"},{"location":"api/#PotentialLearning.Distance","page":"API","title":"PotentialLearning.Distance","text":"Distance\n\nA 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.\n\n\n\n\n\n","category":"type"},{"location":"api/#PotentialLearning.Divergence","page":"API","title":"PotentialLearning.Divergence","text":"Divergence\n\nA 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.\n\n\n\n\n\n","category":"type"},{"location":"api/#PotentialLearning.DotProduct","page":"API","title":"PotentialLearning.DotProduct","text":"DotProduct <: Kernel \n α :: Power of DotProduct kernel \n\n\nComputes the dot product kernel between two features, i.e.,\n\ncos(θ) = ( A ⋅ B / (||A||^2||B||^2) )^α\n\n\n\n\n\n","category":"type"},{"location":"api/#PotentialLearning.Energy","page":"API","title":"PotentialLearning.Energy","text":"Energy <: ConfigurationData\n d :: Real\n u :: Unitful.FreeUnits\n\nConvenience struct that holds energy information (and corresponding units). Default unit is eV\n\n\n\n\n\n","category":"type"},{"location":"api/#PotentialLearning.Euclidean","page":"API","title":"PotentialLearning.Euclidean","text":"Euclidean <: Distance \n Cinv :: Covariance Matrix \n\nComputes the squared euclidean distance with weight matrix Cinv, the inverse of some covariance matrix.\n\n\n\n\n\n","category":"type"},{"location":"api/#PotentialLearning.ExtXYZ","page":"API","title":"PotentialLearning.ExtXYZ","text":"ExtXYZ <: IO\n\n\n\n\n\n","category":"type"},{"location":"api/#PotentialLearning.Feature","page":"API","title":"PotentialLearning.Feature","text":"Feature\n\nA 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. \n\n\n\n\n\n","category":"type"},{"location":"api/#PotentialLearning.Force","page":"API","title":"PotentialLearning.Force","text":"Force <: AtomicData \n f :: Vector{<:Real}\n u :: Unitful.FreeUnits\n\nContains the force with (x,y,z)-components in f with units u. Default unit is \"eV/Å\". \n\n\n\n\n\n","category":"type"},{"location":"api/#PotentialLearning.ForceDescriptor","page":"API","title":"PotentialLearning.ForceDescriptor","text":"ForceDescriptor <: AtomicData\n b :: Vector{<:Vector{<:Real}}\n\nContains the x,y,z components (out vector) of the force descriptor (inner vector).\n\n\n\n\n\n","category":"type"},{"location":"api/#PotentialLearning.ForceDescriptors","page":"API","title":"PotentialLearning.ForceDescriptors","text":"ForceDescriptors <: ConfigurationData\n b :: Vector{ForceDescriptor}\n\nA container holding all of the ForceDescriptors for all atoms in a configuration.\n\n\n\n\n\n","category":"type"},{"location":"api/#PotentialLearning.Forces","page":"API","title":"PotentialLearning.Forces","text":"Forces <: ConfigurationData\n f :: Vector{force}\n\nForces is a struct that contains all force information in a configuration.\n\n\n\n\n\n","category":"type"},{"location":"api/#PotentialLearning.Forstner","page":"API","title":"PotentialLearning.Forstner","text":"Forstner <: Distance \n α :: Regularization parameter\n\nComputes the squared Forstner distance between two positive semi-definite matrices.\n\n\n\n\n\n","category":"type"},{"location":"api/#PotentialLearning.GlobalMean","page":"API","title":"PotentialLearning.GlobalMean","text":" GlobalMean{T}\n\nGlobalMean produces the mean of the local descriptors.\n\n\n\n\n\n","category":"type"},{"location":"api/#PotentialLearning.GlobalSum","page":"API","title":"PotentialLearning.GlobalSum","text":" GlobalSum{T}\n\nGlobalSum produces the sum of the local descriptors.\n\n\n\n\n\n","category":"type"},{"location":"api/#PotentialLearning.InverseMultiquadric","page":"API","title":"PotentialLearning.InverseMultiquadric","text":"InverseMultiquadric <: Kernel \n d :: Distance function \n c2 :: Squared constant parameter\n ℓ :: Length-scale parameter\n\nComputes the inverse multiquadric (IMQ) kernel, i.e.,\n\n k(A, B) = (c^2 + d(A,B)/β^2)^{-1/2}\n\n\n\n\n\n","category":"type"},{"location":"api/#PotentialLearning.Kernel","page":"API","title":"PotentialLearning.Kernel","text":"Kernel\n\nA 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.\n\n\n\n\n\n","category":"type"},{"location":"api/#PotentialLearning.KernelSteinDiscrepancy","page":"API","title":"PotentialLearning.KernelSteinDiscrepancy","text":"KernelSteinDiscrepancy <: Divergence\n score :: Function\n knl :: Kernel\n\nComputes 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.\n\n\n\n\n\n","category":"type"},{"location":"api/#PotentialLearning.LAMMPS","page":"API","title":"PotentialLearning.LAMMPS","text":"struct LAMMPS <: IO\n elements :: Vector{Symbol}\n boundary_conditions :: Vector\nend\n\n\n\n\n\n","category":"type"},{"location":"api/#PotentialLearning.LearningProblem","page":"API","title":"PotentialLearning.LearningProblem","text":"struct LearningProblem{T<:Real} <: AbstractLearningProblem ds::DataSet logprob::Function ∇logprob::Function params::Vector{T} end\n\nGeneric 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).\n\n\n\n\n\n","category":"type"},{"location":"api/#PotentialLearning.LearningProblem-Union{Tuple{T}, Tuple{DataSet, Function, Vector{T}}} where T","page":"API","title":"PotentialLearning.LearningProblem","text":"function LearningProblem( ds::DataSet, logprob::Function, params::Vector{T} ) where {T}\n\nGeneric LearningProblem construnctor.\n\n\n\n\n\n","category":"method"},{"location":"api/#PotentialLearning.LinearProblem","page":"API","title":"PotentialLearning.LinearProblem","text":"abstract type LinearProblem{T<:Real} <: AbstractLearningProblem end\n\nAn abstract type to specify linear potential inference problems. \n\n\n\n\n\n","category":"type"},{"location":"api/#PotentialLearning.LinearProblem-Tuple{DataSet}","page":"API","title":"PotentialLearning.LinearProblem","text":"function LinearProblem( ds::DataSet; T = Float64 )\n\nConstruct 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).\n\n\n\n\n\n","category":"method"},{"location":"api/#PotentialLearning.LocalDescriptor","page":"API","title":"PotentialLearning.LocalDescriptor","text":"LocalDescriptor <: AtomicData\n\nA vector corresponding to the descriptor for a particular atom's neighborhood.\n\n\n\n\n\n","category":"type"},{"location":"api/#PotentialLearning.LocalDescriptors","page":"API","title":"PotentialLearning.LocalDescriptors","text":"LocalDescriptors <: ConfigurationData\n\nA vector of LocalDescriptor, which now should represent all local descriptors for atoms in a configuration.\n\n\n\n\n\n","category":"type"},{"location":"api/#PotentialLearning.PCA","page":"API","title":"PotentialLearning.PCA","text":"PCA <: DimensionReducer\n tol :: Float64\n\nUse SVD to compute the PCA of the design matrix of descriptors. (using Force descriptors TBA)\n\nIf 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.\n\n\n\n\n\n","category":"type"},{"location":"api/#PotentialLearning.PCAState","page":"API","title":"PotentialLearning.PCAState","text":"PCAState <: DimensionReducer\n tol :: Float64\n\nUse SVD to compute the PCA of the design matrix of descriptors.\n\nIf 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.\n\n\n\n\n\n","category":"type"},{"location":"api/#PotentialLearning.RBF","page":"API","title":"PotentialLearning.RBF","text":"RBF <: Kernel \n d :: Distance function \n α :: Regularization parameter \n ℓ :: Length-scale parameter\n β :: Scale parameter\n\n\nComputes the squared exponential kernel, i.e.,\n\n k(A, B) = β \u001bxp( -\frac{1}{2} d(A,B)/ℓ^2 ) + α δ(A, B)\n\n\n\n\n\n","category":"type"},{"location":"api/#PotentialLearning.RandomSelector","page":"API","title":"PotentialLearning.RandomSelector","text":"struct Random\n num_configs :: Int \n batch_size :: Int \nend\n\nA convenience function that allows the user to randomly select indices uniformly over [1, num_configs]. \n\n\n\n\n\n","category":"type"},{"location":"api/#PotentialLearning.UnivariateLinearProblem","page":"API","title":"PotentialLearning.UnivariateLinearProblem","text":"struct UnivariateLinearProblem{T<:Real} <: LinearProblem{T} ivdata::Vector dvdata::Vector β::Vector{T} β0::Vector{T} σ::Vector{T} Σ::Symmetric{T,Matrix{T}} end\n\nA 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. \n\n\n\n\n\n","category":"type"},{"location":"api/#PotentialLearning.YAML","page":"API","title":"PotentialLearning.YAML","text":"YAML <: IO\n energy_units :: Unitful.FreeUnits\n distance_units :: Unitful.FreeUnits\n\n\n\n\n\n","category":"type"},{"location":"api/#PotentialLearning.kDPP","page":"API","title":"PotentialLearning.kDPP","text":"struct kDPP\n K :: EllEnsemble\nend\n\nA 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. \n\n\n\n\n\n","category":"type"},{"location":"api/#PotentialLearning.kDPP-Tuple{DataSet, Feature, Kernel}","page":"API","title":"PotentialLearning.kDPP","text":"kDPP(ds::Dataset, f::Feature, k::Kernel)\n\nA 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).\n\n\n\n\n\n","category":"method"},{"location":"api/#PotentialLearning.kDPP-Union{Tuple{T}, Tuple{Union{Array{Vector{T}, 1}, Array{LinearAlgebra.Symmetric{T, Matrix{T}}, 1}}, Kernel}} where T","page":"API","title":"PotentialLearning.kDPP","text":"kDPP(features::Union{Vector{Vector{T}}, Vector{Symmetric{T, Matrix{T}}}}, k::Kernel)\n\nA 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)).\n\n\n\n\n\n","category":"method"},{"location":"api/#InteratomicPotentials.compute_force_descriptors-Tuple{DataSet, InteratomicPotentials.BasisSystem}","page":"API","title":"InteratomicPotentials.compute_force_descriptors","text":"function computeforcedescriptors( ds::DataSet, basis::BasisSystem; pbar = true )\n\nCompute force descriptors of a basis system and dataset using threads.\n\n\n\n\n\n","category":"method"},{"location":"api/#InteratomicPotentials.compute_local_descriptors-Tuple{DataSet, InteratomicPotentials.BasisSystem}","page":"API","title":"InteratomicPotentials.compute_local_descriptors","text":"function computelocaldescriptors( ds::DataSet, basis::BasisSystem; pbar = true )\n\nds: dataset. basis: basis system (e.g. ACE) pbar: progress bar\n\nCompute local descriptors of a basis system and dataset using threads.\n\n\n\n\n\n","category":"method"},{"location":"api/#PotentialLearning.KernelMatrix-Tuple{DataSet, DataSet, Feature, Kernel}","page":"API","title":"PotentialLearning.KernelMatrix","text":"KernelMatrix(ds1::DataSet, ds2::DataSet, F::Feature, k::Kernel)\n\nCompute nonsymmetric kernel matrix K using features of the datasets ds1 and ds2 calculated using the Feature method F.\n\n\n\n\n\n","category":"method"},{"location":"api/#PotentialLearning.KernelMatrix-Tuple{DataSet, Feature, Kernel}","page":"API","title":"PotentialLearning.KernelMatrix","text":"KernelMatrix(ds::DataSet, F::Feature, k::Kernel)\n\nCompute symmetric kernel matrix K using features of the dataset ds calculated using the Feature method F. \n\n\n\n\n\n","category":"method"},{"location":"api/#PotentialLearning.KernelMatrix-Union{Tuple{T}, Tuple{Union{Array{Vector{T}, 1}, Array{LinearAlgebra.Symmetric{T, Matrix{T}}, 1}}, Kernel}} where T","page":"API","title":"PotentialLearning.KernelMatrix","text":"KernelMatrix(F, k::Kernel)\n\nCompute symmetric kernel matrix K where K{ij} = k(Fi, F_j). \n\n\n\n\n\n","category":"method"},{"location":"api/#PotentialLearning.KernelMatrix-Union{Tuple{T}, Tuple{Union{Array{Vector{T}, 1}, Array{LinearAlgebra.Symmetric{T, Matrix{T}}, 1}}, Union{Array{Vector{T}, 1}, Array{LinearAlgebra.Symmetric{T, Matrix{T}}, 1}}, Kernel}} where T","page":"API","title":"PotentialLearning.KernelMatrix","text":"KernelMatrix(F1, F2, k::Kernel)\n\nCompute non-symmetric kernel matrix K where K{ij} = k(F1i, F2_j). \n\n\n\n\n\n","category":"method"},{"location":"api/#PotentialLearning.calc_centroid-Tuple{Matrix{Float64}}","page":"API","title":"PotentialLearning.calc_centroid","text":"function calc_centroid(\n m::Array{Float64,2}\n)\n\nCalculate a centroid of a matrix.\n\n\n\n\n\n","category":"method"},{"location":"api/#PotentialLearning.calc_metrics-Tuple{Any, Any}","page":"API","title":"PotentialLearning.calc_metrics","text":"calc_metrics(x_pred, x)\n\nx_pred: vector of predicted values of a variable. E.g. energy. x: vector of true values of a variable. E.g. energy.\n\nReturns MAE, RMSE, and RSQ.\n\n\n\n\n\n","category":"method"},{"location":"api/#PotentialLearning.compute_distance-Union{Tuple{T}, Tuple{Vector{T}, Vector{T}, Euclidean}} where T<:Real","page":"API","title":"PotentialLearning.compute_distance","text":"compute_distance(A, B, d)\n\nCompute the distance between features A and B using distance metric d. \n\n\n\n\n\n","category":"method"},{"location":"api/#PotentialLearning.compute_features-Tuple{DataSet, Feature}","page":"API","title":"PotentialLearning.compute_features","text":"compute_feature(ds::DataSet, f::Feature; dt = LocalDescriptors)\n\nComputes features of the dataset ds using the feature method F on descriptors dt (default option are the LocalDescriptors, if available).\n\n\n\n\n\n","category":"method"},{"location":"api/#PotentialLearning.compute_gradx_distance-Union{Tuple{T}, Tuple{T, T, Euclidean}} where T<:(Vector{<:Real})","page":"API","title":"PotentialLearning.compute_gradx_distance","text":"compute_gradx_distance(A, B, d)\n\nCompute gradient of the distance between features A and B using distance metric d, with respect to the first argument (A). \n\n\n\n\n\n","category":"method"},{"location":"api/#PotentialLearning.compute_gradx_kernel-Union{Tuple{T}, Tuple{T, T, RBF}} where T<:(Vector{<:Real})","page":"API","title":"PotentialLearning.compute_gradx_kernel","text":"compute_gradx_kernel(A, B, k)\n\nCompute gradient of the kernel between features A and B using kernel k, with respect to the first argument (A). \n\n\n\n\n\n","category":"method"},{"location":"api/#PotentialLearning.compute_gradxy_distance-Union{Tuple{T}, Tuple{T, T, Euclidean}} where T<:(Vector{<:Real})","page":"API","title":"PotentialLearning.compute_gradxy_distance","text":"compute_gradxy_distance(A, B, d)\n\nCompute second-order cross derivative of the distance between features A and B using distance metric d. \n\n\n\n\n\n","category":"method"},{"location":"api/#PotentialLearning.compute_gradxy_kernel-Union{Tuple{T}, Tuple{T, T, RBF}} where T<:(Vector{<:Real})","page":"API","title":"PotentialLearning.compute_gradxy_kernel","text":"compute_gradxy_kernel(A, B, k)\n\nCompute the second-order cross derivative of the kernel between features A and B using kernel k. \n\n\n\n\n\n","category":"method"},{"location":"api/#PotentialLearning.compute_grady_distance-Union{Tuple{T}, Tuple{T, T, Euclidean}} where T<:(Vector{<:Real})","page":"API","title":"PotentialLearning.compute_grady_distance","text":"compute_grady_distance(A, B, d)\n\nCompute gradient of the distance between features A and B using distance metric d, with respect to the second argument (B). \n\n\n\n\n\n","category":"method"},{"location":"api/#PotentialLearning.compute_grady_kernel-Union{Tuple{T}, Tuple{T, T, RBF}} where T<:(Vector{<:Real})","page":"API","title":"PotentialLearning.compute_grady_kernel","text":"compute_grady_kernel(A, B, k)\n\nCompute gradient of the kernel between features A and B using kernel k, with respect to the second argument (B). \n\n\n\n\n\n","category":"method"},{"location":"api/#PotentialLearning.compute_kernel-Union{Tuple{T}, Tuple{T, T, RBF}} where T<:Union{LinearAlgebra.Symmetric{<:Real, <:Matrix{<:Real}}, Vector{<:Real}}","page":"API","title":"PotentialLearning.compute_kernel","text":"compute_kernel(A, B, k)\n\nCompute similarity kernel between features A and B using kernel k. \n\n\n\n\n\n","category":"method"},{"location":"api/#PotentialLearning.distance_matrix_kabsch-Tuple{DataSet}","page":"API","title":"PotentialLearning.distance_matrix_kabsch","text":"function distance_matrix_kabsch(\n ds::DataSet\n)\n\nCalculate a matrix of distances between atomic configurations using KABSCH method.\n\n\n\n\n\n","category":"method"},{"location":"api/#PotentialLearning.distance_matrix_periodic-Tuple{DataSet}","page":"API","title":"PotentialLearning.distance_matrix_periodic","text":"function distance_matrix_periodic(\n ds::DataSet\n)\n\nCalculates a matrix of distances between atomic configurations taking into account the periodic boundaries.\n\n\n\n\n\n","category":"method"},{"location":"api/#PotentialLearning.fit","page":"API","title":"PotentialLearning.fit","text":"fit(ds::DataSet, dr::DimensionReducer)\n\nFits a linear dimension reduction routine using information from DataSet. See individual types of DimensionReducers for specific details.\n\n\n\n\n\n","category":"function"},{"location":"api/#PotentialLearning.fit-Tuple{DataSet, ActiveSubspace}","page":"API","title":"PotentialLearning.fit","text":"fit(ds::DataSet, as::ActiveSubspace)\n\nFits 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.\n\n\n\n\n\n","category":"method"},{"location":"api/#PotentialLearning.fit-Tuple{DataSet, PCA}","page":"API","title":"PotentialLearning.fit","text":"fit(ds::DataSet, pca::PCA)\n\nFits a linear dimension reduction routine using PCA on the global descriptors in the dataset ds. \n\n\n\n\n\n","category":"method"},{"location":"api/#PotentialLearning.fit_transform-Tuple{DataSet, DimensionReducer}","page":"API","title":"PotentialLearning.fit_transform","text":"fit_transform(ds::DataSet, dr::DimensionReducer)\n\nFits 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.\n\n\n\n\n\n","category":"method"},{"location":"api/#PotentialLearning.force-Tuple{Configuration, InteratomicPotentials.BasisPotential}","page":"API","title":"PotentialLearning.force","text":"function force( c::Configuration, bp::BasisPotential )\n\nc: atomic configuration. bp: basis potential.\n\n\n\n\n\n","category":"method"},{"location":"api/#PotentialLearning.force-Tuple{Configuration, InteratomicPotentials.NNBasisPotential}","page":"API","title":"PotentialLearning.force","text":"function force( c::Configuration, nnbp::NNBasisPotential )\n\nc: atomic configuration. nnbp: neural network basis potential.\n\n\n\n\n\n","category":"method"},{"location":"api/#PotentialLearning.get_all_energies-Tuple{DataSet, InteratomicPotentials.BasisPotential}","page":"API","title":"PotentialLearning.get_all_energies","text":"function get_all_energies(\n ds::DataSet,\n bp::BasisPotential\n)\n\nds: dataset. bp: basis potential.\n\n\n\n\n\n","category":"method"},{"location":"api/#PotentialLearning.get_all_energies-Tuple{DataSet}","page":"API","title":"PotentialLearning.get_all_energies","text":"function getallenergies( ds::DataSet )\n\nds: dataset.\n\n\n\n\n\n","category":"method"},{"location":"api/#PotentialLearning.get_all_forces-Tuple{DataSet, InteratomicPotentials.BasisPotential}","page":"API","title":"PotentialLearning.get_all_forces","text":"function getallforces( ds::DataSet, bp::BasisPotential )\n\nds: dataset. bp: basis potential.\n\n\n\n\n\n","category":"method"},{"location":"api/#PotentialLearning.get_all_forces-Tuple{DataSet}","page":"API","title":"PotentialLearning.get_all_forces","text":"function get_all_forces(\n ds::DataSet\n)\n\nds: dataset.\n\n\n\n\n\n","category":"method"},{"location":"api/#PotentialLearning.get_batches-NTuple{11, Any}","page":"API","title":"PotentialLearning.get_batches","text":"get_batches(n_batches, B_train, B_train_ext, e_train, dB_train, f_train,\n B_test, B_test_ext, e_test, dB_test, f_test)\n\nn_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.\n\nReturns the data loaders for training and test of energies and forces.\n\n\n\n\n\n","category":"method"},{"location":"api/#PotentialLearning.get_clusters-Tuple{Any, Any, Any}","page":"API","title":"PotentialLearning.get_clusters","text":"function get_clusters(\n ds,\n eps,\n minpts\n)\n\nComputes clusters from the configurations in ds using DBSCAN with parameters eps and minpts.\n\n\n\n\n\n","category":"method"},{"location":"api/#PotentialLearning.get_dpp_mode-Tuple{kDPP}","page":"API","title":"PotentialLearning.get_dpp_mode","text":"get_dpp_mode(dpp::kDPP, batch_size::Int) <: Vector{Int64}\n\nAccess an approximate mode of the k-DPP as calculated by a greedy subset algorithm. See Determinantal.jl for details.\n\n\n\n\n\n","category":"method"},{"location":"api/#PotentialLearning.get_energy-Tuple{Configuration}","page":"API","title":"PotentialLearning.get_energy","text":"get_energy(c::Configuration) <: Energy\n\nRetrieves the energy (if available) in the Configuration c. \n\n\n\n\n\n","category":"method"},{"location":"api/#PotentialLearning.get_force_descriptors-Tuple{Configuration}","page":"API","title":"PotentialLearning.get_force_descriptors","text":"get_force_descriptors(c::Configuration) <: ForceDescriptors\n\nRetrieves the force descriptors (if available) in the Configuration c. \n\n\n\n\n\n","category":"method"},{"location":"api/#PotentialLearning.get_forces-Tuple{Configuration}","page":"API","title":"PotentialLearning.get_forces","text":"get_forces(c::Configuration) <: Forces\n\nRetrieves the forces (if available) in the Configuration c. \n\n\n\n\n\n","category":"method"},{"location":"api/#PotentialLearning.get_inclusion_prob-Tuple{kDPP}","page":"API","title":"PotentialLearning.get_inclusion_prob","text":"get_inclusion_prob(dpp::kDPP) <: Vector{Float64}\n\nAccess an approximation to the inclusion probabilities as calculated by Determinantal.jl (see package for details).\n\n\n\n\n\n","category":"method"},{"location":"api/#PotentialLearning.get_input-Tuple{Any}","page":"API","title":"PotentialLearning.get_input","text":"get_input(args)\n\nargs: vector of arguments (strings)\n\nReturns an OrderedDict with the arguments. See https://github.com/cesmix-mit/AtomisticComposableWorkflows documentation for information about how to define the input arguments.\n\n\n\n\n\n","category":"method"},{"location":"api/#PotentialLearning.get_local_descriptors-Tuple{Configuration}","page":"API","title":"PotentialLearning.get_local_descriptors","text":"get_local_descriptors(c::Configuration) <: LocalDescriptors\n\nRetrieves the local descriptors (if available) in the Configuration c. \n\n\n\n\n\n","category":"method"},{"location":"api/#PotentialLearning.get_metrics-NTuple{11, Any}","page":"API","title":"PotentialLearning.get_metrics","text":"get_metrics( e_train_pred, e_train, f_train_pred, f_train,\n e_test_pred, e_test, f_test_pred, f_test,\n B_time, dB_time, time_fitting)\n\ne_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.\n\nComputes 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.\n\n\n\n\n\n","category":"method"},{"location":"api/#PotentialLearning.get_metrics-NTuple{4, Any}","page":"API","title":"PotentialLearning.get_metrics","text":"get_metrics( e_train_pred, e_train, e_test_pred, e_test)\n\ne_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.\n\nComputes MAE, RMSE, and RSQ for training and testing energies. Returns an OrderedDict with the information above.\n\n\n\n\n\n","category":"method"},{"location":"api/#PotentialLearning.get_metrics-Tuple{Any, Any}","page":"API","title":"PotentialLearning.get_metrics","text":"get_metrics(\n x_pred,\n x;\n metrics = [mae, rmse, rsq],\n label = \"x\"\n)\n\nx_pred: vector of predicted forces, x: vector of true forces. metrics: vector of metrics. label: label used as prefix in dictionary keys.\n\nReturns and OrderedDict with different metrics.\n\n\n\n\n\n","category":"method"},{"location":"api/#PotentialLearning.get_positions-Tuple{Configuration}","page":"API","title":"PotentialLearning.get_positions","text":"get_positions(c::Configuration) <: Vector{SVector}\n\nRetrieves the AtomsBase system positions (if available) in the Configuration c. \n\n\n\n\n\n","category":"method"},{"location":"api/#PotentialLearning.get_random_subset","page":"API","title":"PotentialLearning.get_random_subset","text":"function get_random_subset(\n s::DBSCANSelector,\n batch_size = s.sample_size\n)\n\nReturns a random subset of indexes composed of samples of size batch_size ÷ length(s.clusters) from each cluster in s.\n\n\n\n\n\n","category":"function"},{"location":"api/#PotentialLearning.get_random_subset-2","page":"API","title":"PotentialLearning.get_random_subset","text":"get_random_subset(r::Random, batch_size :: Int) <: Vector{Int64}\n\nAccess a random subset of the data as sampled from the provided k-DPP. Returns the indices of the random subset and the subset itself.\n\n\n\n\n\n","category":"function"},{"location":"api/#PotentialLearning.get_random_subset-Tuple{kDPP}","page":"API","title":"PotentialLearning.get_random_subset","text":"get_random_subset(dpp::kDPP, batch_size :: Int) <: Vector{Int64}\n\nAccess a random subset of the data as sampled from the provided k-DPP. Returns the indices of the random subset and the subset itself.\n\n\n\n\n\n","category":"method"},{"location":"api/#PotentialLearning.get_species-Tuple{DataSet}","page":"API","title":"PotentialLearning.get_species","text":"function get_species( ds::DataSet )\n\nGet species from a dataset.\n\n\n\n\n\n","category":"method"},{"location":"api/#PotentialLearning.get_system-Tuple{Configuration}","page":"API","title":"PotentialLearning.get_system","text":"get_system(c::Configuration) <: AtomsBase.AbstractSystem\n\nRetrieves the AtomsBase system (if available) in the Configuration c. \n\n\n\n\n\n","category":"method"},{"location":"api/#PotentialLearning.get_values-Tuple{Energy}","page":"API","title":"PotentialLearning.get_values","text":"get_values(e::Energy) <: Real\n\nGet the underlying real value (= e.d)\n\n\n\n\n\n","category":"method"},{"location":"api/#PotentialLearning.get_values-Tuple{StaticArraysCore.SVector}","page":"API","title":"PotentialLearning.get_values","text":"get_values(v::SVector)\n\nRemoves units from a position.\n\n\n\n\n\n","category":"method"},{"location":"api/#PotentialLearning.hyperlearn!-Tuple{DataType, OrderedCollections.OrderedDict, DataSet}","page":"API","title":"PotentialLearning.hyperlearn!","text":"function hyperlearn!( model::DataType, pars::OrderedDict, conftrain::DataSet; nsamples = 5, sampler = RandomSampler(), loss = loss, ws = [1.0, 1.0], int = true )\n\nHyper-parameter optimization of linear interatomic potentials.\n\n\n\n\n\n","category":"method"},{"location":"api/#PotentialLearning.hyperloss-Tuple{OrderedCollections.OrderedDict}","page":"API","title":"PotentialLearning.hyperloss","text":"function hyperloss( metrics::OrderedDict: we = 1.0, wf = 1.0, wt = 1.0E-3, emaemax = 0.05, fmae_max = 0.05 )\n\nmetrics: OrderedDict object with metrics of the fitting process. - Mean absolute error of energies: emae. - Mean absolute error of forces: fmae. - Time per force per atom: timeus. `we: energy weight.wf: force weight.wt: time weight.emaemax: maximum mean absolute error for energies.fmaemax`: maximum mean absolute error for forces.\n\nLoss function for hyper-parameter optimization: minimizes fitting error and time.\n\n\n\n\n\n","category":"method"},{"location":"api/#PotentialLearning.kabsch-Tuple{Matrix{Float64}, Matrix{Float64}}","page":"API","title":"PotentialLearning.kabsch","text":"function kabsch(\n reference::Array{Float64,2},\n coords::Array{Float64,2}\n)\n\nInput: two sets of points: reference, coords as Nx3 Matrices (so) Returns optimally rotated matrix \n\n\n\n\n\n","category":"method"},{"location":"api/#PotentialLearning.kabsch_rmsd-Tuple{Matrix{Float64}, Matrix{Float64}}","page":"API","title":"PotentialLearning.kabsch_rmsd","text":"function kabsch_rmsd(\n P::Array{Float64,2},\n Q::Array{Float64,2}\n)\n\nDirectly return RMSD for matrices P, Q for convenience.\n\n\n\n\n\n","category":"method"},{"location":"api/#PotentialLearning.learn!-Tuple{InteratomicPotentials.LinearBasisPotential, DataSet, Vararg{Any}}","page":"API","title":"PotentialLearning.learn!","text":"function learn!( iap::InteratomicPotentials.LinearBasisPotential, ds::DataSet, args... )\n\nLearning dispatch function, common to ordinary and weghted least squares implementations.\n\n\n\n\n\n","category":"method"},{"location":"api/#PotentialLearning.learn!-Tuple{PotentialLearning.CovariateLinearProblem, Real}","page":"API","title":"PotentialLearning.learn!","text":"function learn!( lp::CovariateLinearProblem, α::Real )\n\nFit 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)\n\nthrough an optimization procedure. \n\n\n\n\n\n","category":"method"},{"location":"api/#PotentialLearning.learn!-Tuple{PotentialLearning.CovariateLinearProblem, SubsetSelector, Real}","page":"API","title":"PotentialLearning.learn!","text":"function learn!( lp::CovariateLinearProblem, ss::SubsetSelector, α::Real; num_steps=100, opt=Flux.Optimise.Adam() )\n\nFit 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)\n\nthrough an iterative batch gradient descent optimization proceedure where the batches are provided by the subset selector. \n\n\n\n\n\n","category":"method"},{"location":"api/#PotentialLearning.learn!-Tuple{PotentialLearning.CovariateLinearProblem, Vector, Bool}","page":"API","title":"PotentialLearning.learn!","text":"function learn!( lp::CovariateLinearProblem, ws::Vector, int::Bool )\n\nFit energies and forces using weighted least squares.\n\n\n\n\n\n","category":"method"},{"location":"api/#PotentialLearning.learn!-Tuple{PotentialLearning.LearningProblem, SubsetSelector}","page":"API","title":"PotentialLearning.learn!","text":"function learn!( lp::LearningProblem, ss::SubsetSelector; num_steps = 100::Int, opt = Flux.Optimisers.Adam() )\n\nAttempts 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. \n\n\n\n\n\n","category":"method"},{"location":"api/#PotentialLearning.learn!-Tuple{PotentialLearning.LearningProblem}","page":"API","title":"PotentialLearning.learn!","text":"function learn!( lp::LearningProblem; num_steps=100::Int, opt=Flux.Optimisers.Adam() )\n\nAttempts to fit the parameters lp.params in the learning problem lp using gradient descent with the optimizer opt and num_steps number of iterations.\n\n\n\n\n\n","category":"method"},{"location":"api/#PotentialLearning.learn!-Tuple{PotentialLearning.LinearProblem}","page":"API","title":"PotentialLearning.learn!","text":"function learn!( lp::LinearProblem )\n\nDefault learning problem: weighted least squares.\n\n\n\n\n\n","category":"method"},{"location":"api/#PotentialLearning.learn!-Tuple{PotentialLearning.UnivariateLinearProblem, Real}","page":"API","title":"PotentialLearning.learn!","text":"function learn!( lp::UnivariateLinearProblem, α::Real )\n\nFit 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. \n\n\n\n\n\n","category":"method"},{"location":"api/#PotentialLearning.learn!-Tuple{PotentialLearning.UnivariateLinearProblem, SubsetSelector, Real}","page":"API","title":"PotentialLearning.learn!","text":"function learn!( lp::UnivariateLinearProblem, ss::SubsetSelector, α::Real; num_steps = 100, opt = Flux.Optimise.Adam() )\n\nFit 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. \n\n\n\n\n\n","category":"method"},{"location":"api/#PotentialLearning.learn!-Tuple{PotentialLearning.UnivariateLinearProblem, Vector, Bool}","page":"API","title":"PotentialLearning.learn!","text":"function learn!( lp::UnivariateLinearProblem, ws::Vector, int::Bool )\n\nFit energies using weighted least squares.\n\n\n\n\n\n","category":"method"},{"location":"api/#PotentialLearning.linearize_forces-Tuple{Any}","page":"API","title":"PotentialLearning.linearize_forces","text":"linearize_forces(forces)\n\nforces: vector of forces per system\n\nReturns a vector with the components of the forces of the systems.\n\n\n\n\n\n","category":"method"},{"location":"api/#PotentialLearning.load_data-Tuple{Any, ExtXYZ}","page":"API","title":"PotentialLearning.load_data","text":"load_data(file::string, extxyz::ExtXYZ)\nLoad configuration from an extxyz file into a DataSet\n\n\n\n\n\n","category":"method"},{"location":"api/#PotentialLearning.load_data-Tuple{String, YAML}","page":"API","title":"PotentialLearning.load_data","text":"load_data(file::string, yaml::YAML)\n\nLoad configurations from a yaml file into a Vector of Flexible Systems, with Energies and Force.\nReturns \n ds - DataSet\n t = Vector{Dict} (any miscellaneous info from yaml file)\n\n\n\n\n\n","category":"method"},{"location":"api/#PotentialLearning.load_datasets-Tuple{Any}","page":"API","title":"PotentialLearning.load_datasets","text":"load_datasets(input)\n\ninput: OrderedDict with input arguments. See get_defaults_args().\n\nReturns training and test systems, energies, forces, and stresses.\n\n\n\n\n\n","category":"method"},{"location":"api/#PotentialLearning.mae-Tuple{Any, Any}","page":"API","title":"PotentialLearning.mae","text":"mae(x_pred, x)\n\nx_pred: vector of predicted values. E.g. predicted energies. x: vector of true values. E.g. DFT energies.\n\nReturns mean absolute error.\n\n\n\n\n\n","category":"method"},{"location":"api/#PotentialLearning.mean_cos-Tuple{Any, Any}","page":"API","title":"PotentialLearning.mean_cos","text":"mean_cos(x_pred, x)\n\nx_pred: vector of predicted forces, x: vector of true forces.\n\nReturns mean cosine.\n\n\n\n\n\n","category":"method"},{"location":"api/#PotentialLearning.periodic_rmsd-Tuple{Matrix{Float64}, Matrix{Float64}, Vector{Float64}}","page":"API","title":"PotentialLearning.periodic_rmsd","text":"function periodic_rmsd(\n p1::Array{Float64,2},\n p2::Array{Float64,2},\n box_lengths::Array{Float64,1}\n)\n\nCalculates the RMSD between atom positions of two configurations taking into account the periodic boundaries.\n\n\n\n\n\n","category":"method"},{"location":"api/#PotentialLearning.potential_energy-Tuple{Configuration, InteratomicPotentials.BasisPotential}","page":"API","title":"PotentialLearning.potential_energy","text":"function potential_energy( c::Configuration, bp::BasisPotential )\n\nc: atomic configuration. bp: basis potential.\n\n\n\n\n\n","category":"method"},{"location":"api/#PotentialLearning.potential_energy-Tuple{Configuration, InteratomicPotentials.NNBasisPotential}","page":"API","title":"PotentialLearning.potential_energy","text":"function potential_energy( c::Configuration, nnbp::NNBasisPotential )\n\nc: atomic configuration. nnbp: neural network basis potential.\n\n\n\n\n\n","category":"method"},{"location":"api/#PotentialLearning.rmsd-Tuple{Matrix{Float64}, Matrix{Float64}}","page":"API","title":"PotentialLearning.rmsd","text":"function rmsd(\n A::Array{Float64,2},\n B::Array{Float64,2}\n)\n\nCalculate root mean square deviation of two matrices A, B. See http://en.wikipedia.org/wiki/Root-mean-squaredeviationofatomicpositions\n\n\n\n\n\n","category":"method"},{"location":"api/#PotentialLearning.rmse-Tuple{Any, Any}","page":"API","title":"PotentialLearning.rmse","text":"rmse(x_pred, x)\n\nx_pred: vector of predicted values. E.g. predicted energies. x: vector of true values. E.g. DFT energies.\n\nReturns mean root mean square error.\n\n\n\n\n\n","category":"method"},{"location":"api/#PotentialLearning.rsq-Tuple{Any, Any}","page":"API","title":"PotentialLearning.rsq","text":"rsq(x_pred, x)\n\nx_pred: vector of predicted values. E.g. predicted energies. x: vector of true values. E.g. DFT energies.\n\nReturns R-squared.\n\n\n\n\n\n","category":"method"},{"location":"api/#PotentialLearning.sample-Tuple{Any, Any}","page":"API","title":"PotentialLearning.sample","text":"function sample(\n c,\n batch_size\n)\n\nSelect from cluster c a sample of size batch_size.\n\n\n\n\n\n","category":"method"},{"location":"api/#PotentialLearning.to_num-Tuple{Any}","page":"API","title":"PotentialLearning.to_num","text":"to_num(str)\n\nstr: string with a number: integer or float\n\nReturns an integer or float.\n\n\n\n\n\n","category":"method"},{"location":"api/#PotentialLearning.translate_points-Tuple{Matrix{Float64}, Matrix{Float64}}","page":"API","title":"PotentialLearning.translate_points","text":"function translate_points(\n P::Array{Float64,2},\n Q::Array{Float64,2}\n)\n\nTranslate 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\n\n\n\n\n\n","category":"method"},{"location":"generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/","page":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","title":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","text":"EditURL = \"../../../../examples/PCA-ACE-aHfO2/fit-pca-ace-ahfo2.jl\"","category":"page"},{"location":"generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/#Reduce-ACE-descriptors-with-PCA-and-fit-a-HfO2-dataset","page":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","title":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","text":"","category":"section"},{"location":"generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/#Setup-experiment","page":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","title":"Setup experiment","text":"","category":"section"},{"location":"generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/","page":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","title":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","text":"Load packages.","category":"page"},{"location":"generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/","page":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","title":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","text":"using AtomsBase, InteratomicPotentials, PotentialLearning\nusing Unitful, UnitfulAtomic\nusing LinearAlgebra, Random, DisplayAs","category":"page"},{"location":"generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/","page":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","title":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","text":"Define paths.","category":"page"},{"location":"generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/","page":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","title":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","text":"base_path = haskey(ENV, \"BASE_PATH\") ? ENV[\"BASE_PATH\"] : \"../../\"\nds_path = \"$base_path/examples/data/a-HfO2/a-HfO2-300K-NVT-6000.extxyz\"\nres_path = \"$base_path/examples/PCA-ACE-aHfO2/results/\";\nnothing #hide","category":"page"},{"location":"generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/","page":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","title":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","text":"Load utility functions.","category":"page"},{"location":"generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/","page":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","title":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","text":"include(\"$base_path/examples/utils/utils.jl\");\nnothing #hide","category":"page"},{"location":"generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/","page":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","title":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","text":"Create experiment folder.","category":"page"},{"location":"generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/","page":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","title":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","text":"run(`mkdir -p $res_path`);\nnothing #hide","category":"page"},{"location":"generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/#Load-datasets","page":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","title":"Load datasets","text":"","category":"section"},{"location":"generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/","page":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","title":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","text":"Load atomistic dataset: atomistic configurations (atom positions, geometry, etc.) + DFT data (energies, forces, etc.)","category":"page"},{"location":"generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/","page":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","title":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","text":"ds = load_data(ds_path, uparse(\"eV\"), uparse(\"Å\"))[1:1000]; # Load first 1K samples.\nnothing #hide","category":"page"},{"location":"generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/","page":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","title":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","text":"Split atomistic dataset into training and test.","category":"page"},{"location":"generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/","page":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","title":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","text":"n_train, n_test = 50, 50 # Only 50 samples per dataset are used in this example.\nconf_train, conf_test = split(ds, n_train, n_test)","category":"page"},{"location":"generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/#Compute-descriptors","page":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","title":"Compute descriptors","text":"","category":"section"},{"location":"generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/","page":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","title":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","text":"Create and save ACE basis.","category":"page"},{"location":"generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/","page":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","title":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","text":"basis = ACE(species = [:Hf, :O],\n body_order = 3,\n polynomial_degree = 4,\n rcutoff = 5.0,\n wL = 1.0,\n csp = 1.0,\n r0 = 1.0)\n@save_var res_path basis;\nnothing #hide","category":"page"},{"location":"generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/","page":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","title":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","text":"Compute ACE descriptors for energy and forces based on the atomistic training configurations.","category":"page"},{"location":"generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/","page":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","title":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","text":"println(\"Computing energy descriptors of training dataset...\")\ne_descr_train = compute_local_descriptors(conf_train, basis;\n pbar=false)\nprintln(\"Computing force descriptors of training dataset...\")\nf_descr_train = compute_force_descriptors(conf_train, basis;\n pbar=false)","category":"page"},{"location":"generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/","page":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","title":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","text":"Update training dataset by adding energy and force descriptors.","category":"page"},{"location":"generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/","page":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","title":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","text":"ds_train = DataSet(conf_train .+ e_descr_train .+ f_descr_train);\nnothing #hide","category":"page"},{"location":"generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/#Reduce-descriptor-dimension","page":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","title":"Reduce descriptor dimension","text":"","category":"section"},{"location":"generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/","page":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","title":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","text":"Reduce dimension of energy and force descriptors in the training dataset.","category":"page"},{"location":"generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/","page":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","title":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","text":"n_desc = 20\npca = PCAState(tol = n_desc)\nfit!(ds_train, pca)\ntransform!(ds_train, pca);\nnothing #hide","category":"page"},{"location":"generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/#Learn-coefficients","page":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","title":"Learn coefficients","text":"","category":"section"},{"location":"generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/","page":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","title":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","text":"Learn ACE coefficients based on ACE descriptors and DFT data.","category":"page"},{"location":"generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/","page":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","title":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","text":"println(\"Learning energies and forces...\")\nlb = LBasisPotential(basis)\nws, int = [1.0, 1.0], true\nlearn!(lb, ds_train, ws, int)\n@save_var res_path lb.β\n@save_var res_path lb.β0\nlb.β, lb.β0","category":"page"},{"location":"generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/#Post-process-results","page":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","title":"Post-process results","text":"","category":"section"},{"location":"generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/","page":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","title":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","text":"Compute ACE descriptors for energy and forces based on the atomistic test configurations.","category":"page"},{"location":"generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/","page":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","title":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","text":"println(\"Computing energy descriptors of test dataset...\")\ne_descr_test = compute_local_descriptors(conf_test, basis;\n pbar = false)\nprintln(\"Computing force descriptors of test dataset...\")\nf_descr_test = compute_force_descriptors(conf_test, basis;\n pbar = false);\nnothing #hide","category":"page"},{"location":"generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/","page":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","title":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","text":"Update test dataset by adding energy and force descriptors.","category":"page"},{"location":"generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/","page":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","title":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","text":"ds_test = DataSet(conf_test .+ e_descr_test .+ f_descr_test);\nnothing #hide","category":"page"},{"location":"generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/","page":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","title":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","text":"Dimension reduction of energy and force descriptors of test dataset.","category":"page"},{"location":"generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/","page":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","title":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","text":"transform!(ds_test, pca);\nnothing #hide","category":"page"},{"location":"generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/","page":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","title":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","text":"Get and save true and predicted values for energies and forces.","category":"page"},{"location":"generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/","page":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","title":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","text":"n_atoms_train = length.(get_system.(ds_train))\nn_atoms_test = length.(get_system.(ds_test))\n\ne_train, e_train_pred = get_all_energies(ds_train) ./ n_atoms_train,\n get_all_energies(ds_train, lb) ./ n_atoms_train\nf_train, f_train_pred = get_all_forces(ds_train),\n get_all_forces(ds_train, lb)\n@save_var res_path e_train\n@save_var res_path e_train_pred\n@save_var res_path f_train\n@save_var res_path f_train_pred\n\ne_test, e_test_pred = get_all_energies(ds_test) ./ n_atoms_test,\n get_all_energies(ds_test, lb) ./ n_atoms_test\nf_test, f_test_pred = get_all_forces(ds_test),\n get_all_forces(ds_test, lb)\n@save_var res_path e_test\n@save_var res_path e_test_pred\n@save_var res_path f_test\n@save_var res_path f_test_pred;\nnothing #hide","category":"page"},{"location":"generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/","page":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","title":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","text":"Compute and save training metrics.","category":"page"},{"location":"generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/","page":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","title":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","text":"e_train_metrics = get_metrics(e_train, e_train_pred,\n metrics = [mae, rmse, rsq],\n label = \"e_train\")\nf_train_metrics = get_metrics(f_train, f_train_pred,\n metrics = [mae, rmse, rsq, mean_cos],\n label = \"f_train\")\ntrain_metrics = merge(e_train_metrics, f_train_metrics)\n@save_dict res_path train_metrics\ntrain_metrics","category":"page"},{"location":"generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/","page":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","title":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","text":"Compute and save test metrics.","category":"page"},{"location":"generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/","page":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","title":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","text":"e_test_metrics = get_metrics(e_test, e_test_pred,\n metrics = [mae, rmse, rsq],\n label = \"e_test\")\nf_test_metrics = get_metrics(f_test, f_test_pred,\n metrics = [mae, rmse, rsq, mean_cos],\n label = \"f_test\")\ntest_metrics = merge(e_test_metrics, f_test_metrics)\n@save_dict res_path test_metrics\ntest_metrics","category":"page"},{"location":"generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/","page":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","title":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","text":"Plot and save energy results.","category":"page"},{"location":"generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/","page":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","title":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","text":"e_plot = plot_energy(e_train, e_train_pred,\n e_test, e_test_pred)\n@save_fig res_path e_plot\nDisplayAs.PNG(e_plot)","category":"page"},{"location":"generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/","page":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","title":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","text":"Plot and save force results.","category":"page"},{"location":"generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/","page":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","title":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","text":"f_plot = plot_forces(f_train, f_train_pred,\n f_test, f_test_pred)\n@save_fig res_path f_plot\nDisplayAs.PNG(f_plot)","category":"page"},{"location":"generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/","page":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","title":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","text":"Plot and save training force cosine.","category":"page"},{"location":"generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/","page":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","title":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","text":"e_train_plot = plot_energy(e_train, e_train_pred)\nf_train_plot = plot_forces(f_train, f_train_pred)\nf_train_cos = plot_cos(f_train, f_train_pred)\n@save_fig res_path e_train_plot\n@save_fig res_path f_train_plot\n@save_fig res_path f_train_cos\nDisplayAs.PNG(f_train_cos)","category":"page"},{"location":"generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/","page":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","title":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","text":"Plot and save test force cosine.","category":"page"},{"location":"generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/","page":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","title":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","text":"e_test_plot = plot_energy(e_test, e_test_pred)\nf_test_plot = plot_forces(f_test, f_test_pred)\nf_test_cos = plot_cos(f_test, f_test_pred)\n@save_fig res_path e_test_plot\n@save_fig res_path f_test_plot\n@save_fig res_path f_test_cos\nDisplayAs.PNG(f_test_cos)","category":"page"},{"location":"generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/","page":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","title":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","text":"","category":"page"},{"location":"generated/PCA-ACE-aHfO2/fit-pca-ace-ahfo2/","page":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","title":"Reduce ACE descriptors with PCA and fit a-HfO2 dataset","text":"This page was generated using Literate.jl.","category":"page"},{"location":"generated/Opt-ACE-aHfO2/fit-opt-ace-ahfo2/","page":"Optimize ACE hyper-parameters: minimize force time and fitting error","title":"Optimize ACE hyper-parameters: minimize force time and fitting error","text":"EditURL = \"../../../../examples/Opt-ACE-aHfO2/fit-opt-ace-ahfo2.jl\"","category":"page"},{"location":"generated/Opt-ACE-aHfO2/fit-opt-ace-ahfo2/#Optimize-ACE-hyper-parameters:-minimize-force-time-and-fitting-error.","page":"Optimize ACE hyper-parameters: minimize force time and fitting error","title":"Optimize ACE hyper-parameters: minimize force time and fitting error.","text":"","category":"section"},{"location":"generated/Opt-ACE-aHfO2/fit-opt-ace-ahfo2/#Setup-experiment","page":"Optimize ACE hyper-parameters: minimize force time and fitting error","title":"Setup experiment","text":"","category":"section"},{"location":"generated/Opt-ACE-aHfO2/fit-opt-ace-ahfo2/","page":"Optimize ACE hyper-parameters: minimize force time and fitting error","title":"Optimize ACE hyper-parameters: minimize force time and fitting error","text":"Load packages.","category":"page"},{"location":"generated/Opt-ACE-aHfO2/fit-opt-ace-ahfo2/","page":"Optimize ACE hyper-parameters: minimize force time and fitting error","title":"Optimize ACE hyper-parameters: minimize force time and fitting error","text":"using AtomsBase, InteratomicPotentials, PotentialLearning\nusing Unitful, UnitfulAtomic\nusing LinearAlgebra, Random, DisplayAs\nusing DataFrames, Hyperopt","category":"page"},{"location":"generated/Opt-ACE-aHfO2/fit-opt-ace-ahfo2/","page":"Optimize ACE hyper-parameters: minimize force time and fitting error","title":"Optimize ACE hyper-parameters: minimize force time and fitting error","text":"Define paths.","category":"page"},{"location":"generated/Opt-ACE-aHfO2/fit-opt-ace-ahfo2/","page":"Optimize ACE hyper-parameters: minimize force time and fitting error","title":"Optimize ACE hyper-parameters: minimize force time and fitting error","text":"base_path = haskey(ENV, \"BASE_PATH\") ? ENV[\"BASE_PATH\"] : \"../../\"\nds_path = \"$base_path/examples/data/a-HfO2/a-HfO2-300K-NVT-6000.extxyz\"\nres_path = \"$base_path/examples/Opt-ACE-aHfO2/results/\";\nnothing #hide","category":"page"},{"location":"generated/Opt-ACE-aHfO2/fit-opt-ace-ahfo2/","page":"Optimize ACE hyper-parameters: minimize force time and fitting error","title":"Optimize ACE hyper-parameters: minimize force time and fitting error","text":"Load utility functions.","category":"page"},{"location":"generated/Opt-ACE-aHfO2/fit-opt-ace-ahfo2/","page":"Optimize ACE hyper-parameters: minimize force time and fitting error","title":"Optimize ACE hyper-parameters: minimize force time and fitting error","text":"include(\"$base_path/examples/utils/utils.jl\");\nnothing #hide","category":"page"},{"location":"generated/Opt-ACE-aHfO2/fit-opt-ace-ahfo2/","page":"Optimize ACE hyper-parameters: minimize force time and fitting error","title":"Optimize ACE hyper-parameters: minimize force time and fitting error","text":"Create experiment folder.","category":"page"},{"location":"generated/Opt-ACE-aHfO2/fit-opt-ace-ahfo2/","page":"Optimize ACE hyper-parameters: minimize force time and fitting error","title":"Optimize ACE hyper-parameters: minimize force time and fitting error","text":"run(`mkdir -p $res_path`);\nnothing #hide","category":"page"},{"location":"generated/Opt-ACE-aHfO2/fit-opt-ace-ahfo2/#Load-datasets","page":"Optimize ACE hyper-parameters: minimize force time and fitting error","title":"Load datasets","text":"","category":"section"},{"location":"generated/Opt-ACE-aHfO2/fit-opt-ace-ahfo2/","page":"Optimize ACE hyper-parameters: minimize force time and fitting error","title":"Optimize ACE hyper-parameters: minimize force time and fitting error","text":"Load atomistic dataset: atomistic configurations (atom positions, geometry, etc.) + DFT data (energies, forces, etc.)","category":"page"},{"location":"generated/Opt-ACE-aHfO2/fit-opt-ace-ahfo2/","page":"Optimize ACE hyper-parameters: minimize force time and fitting error","title":"Optimize ACE hyper-parameters: minimize force time and fitting error","text":"ds = load_data(ds_path, uparse(\"eV\"), uparse(\"Å\"))[1:1000]; # Load first 1K samples.\nnothing #hide","category":"page"},{"location":"generated/Opt-ACE-aHfO2/fit-opt-ace-ahfo2/","page":"Optimize ACE hyper-parameters: minimize force time and fitting error","title":"Optimize ACE hyper-parameters: minimize force time and fitting error","text":"Split atomistic dataset into training and test","category":"page"},{"location":"generated/Opt-ACE-aHfO2/fit-opt-ace-ahfo2/","page":"Optimize ACE hyper-parameters: minimize force time and fitting error","title":"Optimize ACE hyper-parameters: minimize force time and fitting error","text":"n_train, n_test = 50, 50 # Only 50 samples per dataset are used in this example.\nconf_train, conf_test = split(ds, n_train, n_test)","category":"page"},{"location":"generated/Opt-ACE-aHfO2/fit-opt-ace-ahfo2/#Optimize-hyper-parameters","page":"Optimize ACE hyper-parameters: minimize force time and fitting error","title":"Optimize hyper-parameters","text":"","category":"section"},{"location":"generated/Opt-ACE-aHfO2/fit-opt-ace-ahfo2/","page":"Optimize ACE hyper-parameters: minimize force time and fitting error","title":"Optimize ACE hyper-parameters: minimize force time and fitting error","text":"Define a custom loss function. Here, we minimize fitting error and force calculation time. Possible metrics are e_mae, e_rmse, e_rsq, f_mae, f_rmse, f_rsq, and time_us.","category":"page"},{"location":"generated/Opt-ACE-aHfO2/fit-opt-ace-ahfo2/","page":"Optimize ACE hyper-parameters: minimize force time and fitting error","title":"Optimize ACE hyper-parameters: minimize force time and fitting error","text":"function custom_loss(\n metrics::OrderedDict\n)\n e_mae = metrics[:e_mae]\n f_mae = metrics[:f_mae]\n time_us = metrics[:time_us]\n e_mae_max = 0.05 # eV/atom\n f_mae_max = 0.05 # eV/Å\n w_e = e_mae/e_mae_max\n w_f = f_mae/f_mae_max\n w_t = 1.0E-3\n loss = w_e * e_mae + w_f * e_mae + w_t * time_us\n return loss\nend;\nnothing #hide","category":"page"},{"location":"generated/Opt-ACE-aHfO2/fit-opt-ace-ahfo2/","page":"Optimize ACE hyper-parameters: minimize force time and fitting error","title":"Optimize ACE hyper-parameters: minimize force time and fitting error","text":"Define model and hyper-parameter value ranges to be optimized.","category":"page"},{"location":"generated/Opt-ACE-aHfO2/fit-opt-ace-ahfo2/","page":"Optimize ACE hyper-parameters: minimize force time and fitting error","title":"Optimize ACE hyper-parameters: minimize force time and fitting error","text":"model = ACE\npars = OrderedDict( :body_order => [2, 3, 4],\n :polynomial_degree => [3, 4, 5],\n :rcutoff => LinRange(4, 6, 10),\n :wL => LinRange(0.5, 1.5, 10),\n :csp => LinRange(0.5, 1.5, 10),\n :r0 => LinRange(0.5, 1.5, 10));\nnothing #hide","category":"page"},{"location":"generated/Opt-ACE-aHfO2/fit-opt-ace-ahfo2/","page":"Optimize ACE hyper-parameters: minimize force time and fitting error","title":"Optimize ACE hyper-parameters: minimize force time and fitting error","text":"Use latin hypercube sampling to find the optimal hyper-parameters. Alternatively, use random sampling (sampler = RandomSampler()).","category":"page"},{"location":"generated/Opt-ACE-aHfO2/fit-opt-ace-ahfo2/","page":"Optimize ACE hyper-parameters: minimize force time and fitting error","title":"Optimize ACE hyper-parameters: minimize force time and fitting error","text":"sampler = CLHSampler(dims=[Categorical(3), Categorical(3), Continuous(),\n Continuous(), Continuous(), Continuous()])\niap, res = hyperlearn!(model, pars, conf_train;\n n_samples = 10, sampler = sampler,\n loss = custom_loss, ws = [1.0, 1.0], int = true);\nnothing #hide","category":"page"},{"location":"generated/Opt-ACE-aHfO2/fit-opt-ace-ahfo2/#Post-process-results","page":"Optimize ACE hyper-parameters: minimize force time and fitting error","title":"Post-process results","text":"","category":"section"},{"location":"generated/Opt-ACE-aHfO2/fit-opt-ace-ahfo2/","page":"Optimize ACE hyper-parameters: minimize force time and fitting error","title":"Optimize ACE hyper-parameters: minimize force time and fitting error","text":"Save and show results.","category":"page"},{"location":"generated/Opt-ACE-aHfO2/fit-opt-ace-ahfo2/","page":"Optimize ACE hyper-parameters: minimize force time and fitting error","title":"Optimize ACE hyper-parameters: minimize force time and fitting error","text":"@save_var res_path iap.β\n@save_var res_path iap.β0\n@save_var res_path iap.basis\n@save_dataframe res_path res\nres","category":"page"},{"location":"generated/Opt-ACE-aHfO2/fit-opt-ace-ahfo2/","page":"Optimize ACE hyper-parameters: minimize force time and fitting error","title":"Optimize ACE hyper-parameters: minimize force time and fitting error","text":"Plot error vs time.","category":"page"},{"location":"generated/Opt-ACE-aHfO2/fit-opt-ace-ahfo2/","page":"Optimize ACE hyper-parameters: minimize force time and fitting error","title":"Optimize ACE hyper-parameters: minimize force time and fitting error","text":"err_time = plot_err_time(res)\n@save_fig res_path err_time\nDisplayAs.PNG(err_time)","category":"page"},{"location":"generated/Opt-ACE-aHfO2/fit-opt-ace-ahfo2/","page":"Optimize ACE hyper-parameters: minimize force time and fitting error","title":"Optimize ACE hyper-parameters: minimize force time and fitting error","text":"","category":"page"},{"location":"generated/Opt-ACE-aHfO2/fit-opt-ace-ahfo2/","page":"Optimize ACE hyper-parameters: minimize force time and fitting error","title":"Optimize ACE hyper-parameters: minimize force time and fitting error","text":"This page was generated using Literate.jl.","category":"page"},{"location":"generated/DPP-ACE-Na/fit-dpp-ace-na/","page":"Subsample Na dataset with DPP and fit with ACE","title":"Subsample Na dataset with DPP and fit with ACE","text":"EditURL = \"../../../../examples/DPP-ACE-Na/fit-dpp-ace-na.jl\"","category":"page"},{"location":"generated/DPP-ACE-Na/fit-dpp-ace-na/#Subsample-Na-dataset-with-DPP-and-fit-energies-with-ACE","page":"Subsample Na dataset with DPP and fit with ACE","title":"Subsample Na dataset with DPP and fit energies with ACE","text":"","category":"section"},{"location":"generated/DPP-ACE-Na/fit-dpp-ace-na/#Setup-experiment","page":"Subsample Na dataset with DPP and fit with ACE","title":"Setup experiment","text":"","category":"section"},{"location":"generated/DPP-ACE-Na/fit-dpp-ace-na/","page":"Subsample Na dataset with DPP and fit with ACE","title":"Subsample Na dataset with DPP and fit with ACE","text":"Load packages.","category":"page"},{"location":"generated/DPP-ACE-Na/fit-dpp-ace-na/","page":"Subsample Na dataset with DPP and fit with ACE","title":"Subsample Na dataset with DPP and fit with ACE","text":"using Unitful, UnitfulAtomic\nusing AtomsBase, InteratomicPotentials, PotentialLearning\nusing LinearAlgebra, Plots","category":"page"},{"location":"generated/DPP-ACE-Na/fit-dpp-ace-na/","page":"Subsample Na dataset with DPP and fit with ACE","title":"Subsample Na dataset with DPP and fit with ACE","text":"Define paths.","category":"page"},{"location":"generated/DPP-ACE-Na/fit-dpp-ace-na/","page":"Subsample Na dataset with DPP and fit with ACE","title":"Subsample Na dataset with DPP and fit with ACE","text":"base_path = haskey(ENV, \"BASE_PATH\") ? ENV[\"BASE_PATH\"] : \"../../\"\nds_path = \"$base_path/examples/data/Na/liquify_sodium.yaml\";\nnothing #hide","category":"page"},{"location":"generated/DPP-ACE-Na/fit-dpp-ace-na/#Load-datasets","page":"Subsample Na dataset with DPP and fit with ACE","title":"Load datasets","text":"","category":"section"},{"location":"generated/DPP-ACE-Na/fit-dpp-ace-na/","page":"Subsample Na dataset with DPP and fit with ACE","title":"Subsample Na dataset with DPP and fit with ACE","text":"Load atomistic dataset: atomistic configurations (atom positions, geometry, etc.) + DFT data (energies, forces, etc.).","category":"page"},{"location":"generated/DPP-ACE-Na/fit-dpp-ace-na/","page":"Subsample Na dataset with DPP and fit with ACE","title":"Subsample Na dataset with DPP and fit with ACE","text":"confs, thermo = load_data(ds_path, YAML(:Na, u\"eV\", u\"Å\"))\nconfs, thermo = confs[220:end], thermo[220:end]","category":"page"},{"location":"generated/DPP-ACE-Na/fit-dpp-ace-na/","page":"Subsample Na dataset with DPP and fit with ACE","title":"Subsample Na dataset with DPP and fit with ACE","text":"Split atomistic dataset into training and test.","category":"page"},{"location":"generated/DPP-ACE-Na/fit-dpp-ace-na/","page":"Subsample Na dataset with DPP and fit with ACE","title":"Subsample Na dataset with DPP and fit with ACE","text":"conf_train, conf_test = confs[1:1000], confs[1001:end]","category":"page"},{"location":"generated/DPP-ACE-Na/fit-dpp-ace-na/#Compute-descriptors","page":"Subsample Na dataset with DPP and fit with ACE","title":"Compute descriptors","text":"","category":"section"},{"location":"generated/DPP-ACE-Na/fit-dpp-ace-na/","page":"Subsample Na dataset with DPP and fit with ACE","title":"Subsample Na dataset with DPP and fit with ACE","text":"Create ACE basis.","category":"page"},{"location":"generated/DPP-ACE-Na/fit-dpp-ace-na/","page":"Subsample Na dataset with DPP and fit with ACE","title":"Subsample Na dataset with DPP and fit with ACE","text":"ace = ACE(species = [:Na], # species\n body_order = 4, # 4-body\n polynomial_degree = 8, # 8 degree polynomials\n wL = 1.0, # Defaults, See ACE.jl documentation\n csp = 1.0, # Defaults, See ACE.jl documentation\n r0 = 1.0, # minimum distance between atoms\n rcutoff = 5.0); # cutoff radius\nnothing #hide","category":"page"},{"location":"generated/DPP-ACE-Na/fit-dpp-ace-na/","page":"Subsample Na dataset with DPP and fit with ACE","title":"Subsample Na dataset with DPP and fit with ACE","text":"Update training dataset by adding energy (local) descriptors.","category":"page"},{"location":"generated/DPP-ACE-Na/fit-dpp-ace-na/","page":"Subsample Na dataset with DPP and fit with ACE","title":"Subsample Na dataset with DPP and fit with ACE","text":"println(\"Computing local descriptors of training dataset\")\ne_descr_train = compute_local_descriptors(conf_train, ace) # JLD.load(\"data/sodium_empirical_full.jld\", \"descriptors\")","category":"page"},{"location":"generated/DPP-ACE-Na/fit-dpp-ace-na/","page":"Subsample Na dataset with DPP and fit with ACE","title":"Subsample Na dataset with DPP and fit with ACE","text":"Update training dataset by adding energy and force descriptors.","category":"page"},{"location":"generated/DPP-ACE-Na/fit-dpp-ace-na/","page":"Subsample Na dataset with DPP and fit with ACE","title":"Subsample Na dataset with DPP and fit with ACE","text":"ds_train = DataSet(conf_train .+ e_descr_train);\nnothing #hide","category":"page"},{"location":"generated/DPP-ACE-Na/fit-dpp-ace-na/#Subsample-dataset","page":"Subsample Na dataset with DPP and fit with ACE","title":"Subsample dataset","text":"","category":"section"},{"location":"generated/DPP-ACE-Na/fit-dpp-ace-na/","page":"Subsample Na dataset with DPP and fit with ACE","title":"Subsample Na dataset with DPP and fit with ACE","text":"Create DPP subselector.","category":"page"},{"location":"generated/DPP-ACE-Na/fit-dpp-ace-na/","page":"Subsample Na dataset with DPP and fit with ACE","title":"Subsample Na dataset with DPP and fit with ACE","text":"dpp = kDPP(ds_train, GlobalMean(), DotProduct(); batch_size = 200)","category":"page"},{"location":"generated/DPP-ACE-Na/fit-dpp-ace-na/","page":"Subsample Na dataset with DPP and fit with ACE","title":"Subsample Na dataset with DPP and fit with ACE","text":"Subsample trainig dataset.","category":"page"},{"location":"generated/DPP-ACE-Na/fit-dpp-ace-na/","page":"Subsample Na dataset with DPP and fit with ACE","title":"Subsample Na dataset with DPP and fit with ACE","text":"dpp_inds = get_random_subset(dpp);\nnothing #hide","category":"page"},{"location":"generated/DPP-ACE-Na/fit-dpp-ace-na/#Learn-coefficients","page":"Subsample Na dataset with DPP and fit with ACE","title":"Learn coefficients","text":"","category":"section"},{"location":"generated/DPP-ACE-Na/fit-dpp-ace-na/","page":"Subsample Na dataset with DPP and fit with ACE","title":"Subsample Na dataset with DPP and fit with ACE","text":"Learn ACE coefficients based on ACE descriptors and DFT data.","category":"page"},{"location":"generated/DPP-ACE-Na/fit-dpp-ace-na/","page":"Subsample Na dataset with DPP and fit with ACE","title":"Subsample Na dataset with DPP and fit with ACE","text":"lb = LBasisPotential(ace)\nα = 1e-8\nΣ = learn!(lb, ds_train[dpp_inds], α)","category":"page"},{"location":"generated/DPP-ACE-Na/fit-dpp-ace-na/#Post-process-results","page":"Subsample Na dataset with DPP and fit with ACE","title":"Post-process results","text":"","category":"section"},{"location":"generated/DPP-ACE-Na/fit-dpp-ace-na/","page":"Subsample Na dataset with DPP and fit with ACE","title":"Subsample Na dataset with DPP and fit with ACE","text":"Update test dataset by adding energy descriptors.","category":"page"},{"location":"generated/DPP-ACE-Na/fit-dpp-ace-na/","page":"Subsample Na dataset with DPP and fit with ACE","title":"Subsample Na dataset with DPP and fit with ACE","text":"println(\"Computing local descriptors of test dataset\")\ne_descr_test = compute_local_descriptors(conf_test, ace, pbar = false)\nds_test = DataSet(conf_test .+ e_descr_test);\nnothing #hide","category":"page"},{"location":"generated/DPP-ACE-Na/fit-dpp-ace-na/","page":"Subsample Na dataset with DPP and fit with ACE","title":"Subsample Na dataset with DPP and fit with ACE","text":"Get true and predicted energy values (assuming that all configurations have the same no. of atoms).","category":"page"},{"location":"generated/DPP-ACE-Na/fit-dpp-ace-na/","page":"Subsample Na dataset with DPP and fit with ACE","title":"Subsample Na dataset with DPP and fit with ACE","text":"n = size(get_system(ds_train[1]))[1]\ne_train, e_train_pred = get_all_energies(ds_train)/n, get_all_energies(ds_train, lb)/n\ne_test, e_test_pred = get_all_energies(ds_test)/n, get_all_energies(ds_test, lb)/n;\nnothing #hide","category":"page"},{"location":"generated/DPP-ACE-Na/fit-dpp-ace-na/","page":"Subsample Na dataset with DPP and fit with ACE","title":"Subsample Na dataset with DPP and fit with ACE","text":"Compute and print metrics.","category":"page"},{"location":"generated/DPP-ACE-Na/fit-dpp-ace-na/","page":"Subsample Na dataset with DPP and fit with ACE","title":"Subsample Na dataset with DPP and fit with ACE","text":"e_mae, e_rmse, e_rsq = calc_metrics(e_train, e_train_pred)\nprintln(\"MAE: $e_mae, RMSE: $e_rmse, RSQ: $e_rsq\")","category":"page"},{"location":"generated/DPP-ACE-Na/fit-dpp-ace-na/","page":"Subsample Na dataset with DPP and fit with ACE","title":"Subsample Na dataset with DPP and fit with ACE","text":"Plot energy error.","category":"page"},{"location":"generated/DPP-ACE-Na/fit-dpp-ace-na/","page":"Subsample Na dataset with DPP and fit with ACE","title":"Subsample Na dataset with DPP and fit with ACE","text":"e_err_train, e_err_test = (e_train_pred - e_train), (e_test_pred - e_test)\ndpp_inds2 = get_random_subset(dpp; batch_size = 20)\np = scatter( e_train, e_err_train, label = \"Training\", color = :blue,\n markersize = 1.5, markerstrokewidth=0)\nscatter!(e_test, e_err_test, label = \"Test\", color = :yellow,\n markersize = 1.5, markerstrokewidth=0)\nscatter!(e_train[dpp_inds2], e_err_train[dpp_inds2],\n color = :darkred, label = \"DPP Samples\",\n markersize = 2.5, markerstrokewidth=0)\nscatter!(xlabel = \"Energy (eV/atom)\", ylabel = \"Error (eV/atom)\",\n dpi = 1000, fontsize = 16)","category":"page"},{"location":"generated/DPP-ACE-Na/fit-dpp-ace-na/","page":"Subsample Na dataset with DPP and fit with ACE","title":"Subsample Na dataset with DPP and fit with ACE","text":"","category":"page"},{"location":"generated/DPP-ACE-Na/fit-dpp-ace-na/","page":"Subsample Na dataset with DPP and fit with ACE","title":"Subsample Na dataset with DPP and fit with ACE","text":"This page was generated using Literate.jl.","category":"page"},{"location":"generated/LJ-Ar/lennard-jones-ar/","page":"Load Ar+Lennard-Jones dataset and postprocess","title":"Load Ar+Lennard-Jones dataset and postprocess","text":"EditURL = \"../../../../examples/LJ-Ar/lennard-jones-ar.jl\"","category":"page"},{"location":"generated/LJ-Ar/lennard-jones-ar/#Load-Ar-dataset-with-energies-computed-by-Lennard-Jones-and-postprocess","page":"Load Ar+Lennard-Jones dataset and postprocess","title":"Load Ar dataset with energies computed by Lennard-Jones and postprocess","text":"","category":"section"},{"location":"generated/LJ-Ar/lennard-jones-ar/#Setup-experiment","page":"Load Ar+Lennard-Jones dataset and postprocess","title":"Setup experiment","text":"","category":"section"},{"location":"generated/LJ-Ar/lennard-jones-ar/","page":"Load Ar+Lennard-Jones dataset and postprocess","title":"Load Ar+Lennard-Jones dataset and postprocess","text":"Load packages.","category":"page"},{"location":"generated/LJ-Ar/lennard-jones-ar/","page":"Load Ar+Lennard-Jones dataset and postprocess","title":"Load Ar+Lennard-Jones dataset and postprocess","text":"using Unitful, UnitfulAtomic\nusing AtomsBase, InteratomicPotentials, PotentialLearning\nusing LinearAlgebra, Plots, DisplayAs","category":"page"},{"location":"generated/LJ-Ar/lennard-jones-ar/","page":"Load Ar+Lennard-Jones dataset and postprocess","title":"Load Ar+Lennard-Jones dataset and postprocess","text":"Define paths.","category":"page"},{"location":"generated/LJ-Ar/lennard-jones-ar/","page":"Load Ar+Lennard-Jones dataset and postprocess","title":"Load Ar+Lennard-Jones dataset and postprocess","text":"base_path = haskey(ENV, \"BASE_PATH\") ? ENV[\"BASE_PATH\"] : \"../../\"\nds_path = \"$base_path/examples/data/LJ-AR/lj-ar.yaml\";\nnothing #hide","category":"page"},{"location":"generated/LJ-Ar/lennard-jones-ar/#Load-datasets","page":"Load Ar+Lennard-Jones dataset and postprocess","title":"Load datasets","text":"","category":"section"},{"location":"generated/LJ-Ar/lennard-jones-ar/","page":"Load Ar+Lennard-Jones dataset and postprocess","title":"Load Ar+Lennard-Jones dataset and postprocess","text":"ds, thermo = load_data(ds_path, YAML(:Ar, u\"eV\", u\"Å\"))\nds = @views ds[2:end] # Filter first configuration (zero energy)","category":"page"},{"location":"generated/LJ-Ar/lennard-jones-ar/#Compute-distances,-energies,-and-time-range.","page":"Load Ar+Lennard-Jones dataset and postprocess","title":"Compute distances, energies, and time range.","text":"","category":"section"},{"location":"generated/LJ-Ar/lennard-jones-ar/","page":"Load Ar+Lennard-Jones dataset and postprocess","title":"Load Ar+Lennard-Jones dataset and postprocess","text":"Get atom positions and compute distance from origin.","category":"page"},{"location":"generated/LJ-Ar/lennard-jones-ar/","page":"Load Ar+Lennard-Jones dataset and postprocess","title":"Load Ar+Lennard-Jones dataset and postprocess","text":"systems = get_system.(ds)\nn_atoms = length(first(systems)) # Note: in this dataset all systems contain the same no. of atoms\npositions = position.(systems)\ndists_origin = map(x->ustrip.(norm.(x)), positions);\nnothing #hide","category":"page"},{"location":"generated/LJ-Ar/lennard-jones-ar/","page":"Load Ar+Lennard-Jones dataset and postprocess","title":"Load Ar+Lennard-Jones dataset and postprocess","text":"Extract LJ energies from dataset.","category":"page"},{"location":"generated/LJ-Ar/lennard-jones-ar/","page":"Load Ar+Lennard-Jones dataset and postprocess","title":"Load Ar+Lennard-Jones dataset and postprocess","text":"energies = get_values.(get_energy.(ds));\nnothing #hide","category":"page"},{"location":"generated/LJ-Ar/lennard-jones-ar/","page":"Load Ar+Lennard-Jones dataset and postprocess","title":"Load Ar+Lennard-Jones dataset and postprocess","text":"Define time range.","category":"page"},{"location":"generated/LJ-Ar/lennard-jones-ar/","page":"Load Ar+Lennard-Jones dataset and postprocess","title":"Load Ar+Lennard-Jones dataset and postprocess","text":"time_range = 0.5:0.5:5000;\nnothing #hide","category":"page"},{"location":"generated/LJ-Ar/lennard-jones-ar/#Post-process-results","page":"Load Ar+Lennard-Jones dataset and postprocess","title":"Post-process results","text":"","category":"section"},{"location":"generated/LJ-Ar/lennard-jones-ar/","page":"Load Ar+Lennard-Jones dataset and postprocess","title":"Load Ar+Lennard-Jones dataset and postprocess","text":"Plot distance from origin vs time.","category":"page"},{"location":"generated/LJ-Ar/lennard-jones-ar/","page":"Load Ar+Lennard-Jones dataset and postprocess","title":"Load Ar+Lennard-Jones dataset and postprocess","text":"p = plot(xlabel = \"τ | ps\",\n ylabel = \"Distance from origin | Å\",\n dpi = 300, fontsize = 12)\nfor i = 1:n_atoms\n plot!(time_range, map(x->x[i], dists_origin), label=\"\")\nend\nDisplayAs.PNG(p)","category":"page"},{"location":"generated/LJ-Ar/lennard-jones-ar/","page":"Load Ar+Lennard-Jones dataset and postprocess","title":"Load Ar+Lennard-Jones dataset and postprocess","text":"Plot LJ energies vs time.","category":"page"},{"location":"generated/LJ-Ar/lennard-jones-ar/","page":"Load Ar+Lennard-Jones dataset and postprocess","title":"Load Ar+Lennard-Jones dataset and postprocess","text":"p = plot(time_range, energies,\n xlabel = \"τ | ps\",\n ylabel = \"Lennard Jones energy | eV\",\n dpi = 300, fontsize = 12)\nDisplayAs.PNG(p)","category":"page"},{"location":"generated/LJ-Ar/lennard-jones-ar/","page":"Load Ar+Lennard-Jones dataset and postprocess","title":"Load Ar+Lennard-Jones dataset and postprocess","text":"","category":"page"},{"location":"generated/LJ-Ar/lennard-jones-ar/","page":"Load Ar+Lennard-Jones dataset and postprocess","title":"Load Ar+Lennard-Jones dataset and postprocess","text":"This page was generated using Literate.jl.","category":"page"},{"location":"#PotentialLearning.jl","page":"Home","title":"PotentialLearning.jl","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"Optimize your atomistic data and interatomic potential models in your molecular dynamic workflows.","category":"page"},{"location":"#Reduce-expensive-Density-functional-theory-calculations","page":"Home","title":"Reduce expensive Density functional theory calculations","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"Reduce expensive Density functional theory calculations while maintaining training accuracy by intelligently subsampling your atomistic dataset:","category":"page"},{"location":"","page":"Home","title":"Home","text":"1 - Subsample your atomistic configurations using a Determinantal Point Process (DPP) based algorithm that compares energy descriptors computed with the Atomic Cluster Expansion (ACE).","category":"page"},{"location":"","page":"Home","title":"Home","text":"ds = DataSet(conf_train .+ e_descr)\ndataset_selector = kDPP(ds, GlobalMean(), DotProduct())\ninds = get_random_subset(dataset_selector)\nconf_train = @views conf_train[inds]","category":"page"},{"location":"","page":"Home","title":"Home","text":"2 - Export the reduced dataset, use Density functional theory (DFT) on it, and fit your model.","category":"page"},{"location":"","page":"Home","title":"Home","text":"See example.","category":"page"},{"location":"","page":"Home","title":"Home","text":"We are working to provide different intelligent subsampling algorithms based on DPP, DBSCAN, and CUR; highly scalable parallel subsampling via hierarchical subsampling and distributed parallelism; and optimal subsampler selection.","category":"page"},{"location":"#Get-fast-and-accurate-interatomic-potential-models","page":"Home","title":"Get fast and accurate interatomic potential models","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"Get fast and accurate interatomic potential models through parallel multi-objective hyper-parameter optimization:","category":"page"},{"location":"","page":"Home","title":"Home","text":"1 - Define the interatomic potential model, hyper-parameter value ranges, and custom loss function. Then, optimize your model.","category":"page"},{"location":"","page":"Home","title":"Home","text":"model = ACE\npars = OrderedDict( :body_order => [2, 3, 4],\n :polynomial_degree => [3, 4, 5], ...)\nfunction custom_loss(metrics::OrderedDict)\n ...\n return w_e * e_mae + w_f * f_mae + w_t * time_us\nend\niap, res = hyperlearn!(model, pars, conf_train; loss = custom_loss);","category":"page"},{"location":"","page":"Home","title":"Home","text":"2 - Export optimal values to your molecular dynamic workflow.","category":"page"},{"location":"","page":"Home","title":"Home","text":"See example.","category":"page"},{"location":"","page":"Home","title":"Home","text":"The models are compatible with the interfaces of our sister package InteratomicPotentials.jl. In particular, we are interested in maintaining compatibility with ACESuit, as well as integrating LAMMPS based potentials such as ML-POD and ML-PACE. We are also working to provide neural network potential architecture optimization.","category":"page"},{"location":"#Compress-interatomic-potential-data-and-model","page":"Home","title":"Compress interatomic potential data and model","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"Compress interatomic potential data and model using dimensionality reduction of energy and force descriptors:","category":"page"},{"location":"","page":"Home","title":"Home","text":"1 - Define a PCA state, fit PCA with your the energy and force descriptors of your dataset, and transform all dataset descriptors.","category":"page"},{"location":"","page":"Home","title":"Home","text":"pca = PCAState(tol = n_desc)\nfit!(ds_train, pca)\ntransform!(ds_train, pca)","category":"page"},{"location":"","page":"Home","title":"Home","text":"2 - Export PCA fitted data to be used in your workflow.","category":"page"},{"location":"","page":"Home","title":"Home","text":"See example.","category":"page"},{"location":"","page":"Home","title":"Home","text":"We are working to provide feature selection of energy and force descriptors based on CUR.","category":"page"},{"location":"","page":"Home","title":"Home","text":"Additionally, this package includes utilities for loading input data (such as XYZ files), computing various metrics (including MAE, MSE, RSQ, and COV), exporting results, and generating plots.","category":"page"},{"location":"#Acknowledgment","page":"Home","title":"Acknowledgment","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"Center for the Exascale Simulation of Materials in Extreme Environments (CESMIX). Massachusetts Institute of Technology (MIT).","category":"page"},{"location":"install-and-run-examples/#Install-and-run-examples","page":"Install and run examples","title":"Install and run examples","text":"","category":"section"},{"location":"install-and-run-examples/#Add-registries","page":"Install and run examples","title":"Add registries","text":"","category":"section"},{"location":"install-and-run-examples/","page":"Install and run examples","title":"Install and run examples","text":"Open a Julia REPL ($ julia), type ] to enter the Pkg REPL, and add the following registries:","category":"page"},{"location":"install-and-run-examples/","page":"Install and run examples","title":"Install and run examples","text":" pkg> registry add https://github.com/JuliaRegistries/General\n pkg> registry add https://github.com/cesmix-mit/CESMIX.git \n pkg> registry add https://github.com/JuliaMolSim/MolSim.git\n pkg> registry add https://github.com/ACEsuit/ACEregistry","category":"page"},{"location":"install-and-run-examples/#Clone-repository-to-access-example-folders","page":"Install and run examples","title":"Clone repository to access example folders","text":"","category":"section"},{"location":"install-and-run-examples/","page":"Install and run examples","title":"Install and run examples","text":"Clone PotentialLearning.jl repository in your working directory.","category":"page"},{"location":"install-and-run-examples/","page":"Install and run examples","title":"Install and run examples","text":" $ git clone https://github.com/cesmix-mit/PotentialLearning.jl.git","category":"page"},{"location":"install-and-run-examples/","page":"Install and run examples","title":"Install and run examples","text":"Access to any folder within PotentialLearning.jl/examples. E.g.","category":"page"},{"location":"install-and-run-examples/","page":"Install and run examples","title":"Install and run examples","text":" $ cd PotentialLearning.jl/examples/DPP-ACE-aHfO2-1","category":"page"},{"location":"install-and-run-examples/#Run-example","page":"Install and run examples","title":"Run example","text":"","category":"section"},{"location":"install-and-run-examples/","page":"Install and run examples","title":"Install and run examples","text":"Open a Julia REPL, activate the examples folder project, and define the number of threads.","category":"page"},{"location":"install-and-run-examples/","page":"Install and run examples","title":"Install and run examples","text":" $ julia --project=./ --threads=4","category":"page"},{"location":"install-and-run-examples/","page":"Install and run examples","title":"Install and run examples","text":"Type ] to enter the Pkg REPL and instantiate.","category":"page"},{"location":"install-and-run-examples/","page":"Install and run examples","title":"Install and run examples","text":" pkg> instantiate","category":"page"},{"location":"install-and-run-examples/","page":"Install and run examples","title":"Install and run examples","text":"Finally, include the example file.","category":"page"},{"location":"install-and-run-examples/","page":"Install and run examples","title":"Install and run examples","text":" julia> include(\"fit-dpp-ace-ahfo2.jl\")","category":"page"},{"location":"generated/DPP-ACE-Si/fit-dpp-ace-si/","page":"Subsample Si dataset with DPP, fit with ACE, and cross validate","title":"Subsample Si dataset with DPP, fit with ACE, and cross validate","text":"EditURL = \"../../../../examples/DPP-ACE-Si/fit-dpp-ace-si.jl\"","category":"page"},{"location":"generated/DPP-ACE-Si/fit-dpp-ace-si/#Subsample-Si-dataset-and-fit-with-ACE","page":"Subsample Si dataset with DPP, fit with ACE, and cross validate","title":"Subsample Si dataset and fit with ACE","text":"","category":"section"},{"location":"generated/DPP-ACE-Si/fit-dpp-ace-si/#Setup-experiment","page":"Subsample Si dataset with DPP, fit with ACE, and cross validate","title":"Setup experiment","text":"","category":"section"},{"location":"generated/DPP-ACE-Si/fit-dpp-ace-si/","page":"Subsample Si dataset with DPP, fit with ACE, and cross validate","title":"Subsample Si dataset with DPP, fit with ACE, and cross validate","text":"Load packages.","category":"page"},{"location":"generated/DPP-ACE-Si/fit-dpp-ace-si/","page":"Subsample Si dataset with DPP, fit with ACE, and cross validate","title":"Subsample Si dataset with DPP, fit with ACE, and cross validate","text":"using LinearAlgebra, Random, InvertedIndices\nusing Statistics, StatsBase, Distributions, Determinantal\nusing Unitful, UnitfulAtomic\nusing AtomsBase, InteratomicPotentials, PotentialLearning\nusing CSV, JLD, DataFrames","category":"page"},{"location":"generated/DPP-ACE-Si/fit-dpp-ace-si/","page":"Subsample Si dataset with DPP, fit with ACE, and cross validate","title":"Subsample Si dataset with DPP, fit with ACE, and cross validate","text":"Define atomic type information.","category":"page"},{"location":"generated/DPP-ACE-Si/fit-dpp-ace-si/","page":"Subsample Si dataset with DPP, fit with ACE, and cross validate","title":"Subsample Si dataset with DPP, fit with ACE, and cross validate","text":"elname, elspec = \"Si\", [:Si];\nnothing #hide","category":"page"},{"location":"generated/DPP-ACE-Si/fit-dpp-ace-si/","page":"Subsample Si dataset with DPP, fit with ACE, and cross validate","title":"Subsample Si dataset with DPP, fit with ACE, and cross validate","text":"Define paths.","category":"page"},{"location":"generated/DPP-ACE-Si/fit-dpp-ace-si/","page":"Subsample Si dataset with DPP, fit with ACE, and cross validate","title":"Subsample Si dataset with DPP, fit with ACE, and cross validate","text":"base_path = haskey(ENV, \"BASE_PATH\") ? ENV[\"BASE_PATH\"] : \"../../\"\ninpath = \"$base_path/examples/data/Si-3Body-LAMMPS/\"\noutpath = \"$base_path/examples/DPP-ACE-Si/output/$elname/\"","category":"page"},{"location":"generated/DPP-ACE-Si/fit-dpp-ace-si/","page":"Subsample Si dataset with DPP, fit with ACE, and cross validate","title":"Subsample Si dataset with DPP, fit with ACE, and cross validate","text":"Load utility functions.","category":"page"},{"location":"generated/DPP-ACE-Si/fit-dpp-ace-si/","page":"Subsample Si dataset with DPP, fit with ACE, and cross validate","title":"Subsample Si dataset with DPP, fit with ACE, and cross validate","text":"include(\"$base_path/examples/DPP-ACE-Si/subsampling_utils.jl\");\nnothing #hide","category":"page"},{"location":"generated/DPP-ACE-Si/fit-dpp-ace-si/#Load-datasets","page":"Subsample Si dataset with DPP, fit with ACE, and cross validate","title":"Load datasets","text":"","category":"section"},{"location":"generated/DPP-ACE-Si/fit-dpp-ace-si/","page":"Subsample Si dataset with DPP, fit with ACE, and cross validate","title":"Subsample Si dataset with DPP, fit with ACE, and cross validate","text":"Load all atomistic datasets: atomistic configurations (atom positions, geometry, etc.) + DFT data (energies, forces, etc.)","category":"page"},{"location":"generated/DPP-ACE-Si/fit-dpp-ace-si/","page":"Subsample Si dataset with DPP, fit with ACE, and cross validate","title":"Subsample Si dataset with DPP, fit with ACE, and cross validate","text":"file_arr = readext(inpath, \"xyz\")\nnfile = length(file_arr)\nconfs_arr = [load_data(inpath*file, ExtXYZ(u\"eV\", u\"Å\")) for file in file_arr]\nconfs = concat_dataset(confs_arr)","category":"page"},{"location":"generated/DPP-ACE-Si/fit-dpp-ace-si/","page":"Subsample Si dataset with DPP, fit with ACE, and cross validate","title":"Subsample Si dataset with DPP, fit with ACE, and cross validate","text":"Id of configurations per file.","category":"page"},{"location":"generated/DPP-ACE-Si/fit-dpp-ace-si/","page":"Subsample Si dataset with DPP, fit with ACE, and cross validate","title":"Subsample Si dataset with DPP, fit with ACE, and cross validate","text":"n = 0\nconfs_id = Vector{Vector{Int64}}(undef, nfile)\nfor k = 1:nfile\n global n\n confs_id[k] = (n+1):(n+length(confs_arr[k]))\n n += length(confs_arr[k])\nend","category":"page"},{"location":"generated/DPP-ACE-Si/fit-dpp-ace-si/#Subsample-dataset","page":"Subsample Si dataset with DPP, fit with ACE, and cross validate","title":"Subsample dataset","text":"","category":"section"},{"location":"generated/DPP-ACE-Si/fit-dpp-ace-si/","page":"Subsample Si dataset with DPP, fit with ACE, and cross validate","title":"Subsample Si dataset with DPP, fit with ACE, and cross validate","text":"Create ACE basis.","category":"page"},{"location":"generated/DPP-ACE-Si/fit-dpp-ace-si/","page":"Subsample Si dataset with DPP, fit with ACE, and cross validate","title":"Subsample Si dataset with DPP, fit with ACE, and cross validate","text":"nbody = 4\ndeg = 5\nace = ACE(species = elspec, # species\n body_order = nbody, # n-body\n polynomial_degree = deg, # degree of polynomials\n wL = 1.0, # Defaults, See ACE.jl documentation\n csp = 1.0, # Defaults, See ACE.jl documentation\n r0 = 1.0, # minimum distance between atoms\n rcutoff = 10.0);\nnothing #hide","category":"page"},{"location":"generated/DPP-ACE-Si/fit-dpp-ace-si/","page":"Subsample Si dataset with DPP, fit with ACE, and cross validate","title":"Subsample Si dataset with DPP, fit with ACE, and cross validate","text":"Compute and save ACE descriptors for energies and forces.","category":"page"},{"location":"generated/DPP-ACE-Si/fit-dpp-ace-si/","page":"Subsample Si dataset with DPP, fit with ACE, and cross validate","title":"Subsample Si dataset with DPP, fit with ACE, and cross validate","text":"println(\"Computing local descriptors\")\ne_descr = compute_local_descriptors(confs, ace; pbar=false)\nf_descr = compute_force_descriptors(confs, ace; pbar=false)\nJLD.save(outpath*\"$(elname)_energy_descriptors.jld\", \"e_descr\", e_descr)\nJLD.save(outpath*\"$(elname)_force_descriptors.jld\", \"f_descr\", f_descr)","category":"page"},{"location":"generated/DPP-ACE-Si/fit-dpp-ace-si/","page":"Subsample Si dataset with DPP, fit with ACE, and cross validate","title":"Subsample Si dataset with DPP, fit with ACE, and cross validate","text":"Update training dataset by adding energy and force descriptors.","category":"page"},{"location":"generated/DPP-ACE-Si/fit-dpp-ace-si/","page":"Subsample Si dataset with DPP, fit with ACE, and cross validate","title":"Subsample Si dataset with DPP, fit with ACE, and cross validate","text":"ds = DataSet(confs .+ e_descr .+ f_descr)\nndata = length(ds);\nnothing #hide","category":"page"},{"location":"generated/DPP-ACE-Si/fit-dpp-ace-si/#Post-process-results","page":"Subsample Si dataset with DPP, fit with ACE, and cross validate","title":"Post-process results","text":"","category":"section"},{"location":"generated/DPP-ACE-Si/fit-dpp-ace-si/","page":"Subsample Si dataset with DPP, fit with ACE, and cross validate","title":"Subsample Si dataset with DPP, fit with ACE, and cross validate","text":"Compute cross validation error from training dataset.","category":"page"},{"location":"generated/DPP-ACE-Si/fit-dpp-ace-si/","page":"Subsample Si dataset with DPP, fit with ACE, and cross validate","title":"Subsample Si dataset with DPP, fit with ACE, and cross validate","text":"batch_size = [80, 40]\nsel_ind = Dict{Int64, Vector}()\ncond_num = Dict{Int64, Vector}()\n\nfor bs in batch_size\n println(\"=============== Starting batch size $bs ===============\")\n sel_ind[bs], cond_num[bs] = cross_validation_training(ds; ndiv=5, dpp_batch=bs)\n println(\"condnum: $(cond_num[bs])\")\nend\n\nJLD.save(outpath*\"$(elname)_ACE-$(nbody)-$(deg)_DPP_indices_and_condnum.jld\",\n \"ind\", sel_ind,\n \"condnum\", cond_num)","category":"page"},{"location":"generated/DPP-ACE-Si/fit-dpp-ace-si/","page":"Subsample Si dataset with DPP, fit with ACE, and cross validate","title":"Subsample Si dataset with DPP, fit with ACE, and cross validate","text":"","category":"page"},{"location":"generated/DPP-ACE-Si/fit-dpp-ace-si/","page":"Subsample Si dataset with DPP, fit with ACE, and cross validate","title":"Subsample Si dataset with DPP, fit with ACE, and cross validate","text":"This page was generated using Literate.jl.","category":"page"}] }