mlx_graphs.datasets.SuperPixelDataset

mlx_graphs.datasets.SuperPixelDataset#

class mlx_graphs.datasets.SuperPixelDataset(name: Literal['MNIST', 'CIFAR10'], split: Literal['train', 'test'], use_features: bool = False, base_dir: str | None = None)[source]#

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 (Literal['MNIST', 'CIFAR10']) – name of the selected dataset

  • split (Literal['train', 'test']) – split of the dataset to load

  • use_features (bool) – if True, the adjacency matrix is computed from superpixels locations and features. If False, only from superpixels locations. Defaults to False.

  • base_dir (Optional[str]) – directory where to store the datasets

__init__(name: Literal['MNIST', 'CIFAR10'], split: Literal['train', 'test'], use_features: bool = False, base_dir: str | None = None)[source]#

Methods

__init__(name, split[, use_features, base_dir])

download()

Download the dataset at self.raw_path.

load()

Load the processed dataset

process()

Process the dataset and store data in self.data

save()

Save the processed dataset

Attributes

name

Name of the dataset

num_edge_classes

Returns the number of edge classes to predict.

num_edge_features

Returns the number of edge features.

num_graph_classes

Returns the number of graph classes to predict.

num_graph_features

Returns the number of graph features.

num_graphs

Returns the number of graphs in the dataset.

num_items

Returns the number of items in the dataset.

num_node_classes

Returns the number of node classes to predict.

num_node_features

Returns the number of node features.

processed_path

The path where raw files are stored.

raw_path

The path where raw files are stored.