Skip to content

Commit

Permalink
remove useless params
Browse files Browse the repository at this point in the history
  • Loading branch information
rbSparky committed Aug 25, 2024
1 parent 4f0d60f commit e7661f2
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions GNNLux/src/layers/conv.jl
Original file line number Diff line number Diff line change
Expand Up @@ -635,32 +635,26 @@ end
in_dims::Int
out_dims::Int
use_bias::Bool
add_self_loops::Bool
use_edge_weight::Bool
init_weight
init_bias
σ
end


function NNConv(ch::Pair{Int, Int}, nn, σ = identity;
aggr = +,
init_bias = zeros32,
use_bias::Bool = true,
init_weight = glorot_uniform,
add_self_loops::Bool = true,
use_edge_weight::Bool = false,
allow_fast_activation::Bool = true)
in_dims, out_dims = ch
σ = allow_fast_activation ? NNlib.fast_act(σ) : σ
return NNConv(nn, aggr, in_dims, out_dims, use_bias, add_self_loops, use_edge_weight, init_weight, init_bias, σ)
return NNConv(nn, aggr, in_dims, out_dims, use_bias, init_weight, init_bias, σ)
end

function (l::NNConv)(g, x, edge_weight, ps, st)
nn = StatefulLuxLayer{true}(l.nn, ps, st)

m = (; nn, l.aggr, ps.weight, bias = _getbias(ps),
l.add_self_loops, l.use_edge_weight, l.σ)
m = (; nn, l.aggr, ps.weight, bias = _getbias(ps), l.σ)
y = GNNlib.nn_conv(m, g, x, edge_weight)
stnew = _getstate(nn)
return y, stnew
Expand All @@ -670,8 +664,6 @@ function Base.show(io::IO, l::NNConv)
print(io, "NNConv($(l.nn)")
l.σ == identity || print(io, ", ", l.σ)
l.use_bias || print(io, ", use_bias=false")
l.add_self_loops || print(io, ", add_self_loops=false")
!l.use_edge_weight || print(io, ", use_edge_weight=true")
print(io, ")")
end

Expand Down

0 comments on commit e7661f2

Please sign in to comment.