Skip to content

Commit 53bcfa7

Browse files
PyGDatasets
1 parent 7a3540e commit 53bcfa7

File tree

3 files changed

+39
-6
lines changed

3 files changed

+39
-6
lines changed

GNNGraphs/docs/src/guides/datasets.md

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,44 @@
11
# Datasets
22

3-
GNNGraphs.jl doesn't come with its own datasets, but leverages those available in the Julia (and non-Julia) ecosystem. In particular, the [examples in the GraphNeuralNetworks.jl repository](https://github.com/JuliaGraphs/GraphNeuralNetworks.jl/tree/master/examples) make use of the [MLDatasets.jl](https://github.com/JuliaML/MLDatasets.jl) package. There you will find common graph datasets such as Cora, PubMed, Citeseer, TUDataset and [many others](https://juliaml.github.io/MLDatasets.jl/dev/datasets/graphs/).
3+
GNNGraphs.jl doesn't come with its own datasets, but leverages those available in the Julia (and non-Julia) ecosystem.
4+
5+
## MLDatasets.jl
6+
7+
Some of the [examples in the GraphNeuralNetworks.jl repository](https://github.com/JuliaGraphs/GraphNeuralNetworks.jl/tree/master/examples) make use of the [MLDatasets.jl](https://github.com/JuliaML/MLDatasets.jl) package. There you will find common graph datasets such as Cora, PubMed, Citeseer, TUDataset and [many others](https://juliaml.github.io/MLDatasets.jl/dev/datasets/graphs/).
48
For graphs with static structures and temporal features, datasets such as METRLA, PEMSBAY, ChickenPox, and WindMillEnergy are available. For graphs featuring both temporal structures and temporal features, the TemporalBrains dataset is suitable.
59

610
GraphNeuralNetworks.jl provides the [`mldataset2gnngraph`](@ref) method for interfacing with MLDatasets.jl.
711

12+
## PyGDatasets.jl
13+
14+
The package [PyGDatasets.jl](https://github.com/CarloLucibello/PyGDatasets.jl) makes available to Julia users the datasets from the [pytorch geometric](https://pytorch-geometric.readthedocs.io/en/latest/modules/datasets.html) library.
15+
16+
PyGDatasets' datasets are compatible with GNNGraphs, so no additional conversion is needed.
17+
```julia
18+
julia> using PyGDatasets
19+
20+
julia> dataset = load_dataset("TUDataset", name="MUTAG")
21+
TUDataset(MUTAG) - InMemoryGNNDataset
22+
num_graphs: 188
23+
node_features: [:x]
24+
edge_features: [:edge_attr]
25+
graph_features: [:y]
26+
root: /Users/carlo/.julia/scratchspaces/44f67abd-f36e-4be4-bfe5-65f468a62b3d/datasets/TUDataset
27+
28+
julia> g = dataset[1]
29+
GNNGraph:
30+
num_nodes: 17
31+
num_edges: 38
32+
ndata:
33+
x = 7×17 Matrix{Float32}
34+
edata:
35+
edge_attr = 4×38 Matrix{Float32}
36+
gdata:
37+
y = 1-element Vector{Int64}
38+
39+
julia> using MLUtils: DataLoader
40+
41+
julia> data_loader = DataLoader(dataset, batch_size=32);
42+
```
43+
44+
PyGDatasets is based on [PythonCall.jl](https://github.com/JuliaPy/PythonCall.jl). It carries over some heavy dependencies such as python, pytorch and pytorch geometric.

GNNGraphs/src/gnnheterograph/generate.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ See [`rand_heterograph`](@ref) for a more general version.
9595
9696
# Examples
9797
98-
```julia-repl
98+
```julia
9999
julia> g = rand_bipartite_heterograph((10, 15), 20)
100100
GNNHeteroGraph:
101101
num_nodes: (:A => 10, :B => 15)

GNNlib/Project.toml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,6 @@ CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba"
2121
GNNlibAMDGPUExt = "AMDGPU"
2222
GNNlibCUDAExt = "CUDA"
2323

24-
# GPUArraysCore is not needed as a direct dependency
25-
# but pinning it to 0.1 avoids problems when we do Pkg.add("CUDA") in testing
26-
# See https://github.com/JuliaGPU/CUDA.jl/issues/2564
27-
2824
[compat]
2925
AMDGPU = "1"
3026
CUDA = "5"

0 commit comments

Comments
 (0)