GAP¶
This is an implementation of the sparse Gaussian Approximation Potential (GAP) [1] using Smooth Overlap of Atomic Positions (SOAP) [2] implemented in featomic.
The GAP model in metatrain can only train on CPU, but evaluation is also supported on GPU.
Installation¶
To install the package, you can run the following command in the root directory of the repository:
pip install metatrain[gap]
This will install the package with the GAP dependencies.
Default Hyperparameters¶
The default hyperparameters for the GAP model are:
architecture:
name: gap
model:
soap:
cutoff:
radius: 5.0
smoothing:
type: ShiftedCosine
width: 1.0
density:
type: Gaussian
center_atom_weight: 1.0
width: 0.3
scaling:
type: Willatt2018
rate: 1.0
scale: 2.0
exponent: 7.0
basis:
type: TensorProduct
max_angular: 6
radial:
type: Gto
max_radial: 7
krr:
degree: 2
num_sparse_points: 500
zbl: false
training:
regularizer: 0.001
regularizer_forces: null
Tuning Hyperparameters¶
The default hyperparameters above will work well in most cases, but they may not be optimal for your specific dataset. In general, the most important hyperparameters to tune are (in decreasing order of importance):
cutoff
: This should be set to a value after which most of the interactions between atoms is expected to be negligible.num_sparse_points
: Number of sparse points to use during the training, it select the number of actual samples to use during the training. The selection is done with the Further Point Sampling (FPS) algorithm. The optimal number of sparse points depends on the system. Increasing it might impreve the accuracy, but it also increase the memory and time required for training.regularizer
: Value of the regularizer for the energy. It should be tuned depending on the specific dataset. If it is too small might lead to overfitting, if it is too big might lead to bad accuracy.regularizer_forces
: Value of the regularizer for the forces. It has a similar effect asregularizer
. By default is set equal toregularizer
. It might be changed to have better accuracy.max_radial
,max_angular
: These hyperparameters control the size and depth of the SOAP descriptors, in particular the total number of radial and angular channels. In general, increasing these hyperparameters might lead to better accuracy, especially on larger datasets, at the cost of increased training and evaluation time.radial_scaling
hyperparameters: These hyperparameters control the radial scaling of the SOAP descriptor. In general, the default values should work well, but they might need to be adjusted for specific datasets.degree
: degree of the kernel. For now, only 2 is allowed.
Architecture Hyperparameters¶
- param name:
gap
model¶
soap¶
- param cutoff:
Spherical cutoff (Å) to use for atomic environments. Default 5.0
- param max_radial:
Number of radial basis function to use. Default 8
- param max_angular:
Number of angular basis function to use also denoted by the maximum degree of spherical harmonics. Default 6
- param atomic_gaussian_width:
Width of the atom-centered gaussian creating the atomic density. Default 0.3
- param center_atom_weight:
Weight of the central atom contribution to the features. If 1.0 the center atom contribution is weighted the same as any other contribution. If 0.0 the central atom does not contribute to the features at all. Default 1.0
- param cutoff_function:
cutoff function used to smooth the behavior around the cutoff radius. The supported cutoff function are
Step
: Step function, 1 ifr < cutoff
and 0 ifr >= cutoff
. This cutoff function takes no additional parameters and can set as in.yaml
file:cutoff_function: Step:
ShiftedCosine
(Default value): Shifted cosine switching functionf(r) = 1/2 * (1 + cos(π (r- cutoff + width) / width ))
. This cutoff function takes thewidth`
as additional parameter and can set as inoptions.yaml
file as:cutoff_function: ShiftedCosine: width: 1.0
- param radial_scaling:
Radial scaling can be used to reduce the importance of neighbor atoms further away from the center, usually improving the performance of the model. The supported radial scaling functions are
None
: No radial scaling.radial_scaling: None:
Willatt2018
(Default value): Use a long-range algebraic decay and smooth behavior at \(r \rightarrow 0\): as introduced by Willatt et al.[3] asf(r) = rate / (rate + (r / scale) ^ exponent)
This radial scaling function can be set in theoptions.yaml
file as.radial_scaling: Willatt2018: rate: 1.0 scale: 2.0 exponent: 7.0
Note
Currently, we only support a Gaussian type orbitals (GTO) as radial basis functions and radial integrals.
krr¶
- param degree:
degree of the polynomial kernel. Default 2
- param num_sparse_points:
number of pseudo points to select (by farthest point sampling). Default 500
training:¶
- param regularizer:
value of the energy regularizer. Default 0.001
- param regularizer_forces:
value of the forces regularizer. Default null