Skip to content

SuperPixelDataset

SuperPixelDataset(
    name: SUPERPIXEL_NAMES,
    split: SUPERPIXEL_SPLITS,
    use_features: bool = False,
    base_dir: Optional[str] = None,
)

Bases: Dataset

MNIST and CIFAR10 superpixel datasets for graph classification tasks converted fromt the original MINST and CIFAR10 images.

The datasets were introduced in http://arxiv.org/abs/2003.00982.

Parameters:

Name Type Description Default
name SUPERPIXEL_NAMES

name of the selected dataset

required
split SUPERPIXEL_SPLITS

split of the dataset to load

required
use_features bool

if True, the adjacency matrix is computed from superpixels locations and features. If False, only from superpixels locations. Defaults to False.

False
base_dir Optional[str]

directory where to store the datasets

None
Source code in mlx_graphs/datasets/superpixel.py
def __init__(
    self,
    name: SUPERPIXEL_NAMES,
    split: SUPERPIXEL_SPLITS,
    use_features: bool = False,
    base_dir: Optional[str] = None,
):
    assert name in get_args(SUPERPIXEL_NAMES), "Invalid dataset name"
    assert split in get_args(SUPERPIXEL_SPLITS), "Invalid split specified"
    self.split = split
    self.use_features = use_features
    super().__init__(name=name, base_dir=base_dir)

from mlx_graphs.datasets import SuperPixelDataset · mlx_graphs/datasets/superpixel.py