Skip to content

Learnable epsilon in GIN - #697

Open
aurorarossi wants to merge 6 commits into
JuliaGraphs:masterfrom
aurorarossi:learnable-epsilon-gin
Open

Learnable epsilon in GIN#697
aurorarossi wants to merge 6 commits into
JuliaGraphs:masterfrom
aurorarossi:learnable-epsilon-gin

Conversation

@aurorarossi

Copy link
Copy Markdown
Member

This PR adds PyTorch Geometric-style ϵ and train_eps options to GINConv for both Flux and Lux.

GINConv(nn; train_eps = true)  # trainable eps, initialized to 0
GINConv(nn;  ϵ  = 0.1f0)       # fixed eps

@CarloLucibello

Copy link
Copy Markdown
Member

needs a rebase

Comment thread GNNlib/src/layers/conv.jl
Comment thread GNNLux/src/layers/conv.jl

GINConv(nn, ϵ; aggr = +) = GINConv(nn, ϵ, aggr)
GINConv(nn, ϵ::Real; aggr = +, train_eps::Bool = false) =
GINConv(nn, train_eps ? [ϵ] : ϵ, aggr, train_eps)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
GINConv(nn, train_eps ? [ϵ] : ϵ, aggr, train_eps)
GINConv(nn, train_eps ? Float32[ϵ] : ϵ, aggr, train_eps)

Maybe this is safer?


GINConv(nn, ϵ; aggr = +) = GINConv(nn, ϵ, aggr)
GINConv(nn, ϵ::Real; aggr = +, train_eps::Bool = false) =
GINConv(nn, train_eps ? [ϵ] : ϵ, aggr, train_eps)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
GINConv(nn, train_eps ? [ϵ] : ϵ, aggr, train_eps)
GINConv(nn, train_eps ? Float32[ϵ] : ϵ, aggr, train_eps)

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.

2 participants