Addition Model

class graph_pes.models.AdditionModel(**models)[source]

Bases: GraphPESModel

A utility class for combining the predictions of multiple models.

This is particularly useful for e.g. combining an many-body model with an EnergyOffset model to account for the arbitrary per-atom energy offsets produced by labelling codes.

Parameters:

models (GraphPESModel) – the models (given with arbitrary names) to sum.

Examples

Create a model with an explicit offset, two-body and multi-body terms:

from graph_pes.models import LennardJones, SchNet, FixedOffset
from graph_pes.core import AdditionModel

model = AdditionModel(
    offset=FixedOffset(C=-45.6, H=-1.23),
    pair_wise=LennardJones(cutoff=5.0),
    many_body=SchNet(cutoff=3.0),
)
__getitem__(key)[source]

Get a component by name.

Examples

>>> model = AdditionModel(model1=model1, model2=model2)
>>> model["model1"]
Return type:

GraphPESModel