You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Example of graph classification when graphs are temporal and modeled as `TemporalSnapshotsGNNGraphs'.
2
+
# In this code, we train a simple temporal graph neural network architecture to classify subjects' gender (female or male) using the temporal graphs extracted from their brain fMRI scan signals.
3
+
# The dataset used is the TemporalBrains dataset from the MLDataset.jl package, and the accuracy achieved with the model reaches 65-70% (it can be improved by fine-tuning the parameters of the model).
4
+
# Author: Aurora Rossi
5
+
6
+
# Load packages
7
+
using Flux
8
+
using Flux.Losses: mae
9
+
using GraphNeuralNetworks
10
+
using CUDA
11
+
using Statistics, Random
12
+
using LinearAlgebra
13
+
using MLDatasets
14
+
CUDA.allowscalar(false)
15
+
16
+
# Load data
17
+
MLdataset =TemporalBrains()
18
+
graphs = MLdataset.graphs
19
+
20
+
# Function to transform the graphs from the MLDatasets format to the TemporalSnapshotsGNNGraph format
21
+
# and split the dataset into a training and a test set
0 commit comments