Datasets¶
The synthetic dataset for graph classification from the paper "The expressive power of pooling in graph neural networks" (Bianchi & Lachi, NeurIPS 2023). |
|
The synthetic dataset for graph classification from the paper "Pyramidal Reservoir Graph Neural Network" (Bianchi et al., Neurocomputing 2022). |
|
Torch dataset wrapper for the Gset dataset. |
|
The synthetic dataset for graph classification from the paper "MaxCutPool: differentiable feature-aware Maxcut for pooling in graph neural networks" (Abate & Bianchi, ICLR 2025). |
|
Torch dataset wrapper for the graphs in the PyGSP library. |
|
Contextual SBM dataset for graph classification tasks in PyG format. |
- class EXPWL1Dataset(root, transform=None, pre_transform=None, pre_filter=None, force_reload=False)[source]¶
The synthetic dataset for graph classification from the paper “The expressive power of pooling in graph neural networks” (Bianchi & Lachi, NeurIPS 2023).
- property raw_file_names¶
Return the raw pickle filename expected in
raw_dir.
- property processed_file_names¶
Return the filename used for the processed dataset tensor.
- class GraphClassificationBench(root, split='train', easy=True, small=True, transform=None, pre_transform=None, pre_filter=None, force_reload=False)[source]¶
The synthetic dataset for graph classification from the paper “Pyramidal Reservoir Graph Neural Network” (Bianchi et al., Neurocomputing 2022).
- Parameters:
root (str) – Root directory where the dataset should be saved.
split (str) – If “train”, loads the training dataset. If “val”, loads the validation dataset. If “test”, loads the test dataset. Defaults to “train”.
easy (bool, optional) – If True, use the easy version of the dataset. Defaults to True.
small (bool, optional) – If True, use the small version of the dataset. Defaults to True.
transform (callable, optional) – A function/transform that takes in an torch_geometric.data.Data object and returns a transformed version. The data object will be transformed before every access. Defaults to None.
pre_transform (callable, optional) – A function/transform that takes in an torch_geometric.data.Data object and returns a transformed version. The data object will be transformed before being saved to disk. Defaults to None.
pre_filter (callable, optional) – A function that takes in an torch_geometric.data.Data object and returns a boolean value, indicating whether the data object should be included in the final dataset. Defaults to None.
- property raw_file_names¶
Return the raw benchmark archive filename for the selected split.
- property processed_file_names¶
Return the processed filename for the selected split.
- class GsetDataset(root, name='G1', directed=False, transform=None, pre_transform=None, pre_filter=None, **kwargs)[source]¶
Torch dataset wrapper for the Gset dataset.
The dataset is mainly used to evaluate the performance of MAXCUT algorithms.
- property raw_file_names¶
Return the selected Gset instance filename.
- property processed_file_names¶
Return the processed tensor filename for the selected Gset graph.
- class MultipartiteGraphDataset(root, transform=None, pre_transform=None, pre_filter=None, force_reload=False)[source]¶
The synthetic dataset for graph classification from the paper “MaxCutPool: differentiable feature-aware Maxcut for pooling in graph neural networks” (Abate & Bianchi, ICLR 2025).
- property num_classes¶
Return the number of unique target classes in the dataset.
- property raw_file_names¶
Return the expected raw pickle filename.
- property processed_file_names¶
Return the filename used for the processed dataset.
- class PyGSPDataset(root, name='Community', transform=None, pre_transform=None, pre_filter=None, force_reload=False, kwargs=None)[source]¶
Torch dataset wrapper for the graphs in the PyGSP library.
Optional dependency
This class requires PyGSP to be installed. You can install it using pip:
pip install pygsp- property processed_file_names¶
Return the filename used for the processed PyGSP graph dataset.
- class CSBMDataset(root: str, num_graphs: int = 1024, num_nodes_per_class: int = 50, dbar: float = 10.0, lam: float = 1.0, gamma: float = 4.0, mu: float | None = 4.0, only_sbm: bool = False, structured_ratio: float = 0.5, seed: int = 80, transform=None, pre_transform=None, pre_filter=None, force_reload: bool = False)[source]¶
Contextual SBM dataset for graph classification tasks in PyG format.
- Parameters:
root (str) – Root directory for the dataset.
num_graphs (int) – Number of graphs to generate.
num_nodes_per_class (int) – Number of nodes in each community.
dbar (float) – Average degree of the graphs.
lam (float) – Signal strength for the SBM structure.
gamma (float) – Ratio of number of nodes to feature dimension.
mu (Optional[float]) – Signal strength for node features (ignored if only_sbm is
True).only_sbm (bool) – If True, generate only SBM structure without node features.
structured_ratio (float) – Proportion of graphs with community structure.
seed (int) – Random seed for reproducibility.
transform (callable, optional) – A function/transform that takes in an
Dataobject and returns a transformed version. The data object will be transformed before every access.pre_transform (callable, optional) – A function/transform that takes in an
Dataobject and returns a transformed version. The data object will be transformed before being saved to disk.pre_filter (callable, optional) – A function that takes in an
Dataobject and returns a boolean value, indicating whether the data object should be included in the final dataset.