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

Added EdgeWeightNorm layer #158

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Changed output type to be same as edge_weight
rbSparky committed May 3, 2022
commit 71f5455bed75ea058f782ec0e94268cd70cf650c
4 changes: 2 additions & 2 deletions src/layers/conv.jl
Original file line number Diff line number Diff line change
@@ -1230,8 +1230,8 @@ function EdgeWeightNorm(norm_both::Bool = true,
EdgeWeightNorm(norm_both, eps)
end

function (l::EdgeWeightNorm)(g::GNNGraph, edge_weight::AbstractVector)
norm_val = Vector{Float64}()
function (l::EdgeWeightNorm)(g::GNNGraph, edge_weight::T) where T <: AbstractVector
norm_val = T()
edge_in, edge_out = edge_index(g)

dg_in = degree(g; dir = :in, edge_weight)