dgmc.utils¶
- class dgmc.utils.PairDataset(dataset_s, dataset_t, sample=False)[source]¶
Combines two datasets, a source dataset and a target dataset, by building pairs between separate dataset examples.
- Parameters
dataset_s (torch.utils.data.Dataset) – The source dataset.
dataset_t (torch.utils.data.Dataset) – The target dataset.
sample (bool, optional) – If set to
True
, will sample exactly one target example for every source example instead of holding the product of all source and target examples. (default:False
)
- class dgmc.utils.ValidPairDataset(dataset_s, dataset_t, sample=False)[source]¶
Combines two datasets, a source dataset and a target dataset, by building valid pairs between separate dataset examples. A pair is valid if each node class in the source graph also exists in the target graph.
- Parameters
dataset_s (torch.utils.data.Dataset) – The source dataset.
dataset_t (torch.utils.data.Dataset) – The target dataset.
sample (bool, optional) – If set to
True
, will sample exactly one target example for every source example instead of holding the product of all source and target examples. (default:False
)