chemprop.data.collate#
Classes#
A |
|
A |
|
Functions#
|
|
|
|
|
|
|
Module Contents#
- class chemprop.data.collate.BatchMolGraph[source]#
A
BatchMolGraphrepresents a batch of individualMolGraphs.It has all the attributes of a
MolGraphwith the addition of thebatchattribute. This class is intended for use with data loading, so it usesTensors to store data- mgs: dataclasses.InitVar[Sequence[chemprop.data.molgraph.MolGraph]]#
A list of individual
MolGraphs to be batched together
- V: torch.Tensor#
the atom feature matrix
- E: torch.Tensor#
the bond feature matrix
- edge_index: torch.Tensor#
an tensor of shape
2 x Econtaining the edges of the graph in COO format
- rev_edge_index: torch.Tensor#
A tensor of shape
Ethat maps from an edge index to the index of the source of the reverse edge in theedge_indexattribute.
- batch: torch.Tensor#
the index of the parent
MolGraphin the batched graph
- __post_init__(mgs)[source]#
- Parameters:
mgs (Sequence[chemprop.data.molgraph.MolGraph])
- class chemprop.data.collate.TrainingBatch[source]#
Bases:
NamedTuple- V_d: torch.Tensor | None#
- X_d: torch.Tensor | None#
- Y: torch.Tensor | None#
- w: torch.Tensor#
- lt_mask: torch.Tensor | None#
- gt_mask: torch.Tensor | None#
- chemprop.data.collate.collate_batch(batch)[source]#
- Parameters:
batch (Iterable[chemprop.data.datasets.Datum])
- Return type:
- class chemprop.data.collate.BatchMolAtomBondGraph[source]#
Bases:
BatchMolGraphA
BatchMolGraphrepresents a batch of individualMolGraphs.It has all the attributes of a
MolGraphwith the addition of thebatchattribute. This class is intended for use with data loading, so it usesTensors to store data- bond_batch: torch.Tensor#
A tensor of indices that show which
MolGrapheach bond belongs to in the batch
- __post_init__(mgs)[source]#
- Parameters:
mgs (Sequence[chemprop.data.molgraph.MolGraph])
- class chemprop.data.collate.MolAtomBondTrainingBatch[source]#
Bases:
NamedTuple- V_d: torch.Tensor | None#
- E_d: torch.Tensor | None#
- X_d: torch.Tensor | None#
- Ys: tuple[torch.Tensor | None, torch.Tensor | None, torch.Tensor | None]#
- w: tuple[torch.Tensor | None, torch.Tensor | None, torch.Tensor | None]#
- lt_masks: tuple[torch.Tensor | None, torch.Tensor | None, torch.Tensor | None]#
- gt_masks: tuple[torch.Tensor | None, torch.Tensor | None, torch.Tensor | None]#
- constraints: tuple[torch.Tensor | None, torch.Tensor | None]#
- chemprop.data.collate.collate_mol_atom_bond_batch(batch)[source]#
- Parameters:
batch (Iterable[chemprop.data.datasets.MolAtomBondDatum])
- Return type:
- class chemprop.data.collate.MulticomponentTrainingBatch[source]#
Bases:
NamedTuple- bmgs: list[BatchMolGraph]#
- V_ds: list[torch.Tensor | None]#
- X_d: torch.Tensor | None#
- Y: torch.Tensor | None#
- w: torch.Tensor#
- lt_mask: torch.Tensor | None#
- gt_mask: torch.Tensor | None#
- chemprop.data.collate.collate_multicomponent(batches)[source]#
- Parameters:
batches (Iterable[Iterable[chemprop.data.datasets.Datum]])
- Return type: