Energy Offset¶
- class graph_pes.models.offsets.EnergyOffset(offsets)[source]¶
Bases:
GraphPESModelA model that predicts the total energy as a sum of per-species offsets:
\[E(\mathcal{G}) = \sum_i \varepsilon_{Z_i}\]where \(\varepsilon_{Z_i}\) is the energy offset for atomic species \(Z_i\).
With our chemistry hat on, this is equivalent to a PerfectGas model: there is no contribution to the total energy from the interactions between atoms. Hence, this model generates zero for both force and stress predictions.
- Parameters:
offsets (PerElementParameter) – The energy offsets for each atomic species.
- class graph_pes.models.FixedOffset(**final_values)[source]¶
Bases:
EnergyOffsetAn
EnergyOffsetmodel with pre-defined and fixed energy offsets for each element. These do not change during training. Any element not specified in thefinal_valuesargument will be assigned an energy offset of zero.- Parameters:
final_values (float) – A dictionary mapping element symbols to fixed energy offset values.
Examples
>>> model = FixedOffset(H=-1.3, C=-13.0)
- class graph_pes.models.LearnableOffset(**initial_values)[source]¶
Bases:
EnergyOffsetAn
EnergyOffsetmodel with learnable energy offsets for each element.During pre-fitting, for each element in the training data not specified by the user, the model will estimate the energy offset from the data using ridge regression (see
guess_per_element_mean_and_var()).- Parameters:
initial_values (float) – A dictionary of initial energy offsets for each atomic species. Leave this empty to guess the offsets from the training data.
Examples
Estimate all relevant energy offsets from the training data:
>>> model = LearnableOffset() >>> # estimates offsets from data >>> model.pre_fit_all_components(training_data)
Specify some initial values for the energy offsets:
>>> model = LearnableOffset(H=0.0, C=-3.0) >>> # estimate offsets for elements that aren't C or H >>> model.pre_fit_all_components(training_data)
Tensor Offset¶
- class graph_pes.models.offsets.TensorOffset(offsets)[source]¶
Bases:
GraphTensorModelA model that predicts the atomic tensor
- Parameters:
offsets (PerElementParameter) – The tensor offsets for each atomic species.
- class graph_pes.models.FixedTensorOffset(**final_values)[source]¶
Bases:
TensorOffsetAn
TensorOffsetmodel with pre-defined and fixed tensor offsets for each element. These do not change during training. Any element not specified in thefinal_valuesargument will be assigned an tensor offset of zero.- Parameters:
final_values (float) – A dictionary mapping element symbols to fixed tensor offset values.
Examples
>>> model = FixedTensorOffset(H=[0.0, 1.0, 0.1], C=[-3.0, 0.0, 0.0])
- class graph_pes.models.LearnableTensorOffset(length, **initial_values)[source]¶
Bases:
TensorOffsetAn
TensorOffsetmodel with learnable tensor elements offsets for each element.During pre-fitting, for each element in the training data not specified by the user, the model will estimate the tensor offset from the data using ridge regression (see
guess_per_element_mean_and_var()).- Parameters:
Examples
Estimate all relevant tensor offsets from the training data:
>>> model = LearnableTensorOffset() >>> # estimates offsets from data >>> model.pre_fit_all_components(training_data)
Specify some initial values for the tensor offsets:
>>> model = LearnableTensorOffset(length=3, H=[0.0, 1.0, 0.1], C=[-3.0, 0.0, 0.0]) >>> # estimate offsets for elements that aren't C or H >>> model.pre_fit_all_components(training_data)