Skip to content

Commit a95178a

Browse files
ignore pluto for the time being
1 parent 3bba9f3 commit a95178a

File tree

4 files changed

+53
-42
lines changed

4 files changed

+53
-42
lines changed

docs/make.jl

Lines changed: 37 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,10 @@ tutorial_menu = Array{Pair{String,String},1}()
1111
#
1212
# Generate Pluto Tutorial HTMLs
1313

14-
# First tutorial with AD
15-
pluto_src_folder = joinpath(@__DIR__, "src", "tutorials")
16-
pluto_output_folder = joinpath(@__DIR__, "src", "tutorials")
17-
pluto_relative_path = "tutorials/"
18-
mkpath(pluto_output_folder)
14+
# pluto_src_folder = joinpath(@__DIR__, "src", "tutorials")
15+
# pluto_output_folder = joinpath(@__DIR__, "src", "tutorials")
16+
# pluto_relative_path = "tutorials/"
17+
# mkpath(pluto_output_folder)
1918

2019
# """
2120
# build()
@@ -35,39 +34,39 @@ mkpath(pluto_output_folder)
3534
# build()
3635
# end
3736

38-
# Please do not use the same name as for a(n old) literate Tutorial
39-
pluto_files = [
40-
"gnn_intro_pluto",
41-
"graph_classification_pluto",
42-
]
43-
pluto_titles = [
44-
"Intro to Graph Neural Networks ",
45-
"Graph Classification",
46-
]
37+
# # Please do not use the same name as for a(n old) literate Tutorial
38+
# pluto_files = [
39+
# "gnn_intro_pluto",
40+
# "graph_classification_pluto",
41+
# ]
42+
# pluto_titles = [
43+
# "Intro to Graph Neural Networks ",
44+
# "Graph Classification",
45+
# ]
4746

48-
# build menu and write files myself - tp set edit url correctly.
49-
for (title, file) in zip(pluto_titles, pluto_files)
50-
global tutorial_menu
51-
rendered = build_notebooks( #though not really parallel here
52-
BuildOptions(
53-
pluto_src_folder;
54-
output_format=documenter_output,
55-
write_files=false,
56-
use_distributed=false,
57-
),
58-
["$(file).jl"],
59-
)
60-
write(
61-
joinpath(pluto_output_folder, file * ".md"),
62-
"""
63-
```@meta
64-
EditURL = "$(joinpath(pluto_src_folder, file * ".jl"))"
65-
```
66-
$(rendered[1])
67-
""",
68-
)
69-
push!(tutorial_menu, title => joinpath(pluto_relative_path, file * ".md"))
70-
end
47+
# # build menu and write files myself - tp set edit url correctly.
48+
# for (title, file) in zip(pluto_titles, pluto_files)
49+
# global tutorial_menu
50+
# rendered = build_notebooks( #though not really parallel here
51+
# BuildOptions(
52+
# pluto_src_folder;
53+
# output_format=documenter_output,
54+
# write_files=false,
55+
# use_distributed=false,
56+
# ),
57+
# ["$(file).jl"],
58+
# )
59+
# write(
60+
# joinpath(pluto_output_folder, file * ".md"),
61+
# """
62+
# ```@meta
63+
# EditURL = "$(joinpath(pluto_src_folder, file * ".jl"))"
64+
# ```
65+
# $(rendered[1])
66+
# """,
67+
# )
68+
# push!(tutorial_menu, title => joinpath(pluto_relative_path, file * ".md"))
69+
# end
7170

7271
DocMeta.setdocmeta!(GraphNeuralNetworks, :DocTestSetup,
7372
:(using GraphNeuralNetworks, Graphs, SparseArrays, NNlib, Flux);
@@ -87,7 +86,7 @@ makedocs(;
8786
"Message Passing" => "messagepassing.md",
8887
"Model Building" => "models.md",
8988
"Datasets" => "datasets.md",
90-
"Tutorials" => tutorial_menu,
89+
# "Tutorials" => tutorial_menu,
9190
# "Tutorials" =>
9291
# [
9392
# "Intro to Graph Neural Networks" => "gnn_intro_pluto.md",

examples/link_prediction_pubmed.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Base.@kwdef mutable struct Args
1616
η = 1f-3 # learning rate
1717
epochs = 200 # number of epochs
1818
seed = 17 # set seed > 0 for reproducibility
19-
usecuda = false # if true use cuda (if available)
19+
usecuda = true # if true use cuda (if available)
2020
nhidden = 64 # dimension of hidden features
2121
infotime = 10 # report every `infotime` epochs
2222
end

src/GNNGraphs/transform.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -614,9 +614,9 @@ function rand_edge_split(g::GNNGraph, frac; bidirected=is_bidirected(g))
614614
s1, t1 = s[eids[1:size1]], t[eids[1:size1]]
615615
s2, t2 = s[eids[size1+1:end]], t[eids[size1+1:end]]
616616
else
617-
@assert is_bidirected(g)
618-
@assert !has_self_loops(g)
619-
@assert !has_multi_edges(g)
617+
# @assert is_bidirected(g)
618+
# @assert !has_self_loops(g)
619+
# @assert !has_multi_edges(g)
620620
mask = s .< t
621621
s, t = s[mask], t[mask]
622622
s1, t1 = s[eids[1:size1]], t[eids[1:size1]]

src/GNNGraphs/utils.jl

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,18 @@ function sort_edge_index(u, v)
1313
return u[p], v[p]
1414
end
1515

16+
17+
function sort_edge_index(u, v)
18+
uv = collect(zip(u, v))
19+
p = sortperm(uv) # isless lexicographically defined for tuples
20+
return u[p], v[p]
21+
end
22+
23+
function sort_edge_index(u::AnyCuArray, v::AnyCuArray)
24+
#TODO proper cuda friendly implementation
25+
sort_edge_index(u |> Flux.cpu, v |> Flux.cpu) |> Flux.gpu
26+
end
27+
1628
cat_features(x1::Nothing, x2::Nothing) = nothing
1729
cat_features(x1::AbstractArray, x2::AbstractArray) = cat(x1, x2, dims=ndims(x1))
1830
cat_features(x1::Union{Number, AbstractVector}, x2::Union{Number, AbstractVector}) =

0 commit comments

Comments
 (0)