torchdrug.transforms#
- class Compose(transforms)[source]#
Compose a list of transforms into one. :param transforms: list of transforms :type transforms: list of callable
Graph Transformations#
TargetNormalize#
RandomBFSOrder#
Shuffle#
VirtualNode#
- class VirtualNode(relation=None, weight=1, node_feature=None, edge_feature=None, **kwargs)[source]#
Add a virtual node and connect it with every node in the graph.
- Parameters
relation (int, optional) – relation of virtual edges. By default, use the maximal relation in the graph plus 1.
weight (int, optional) – weight of virtual edges
node_feature (array_like, optional) – feature of the virtual node
edge_feature (array_like, optional) – feature of virtual edges
kwargs – other attributes of the virtual node or virtual edges
Molecule Transformations#
RemapAtomType#
VirtualAtom#
- class VirtualAtom(atom_type=None, bond_type=None, node_feature=None, edge_feature=None, **kwargs)[source]#
Add a virtual atom and connect it with every atom in the molecule. :param atom_type: type of the virtual atom :type atom_type: int, optional :param bond_type: type of the virtual bonds :type bond_type: int, optional :param node_feature: feature of the virtual atom :type node_feature: array_like, optional :param edge_feature: feature of virtual bonds :type edge_feature: array_like, optional :param kwargs: other attributes of the virtual atoms or virtual bonds