@@ -255,30 +255,30 @@ the layer instead of only the features.
255
255
- `bias::Bool=true`: keyword argument, whether to learn the additive bias.
256
256
- `negative_slope::Real=0.2`: keyword argument, the parameter of LeakyReLU.
257
257
"""
258
- struct GATConv{V<: AbstractFeaturedGraph , T <: Real } <: MessagePassing
258
+ struct GATConv{V<: AbstractFeaturedGraph ,T <: Real } <: MessagePassing
259
259
fg:: V
260
260
weight:: AbstractMatrix{T}
261
261
bias:: AbstractVector{T}
262
262
a:: AbstractMatrix{T}
263
- negative_slope:: Real
263
+ negative_slope:: T
264
264
channel:: Pair{<:Integer,<:Integer}
265
265
heads:: Integer
266
266
concat:: Bool
267
267
end
268
268
269
- function GATConv (adj:: AbstractMatrix , ch:: Pair{<:Integer,<:Integer} ; heads :: Integer = 1 ,
270
- concat:: Bool = true , negative_slope:: Real = 0.2 , init = glorot_uniform ,
271
- bias :: Bool = true , T :: DataType = Float32 )
269
+ function GATConv (adj:: AbstractMatrix , ch:: Pair{<:Integer,<:Integer} ; T :: DataType = Float32 ,
270
+ heads :: Integer = 1 , concat:: Bool = true , negative_slope:: Real = T ( 0.2 ) ,
271
+ init = glorot_uniform, bias :: Bool = true )
272
272
w = T .(init (ch[2 ]* heads, ch[1 ]))
273
273
b = bias ? T .(init (ch[2 ]* heads)) : zeros (T, ch[2 ]* heads)
274
274
a = T .(init (2 * ch[2 ], heads))
275
275
fg = FeaturedGraph (adjacency_list (adj))
276
276
GATConv (fg, w, b, a, negative_slope, ch, heads, concat)
277
277
end
278
278
279
- function GATConv (ch:: Pair{<:Integer,<:Integer} ; heads :: Integer = 1 ,
280
- concat:: Bool = true , negative_slope:: Real = 0.2 , init = glorot_uniform ,
281
- bias :: Bool = true , T :: DataType = Float32 )
279
+ function GATConv (ch:: Pair{<:Integer,<:Integer} ; T :: DataType = Float32 ,
280
+ heads :: Integer = 1 , concat:: Bool = true , negative_slope:: Real = T ( 0.2 ) ,
281
+ init = glorot_uniform, bias :: Bool = true )
282
282
w = T .(init (ch[2 ]* heads, ch[1 ]))
283
283
b = bias ? T .(init (ch[2 ]* heads)) : zeros (T, ch[2 ]* heads)
284
284
a = T .(init (2 * ch[2 ], heads))
0 commit comments