Datasets

EXPWL1Dataset

The synthetic dataset for graph classification from the paper "The expressive power of pooling in graph neural networks" (Bianchi & Lachi, NeurIPS 2023).

GraphClassificationBench

The synthetic dataset for graph classification from the paper "Pyramidal Reservoir Graph Neural Network" (Bianchi et al., Neurocomputing 2022).

GsetDataset

Torch dataset wrapper for the Gset dataset.

MultipartiteGraphDataset

The synthetic dataset for graph classification from the paper "MaxCutPool: differentiable feature-aware Maxcut for pooling in graph neural networks" (Abate & Bianchi, ICLR 2025).

PyGSPDataset

Torch dataset wrapper for the graphs in the PyGSP library.

CSBMDataset

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.

download()[source]

Download the EXPWL1 pickle file into raw_dir.

process()[source]

Load raw examples, apply optional transforms, and save processed data.

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.

download()[source]

Download the benchmark archive into raw_dir.

process()[source]

Convert the raw archive to a list of PyG Data objects.

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.

parse_graph(data)[source]

Parse the graph data and create a NetworkX graph.

property raw_file_names

Return the selected Gset instance filename.

property processed_file_names

Return the processed tensor filename for the selected Gset graph.

download()[source]

Download the selected Gset graph file into raw_dir.

process()[source]

Parse the raw Gset graph and save it as a PyG dataset.

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.

download()[source]

Download the multipartite dataset archive into raw_dir.

process()[source]

Load the raw tensor list, apply transforms, and persist processed data.

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.

process()[source]

Convert the selected PyGSP graph into a PyG Data object.

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 Data object 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 Data object 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 Data object and returns a boolean value, indicating whether the data object should be included in the final dataset.

property raw_file_names: Sequence[str]

Return raw filenames expected by Dataset.

property processed_file_names: Sequence[str]

Return the processed filename derived from dataset generation parameters.

download()[source]

No-op: this dataset is generated procedurally and needs no download.

process()[source]

Generate and persist the synthetic CSBM graphs to disk.