|
1 | 1 | # Datasets
|
2 | 2 |
|
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/). |
4 | 8 | 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.
|
5 | 9 |
|
6 | 10 | GraphNeuralNetworks.jl provides the [`mldataset2gnngraph`](@ref) method for interfacing with MLDatasets.jl.
|
7 | 11 |
|
| 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. |
0 commit comments