- model openff.nagl.features.Feature
Abstract base class for atom and bond features.
Features with length one can simply inherit
_encode, and define
name. Complex features should additionally define the
_feature_lengthclass attribute and set it to the length of the feature.
- encode(molecule: Molecule) Tensor
Encode the molecule feature into a tensor.
The output of this method must have shape
tensor_shape. Subclasses may instead implement a
_encodemethod with the same signature as this one. The default implementation of this method will call that one and guarantee an appropriate shape.