Skip to content
Discussion options

You must be logged in to vote

Note that MNIST is a graph-level task, so you need to convert your node-level features into graph-level ones, e.g. via global_mean_pool. Here is my updated example:

import os

import numpy as np
import torch

import torch.nn as nn
import torch.nn.functional as F

from torch_geometric.data import Data, DataLoader
from torch_geometric.nn import GATConv, global_mean_pool
from torch_geometric.datasets import Planetoid
from torch_geometric.datasets import MNISTSuperpixels

import torch_geometric.transforms as T

import matplotlib.pyplot as plt

batch_size = 32

path = os.path.join(os.path.dirname(os.getcwd()), 'data', 'MNIST')
name_data = 'MNISTSuperpix'
dataset = MNISTSuperpixels(path, True, t…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@dokato
Comment options

Answer selected by dokato
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants