Skip to content

Commit e828d74

Browse files
add OGBDataset (#106)
1 parent c5b862d commit e828d74

File tree

11 files changed

+488
-74
lines changed

11 files changed

+488
-74
lines changed

README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,13 @@ Find below a list of available datasets and links to their documentation.
3838
- [UD_English](https://juliaml.github.io/MLDatasets.jl/dev/datasets/UD_English/)
3939

4040
#### Graphs
41-
- [CiteSeer](https://juliaml.github.io/MLDatasets.jl/dev/datasets/CiteSeer/)
42-
- [Cora](https://juliaml.github.io/MLDatasets.jl/dev/datasets/Cora/)
43-
- [PubMed](https://juliaml.github.io/MLDatasets.jl/dev/datasets/PubMed/)
44-
- [TUDatasets](https://juliaml.github.io/MLDatasets.jl/dev/datasets/TUDataset/)
4541

42+
Documentation [link](https://juliaml.github.io/MLDatasets.jl/dev/datasets/graphs). Available datasets:
43+
- CiteSeer
44+
- Cora
45+
- OGBDataset
46+
- PubMed
47+
- TUDataset
4648

4749
## Installation
4850

docs/make.jl

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,7 @@ makedocs(
4242
"UD_English" => "datasets/UD_English.md",
4343
],
4444

45-
"Graphs" => Any[
46-
"CiteSeer" => "datasets/CiteSeer.md",
47-
"Cora" => "datasets/Cora.md",
48-
"PubMed" => "datasets/PubMed.md",
49-
"TUDataset" => "datasets/TUDataset.md",
50-
],
45+
"Graphs" => "datasets/graphs.md",
5146

5247
],
5348
"Utils" => "utils.md",

docs/src/datasets/CiteSeer.md

Lines changed: 0 additions & 11 deletions
This file was deleted.

docs/src/datasets/Cora.md

Lines changed: 0 additions & 11 deletions
This file was deleted.

docs/src/datasets/PubMed.md

Lines changed: 0 additions & 11 deletions
This file was deleted.

docs/src/datasets/TUDataset.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

docs/src/datasets/graphs.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Graph Datasets
2+
3+
```@index
4+
Pages = ["graphs.md"]
5+
```
6+
7+
```@docs
8+
CiteSeer
9+
CiteSeer.dataset
10+
Cora
11+
Cora.dataset
12+
OGBDataset
13+
PubMed
14+
PubMed.dataset
15+
TUDataset
16+
```

src/MLDatasets.jl

Lines changed: 6 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -17,32 +17,7 @@ import MLUtils
1717
using MLUtils: getobs, numobs, AbstractDataContainer
1818
export getobs, numobs
1919

20-
# Julia 1.0 compatibility
21-
if !isdefined(Base, :isnothing)
22-
isnothing(x) = x === nothing
23-
end
24-
25-
bytes_to_type(::Type{UInt8}, A::Array{UInt8}) = A
26-
bytes_to_type(::Type{N0f8}, A::Array{UInt8}) = reinterpret(N0f8, A)
27-
bytes_to_type(::Type{T}, A::Array{UInt8}) where T<:Integer = convert(Array{T}, A)
28-
bytes_to_type(::Type{T}, A::Array{UInt8}) where T<:AbstractFloat = A ./ T(255)
29-
bytes_to_type(::Type{T}, A::Array{UInt8}) where T<:Number = convert(Array{T}, reinterpret(N0f8, A))
30-
31-
global __images_supported__ = false
32-
33-
function _channelview(image::AbstractArray{<:Colorant})
34-
__images_supported__ ||
35-
error("Converting to/from image requires `using ImageCore`")
36-
ImageCore.channelview(image)
37-
end
38-
39-
function _colorview(::Type{T}, array::AbstractArray{<:Number}) where T <: Color
40-
__images_supported__ ||
41-
error("Converting to image requires `using ImageCore`")
42-
ImageCore.colorview(T, array)
43-
end
44-
45-
20+
include("utils.jl")
4621
include("download.jl")
4722

4823
include("containers/filedataset.jl")
@@ -56,6 +31,8 @@ export JLD2Dataset
5631
include("containers/cacheddataset.jl")
5732
export CachedDataset
5833

34+
include("abstract_dataset.jl")
35+
5936
# Misc.
6037
include("BostonHousing/BostonHousing.jl")
6138
include("Iris/Iris.jl")
@@ -81,6 +58,8 @@ include("planetoid.jl")
8158
include("PubMed/PubMed.jl")
8259
include("CiteSeer/CiteSeer.jl")
8360
include("TUDataset/TUDataset.jl")
61+
include("OGBDataset/OGBDataset.jl")
62+
8463

8564
function __init__()
8665
# initialize optional dependencies
@@ -89,6 +68,7 @@ function __init__()
8968
end
9069

9170
__init__tudataset()
71+
__init__ogbdataset()
9272
end
9373

9474
end

0 commit comments

Comments
 (0)