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 datasetsplit (
Literal['train','test']) – split of the dataset to loaduse_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
nameName of the dataset
num_edge_classesReturns the number of edge classes to predict.
num_edge_featuresReturns the number of edge features.
num_graph_classesReturns the number of graph classes to predict.
num_graph_featuresReturns the number of graph features.
num_graphsReturns the number of graphs in the dataset.
num_itemsReturns the number of items in the dataset.
num_node_classesReturns the number of node classes to predict.
num_node_featuresReturns the number of node features.
The path where raw files are stored.
raw_pathThe path where raw files are stored.