Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add SAGEConv support to HeteroGraphConv #384

Merged
merged 8 commits into from
Mar 1, 2024

Conversation

rbSparky
Copy link
Contributor

Covers Issue #311

Will check tests

@rbSparky
Copy link
Contributor Author

test fails, fixing

@rbSparky
Copy link
Contributor Author

rbSparky commented Feb 21, 2024

Resolved below issue, ignore (version issues)

when I test locally even with just 

@testset "HeteroGraphConv" begin
    d, n = 3, 5
    g = rand_bipartite_heterograph(n, 2*n, 15)
    hg = rand_bipartite_heterograph((2,3), 6)

    model = HeteroGraphConv([(:A,:to,:B) => GraphConv(d => d), 
                            (:B,:to,:A) => GraphConv(d => d)])

    @testset "CGConv" begin
        x = (A = rand(Float32, 4,2), B = rand(Float32, 4, 3))
        layers = HeteroGraphConv( (:A, :to, :B) => CGConv(4 => 2, relu),
                                    (:B, :to, :A) => CGConv(4 => 2, relu));
        y = layers(hg, x); 
        @test size(y.A) == (2,2) && size(y.B) == (2,3)
    end
end


in the `test/layers/heteroconv.jl` file, tests still fail locally while they pass when I push them to github (like above, this current test which passes here fails locally for me)

error message:

[ Info: Testing graph format :coo
CGConv: Error During Test at \path\GraphNeuralNetworks.jl\test\layers\heteroconv.jl:32
  Got exception outside of a @test
  MethodError: no method matching (::CGConv{Dense{typeof(σ), Matrix{Float32}, Vector{Float32}}, Dense{typeof(relu), Matrix{Float32}, Vector{Float32}}})(::GNNHeteroGraph{Tuple{Vector{Int64}, Vector{Int64}, Nothing}}, ::Tuple{Matrix{Float32}, Matrix{Float32}})
  Closest candidates are:
    (::GNNLayer)(::AbstractVector{<:GNNGraph}, ::Any...; kws...) at C:\Users\[user]\.julia\packages\GraphNeuralNetworks\HVWUc\src\layers\basic.jl:14


Please let me know if you know why this happens.

Thanks

@rbSparky
Copy link
Contributor Author

rbSparky commented Feb 22, 2024

Layer requires more changes to be made suitable for heterogeneous graphs
Working on it

edit: done

@rbSparky
Copy link
Contributor Author

rbSparky commented Feb 22, 2024

Tests should work now (edit: they do)

@rbSparky
Copy link
Contributor Author

rbSparky commented Feb 22, 2024

Ready for merge?

@rbSparky rbSparky changed the title SAGEConv Hetero Layer Add SAGEConv support to HeteroConv Layer Feb 22, 2024
@rbSparky rbSparky changed the title Add SAGEConv support to HeteroConv Layer Add SAGEConv support to HeteroGraphConv Feb 22, 2024
@CarloLucibello CarloLucibello merged commit 5148d96 into JuliaGraphs:master Mar 1, 2024
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants