Energy Offset¶
- class graph_pes.models.offsets.EnergyOffset(offsets)[source]¶
Bases:
GraphPESModel
A 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:
EnergyOffset
An
EnergyOffset
model with pre-defined and fixed energy offsets for each element. These do not change during training. Any element not specified in thefinal_values
argument 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:
EnergyOffset
An
EnergyOffset
model 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)