Dataset interfaces under
- class AUG_trans(augmenter, device, pre_trans=None, post_trans=None)[source]¶
This class generates an augmentation from a given sample.
augmenter (function) – This method generates an augmentation from the given sample.
device (str) – The device on which the data will be processed.
pre_trans (function, optional) – This transformation is applied on the original sample before an augmentation is generated. Default is None.
post_trans (function, optional) – This transformation is applied on the generated augmented sample. Default is None.
- class DegreeTrans(dataset, in_degree=False)[source]¶
This class is used to add vertex degree based node features to graphs. This is usually used to preprocess the graph datasets that do not have node features.
This is the main function that adds vertex degree based node features to the given graph.
torch_geometric.data.data.Data) – The graph
features. (with vertex degrees as node) –
- class Subset(subset, transform=None)[source]¶
This class is used to create of a subset of a dataset.
torch.utils.data.Dataset) – The given dataset subset.
transform (function, optional) – A transformation applied on each sample of the dataset before it will be used. Default is None.
This method returns the sample at the given index in the subset.
index (int) – The index in the subset of the required sample.
- class TripleSet(dataset, transform=None)[source]¶
This class inherits from the
torch.utils.data.Datasetclass and in addition to each anchor sample, it returns a random positive and negative sample from the dataset. A positive sample has the same label as the anchor sample and a negative sample has a different label than the anchor sample.
torch.utils.data.Dataset) – The dataset for which the triple set will be created.
transform (function, optional) – A transformation that is applied on all original samples. In other words, this transformation is applied to the anchor, positive, and negative sample. Default is None.
For a given index, this sample returns the original/anchor sample from the dataset at that index and a corresponding positive, and negative sample.
index (int) – The index of the anchor sample in the dataset.
A tuple consisting of the anchor sample, a positive sample, and a negative sample respectively.