nn.pytorch.rst 7.56 KB
Newer Older
1
2
.. _apinn-pytorch:

VoVAllen's avatar
VoVAllen committed
3
4
NN Modules (PyTorch)
====================
5

6
7
.. _apinn-pytorch-conv:

8
Conv Layers
VoVAllen's avatar
VoVAllen committed
9
----------------------------------------
10
11
12

.. automodule:: dgl.nn.pytorch.conv

VoVAllen's avatar
VoVAllen committed
13
14
15
GraphConv
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

16
17
18
.. autoclass:: dgl.nn.pytorch.conv.GraphConv
    :members: weight, bias, forward, reset_parameters
    :show-inheritance:
19

20
21
22
23
24
25
26
EdgeWeightNorm
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. autoclass:: dgl.nn.pytorch.conv.EdgeWeightNorm
    :members: forward
    :show-inheritance:

VoVAllen's avatar
VoVAllen committed
27
28
RelGraphConv
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
29

Minjie Wang's avatar
Minjie Wang committed
30
31
32
.. autoclass:: dgl.nn.pytorch.conv.RelGraphConv
    :members: forward
    :show-inheritance:
33

VoVAllen's avatar
VoVAllen committed
34
35
TAGConv
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Minjie Wang's avatar
Minjie Wang committed
36

37
38
39
.. autoclass:: dgl.nn.pytorch.conv.TAGConv
    :members: forward
    :show-inheritance:
40

VoVAllen's avatar
VoVAllen committed
41
42
GATConv
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
43
44
45
46

.. autoclass:: dgl.nn.pytorch.conv.GATConv
    :members: forward
    :show-inheritance:
Mufei Li's avatar
Mufei Li committed
47

Shaked Brody's avatar
Shaked Brody committed
48
49
50
51
52
53
54
GATv2Conv
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. autoclass:: dgl.nn.pytorch.conv.GATv2Conv
    :members: forward
    :show-inheritance:

55
56
57
58
59
60
EGATConv
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. autoclass:: dgl.nn.pytorch.conv.EGATConv
    :members: forward
    :show-inheritance:
61

VoVAllen's avatar
VoVAllen committed
62
63
EdgeConv
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
64

65
66
67
.. autoclass:: dgl.nn.pytorch.conv.EdgeConv
    :members: forward
    :show-inheritance:
68

VoVAllen's avatar
VoVAllen committed
69
70
SAGEConv
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
71

72
73
74
.. autoclass:: dgl.nn.pytorch.conv.SAGEConv
    :members: forward
    :show-inheritance:
75

VoVAllen's avatar
VoVAllen committed
76
77
SGConv
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
78
79
80
81

.. autoclass:: dgl.nn.pytorch.conv.SGConv
    :members: forward
    :show-inheritance:
82

VoVAllen's avatar
VoVAllen committed
83
84
APPNPConv
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
85
86
87
88

.. autoclass:: dgl.nn.pytorch.conv.APPNPConv
    :members: forward
    :show-inheritance:
89

VoVAllen's avatar
VoVAllen committed
90
91
GINConv
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
92
93
94
95

.. autoclass:: dgl.nn.pytorch.conv.GINConv
    :members: forward
    :show-inheritance:
96

VoVAllen's avatar
VoVAllen committed
97
98
GatedGraphConv
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
99
100
101
102

.. autoclass:: dgl.nn.pytorch.conv.GatedGraphConv
    :members: forward
    :show-inheritance:
103

VoVAllen's avatar
VoVAllen committed
104
105
GMMConv
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
106
107
108
109

.. autoclass:: dgl.nn.pytorch.conv.GMMConv
    :members: forward
    :show-inheritance:
110

VoVAllen's avatar
VoVAllen committed
111
112
ChebConv
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
113
114
115
116

.. autoclass:: dgl.nn.pytorch.conv.ChebConv
    :members: forward
    :show-inheritance:
117

VoVAllen's avatar
VoVAllen committed
118
119
AGNNConv
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
120
121
122
123

.. autoclass:: dgl.nn.pytorch.conv.AGNNConv
    :members: forward
    :show-inheritance:
124

VoVAllen's avatar
VoVAllen committed
125
126
NNConv
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
127
128
129
130

.. autoclass:: dgl.nn.pytorch.conv.NNConv
    :members: forward
    :show-inheritance:
131
132
133
134
135
136
137

AtomicConv
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. autoclass:: dgl.nn.pytorch.conv.AtomicConv
    :members: forward
    :show-inheritance:
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152

CFConv
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. autoclass:: dgl.nn.pytorch.conv.CFConv
    :members: forward
    :show-inheritance:

DotGatConv
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. autoclass:: dgl.nn.pytorch.conv.DotGatConv
    :members: forward
    :show-inheritance:

153
154
155
156
157
158
159
160
161
162
163
164
165
TWIRLSConv
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. autoclass:: dgl.nn.pytorch.conv.TWIRLSConv
    :members: forward
    :show-inheritance:

TWIRLSUnfoldingAndAttention
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. autoclass:: dgl.nn.pytorch.conv.TWIRLSUnfoldingAndAttention
    :members: forward
    :show-inheritance:
Mufei Li's avatar
Mufei Li committed
166

167
168
169
170
171
172
GCN2Conv
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. autoclass:: dgl.nn.pytorch.conv.GCN2Conv
    :members: forward
    :show-inheritance:
173

174
.. _apinn-pytorch-dense-conv:
175

VoVAllen's avatar
VoVAllen committed
176
177
178
179
180
Dense Conv Layers
----------------------------------------

DenseGraphConv
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
181
182
183
184

.. autoclass:: dgl.nn.pytorch.conv.DenseGraphConv
    :members: forward
    :show-inheritance:
185

VoVAllen's avatar
VoVAllen committed
186
187
DenseSAGEConv
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
188
189
190
191

.. autoclass:: dgl.nn.pytorch.conv.DenseSAGEConv
    :members: forward
    :show-inheritance:
192

VoVAllen's avatar
VoVAllen committed
193
194
DenseChebConv
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
195
196
197
198

.. autoclass:: dgl.nn.pytorch.conv.DenseChebConv
    :members: forward
    :show-inheritance:
199

200
201
.. _apinn-pytorch-pooling:

202
Global Pooling Layers
VoVAllen's avatar
VoVAllen committed
203
----------------------------------------
204

205
206
.. automodule:: dgl.nn.pytorch.glob

VoVAllen's avatar
VoVAllen committed
207
208
209
SumPooling
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

210
211
212
.. autoclass:: dgl.nn.pytorch.glob.SumPooling
    :members:
    :show-inheritance:
213

VoVAllen's avatar
VoVAllen committed
214
215
AvgPooling
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
216
217
218
219

.. autoclass:: dgl.nn.pytorch.glob.AvgPooling
    :members:
    :show-inheritance:
220

VoVAllen's avatar
VoVAllen committed
221
222
MaxPooling
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
223
224
225
226

.. autoclass:: dgl.nn.pytorch.glob.MaxPooling
    :members:
    :show-inheritance:
227

VoVAllen's avatar
VoVAllen committed
228
229
SortPooling
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
230
231
232
233

.. autoclass:: dgl.nn.pytorch.glob.SortPooling
    :members:
    :show-inheritance:
234

235
236
237
238
239
240
241
WeightAndSum
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. autoclass:: dgl.nn.pytorch.glob.WeightAndSum
    :members:
    :show-inheritance:

VoVAllen's avatar
VoVAllen committed
242
243
GlobalAttentionPooling
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
244
245
246
247

.. autoclass:: dgl.nn.pytorch.glob.GlobalAttentionPooling
    :members:
    :show-inheritance:
248

VoVAllen's avatar
VoVAllen committed
249
250
Set2Set
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
251
252
253
254

.. autoclass:: dgl.nn.pytorch.glob.Set2Set
    :members: forward
    :show-inheritance:
255

VoVAllen's avatar
VoVAllen committed
256
257
SetTransformerEncoder
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
258
259
260
261

.. autoclass:: dgl.nn.pytorch.glob.SetTransformerEncoder
    :members:
    :show-inheritance:
262

VoVAllen's avatar
VoVAllen committed
263
264
SetTransformerDecoder
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
265
266
267
268

.. autoclass:: dgl.nn.pytorch.glob.SetTransformerDecoder
    :members:
    :show-inheritance:
269

Mufei Li's avatar
Mufei Li committed
270
271
272
273
274
275
276
277
278
279
280
281
282
283
.. _apinn-pytorch-link

Predictor and Score Functions for Link Prediction
-------------------------------------------------

.. automodule:: dgl.nn.pytorch.link

EdgePredictor
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. autoclass:: dgl.nn.pytorch.link.EdgePredictor
    :members: forward, reset_parameters
    :show-inheritance:

Mufei Li's avatar
Mufei Li committed
284
285
286
287
288
289
290
291
292
293
294
295
296
297
TransE
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. autoclass:: dgl.nn.pytorch.link.TransE
    :members: rel_emb, forward, reset_parameters
    :show-inheritance:

TransR
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. autoclass:: dgl.nn.pytorch.link.TransR
    :members: rel_emb, rel_project, forward, reset_parameters
    :show-inheritance:

298
299
300
301
Heterogeneous Graph Convolution Module
----------------------------------------

HeteroGraphConv
302
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
303
304
305
306
307

.. autoclass:: dgl.nn.pytorch.HeteroGraphConv
   :members:
   :show-inheritance:

308
309
310
311
312
313
314
315
316
317
318
319
HeteroLinear
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. autoclass:: dgl.nn.pytorch.HeteroLinear
   :members:
   :show-inheritance:

HeteroEmbedding
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. autoclass:: dgl.nn.pytorch.HeteroEmbedding
   :members:
   :show-inheritance:

320
321
.. _apinn-pytorch-util:

VoVAllen's avatar
VoVAllen committed
322
323
Utility Modules
----------------------------------------
324

325
326
327
328
329
330
331
Sequential
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. autoclass:: dgl.nn.pytorch.utils.Sequential
    :members:
    :show-inheritance:

332
333
334
335
336
337
338
WeightBasis
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. autoclass:: dgl.nn.pytorch.utils.WeightBasis
    :members:
    :show-inheritance:

VoVAllen's avatar
VoVAllen committed
339
340
KNNGraph
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
341
342

.. autoclass:: dgl.nn.pytorch.factory.KNNGraph
343
344
    :members:
    :show-inheritance:
345

VoVAllen's avatar
VoVAllen committed
346
347
SegmentedKNNGraph
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
348

349
.. autoclass:: dgl.nn.pytorch.factory.SegmentedKNNGraph
350
351
    :members:
    :show-inheritance:
VoVAllen's avatar
VoVAllen committed
352

Mufei Li's avatar
Mufei Li committed
353
354
355
356
357
358
359
JumpingKnowledge
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. autoclass:: dgl.nn.pytorch.utils.JumpingKnowledge
    :members: forward, reset_parameters
    :show-inheritance:

360
361
362
NodeEmbedding Module
----------------------------------------

363
364
365
366
367
368
NodeEmbedding
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. autoclass:: dgl.nn.pytorch.sparse_emb.NodeEmbedding
    :members:
    :show-inheritance:
Mufei Li's avatar
Mufei Li committed
369
370
371
372
373
374
375
376
377
378
379
380

Explainability Models
----------------------------------------

.. automodule:: dgl.nn.pytorch.explain

GNNExplainer
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. autoclass:: dgl.nn.pytorch.explain.GNNExplainer
    :members: explain_node, explain_graph
    :show-inheritance: