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

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

VoVAllen's avatar
VoVAllen committed
6
7
8
9
10
11
12
13
14
15
16
.. contents:: Contents
    :local:

We welcome your contribution! If you want a model to be implemented in DGL as a NN module,
please `create an issue <https://github.com/dmlc/dgl/issues>`_ started with "[Feature Request] NN Module XXXModel".

If you want to contribute a NN module, please `create a pull request <https://github.com/dmlc/dgl/pulls>`_ started
with "[NN] XXXModel in PyTorch NN Modules" and our team member would review this PR.

Conv Layers 
----------------------------------------
17
18
19

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

VoVAllen's avatar
VoVAllen committed
20
21
22
GraphConv
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

23
24
25
.. autoclass:: dgl.nn.pytorch.conv.GraphConv
    :members: weight, bias, forward, reset_parameters
    :show-inheritance:
VoVAllen's avatar
VoVAllen committed
26
27
28
    
RelGraphConv
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
29

Minjie Wang's avatar
Minjie Wang committed
30
31
32
.. autoclass:: dgl.nn.pytorch.conv.RelGraphConv
    :members: forward
    :show-inheritance:
VoVAllen's avatar
VoVAllen committed
33
34
35
    
TAGConv
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Minjie Wang's avatar
Minjie Wang committed
36

37
38
39
.. autoclass:: dgl.nn.pytorch.conv.TAGConv
    :members: forward
    :show-inheritance:
VoVAllen's avatar
VoVAllen committed
40
41
42
    
GATConv
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
43
44
45
46

.. autoclass:: dgl.nn.pytorch.conv.GATConv
    :members: forward
    :show-inheritance:
VoVAllen's avatar
VoVAllen committed
47
48
49
    
EdgeConv
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
50

51
52
53
.. autoclass:: dgl.nn.pytorch.conv.EdgeConv
    :members: forward
    :show-inheritance:
VoVAllen's avatar
VoVAllen committed
54
55
56
    
SAGEConv
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
57

58
59
60
.. autoclass:: dgl.nn.pytorch.conv.SAGEConv
    :members: forward
    :show-inheritance:
VoVAllen's avatar
VoVAllen committed
61
62
63
    
SGConv
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
64
65
66
67

.. autoclass:: dgl.nn.pytorch.conv.SGConv
    :members: forward
    :show-inheritance:
VoVAllen's avatar
VoVAllen committed
68
69
70
    
APPNPConv
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
71
72
73
74

.. autoclass:: dgl.nn.pytorch.conv.APPNPConv
    :members: forward
    :show-inheritance:
VoVAllen's avatar
VoVAllen committed
75
76
77
    
GINConv
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
78
79
80
81

.. autoclass:: dgl.nn.pytorch.conv.GINConv
    :members: forward
    :show-inheritance:
VoVAllen's avatar
VoVAllen committed
82
83
84
    
GatedGraphConv
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
85
86
87
88

.. autoclass:: dgl.nn.pytorch.conv.GatedGraphConv
    :members: forward
    :show-inheritance:
VoVAllen's avatar
VoVAllen committed
89
90
91
    
GMMConv
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
92
93
94
95

.. autoclass:: dgl.nn.pytorch.conv.GMMConv
    :members: forward
    :show-inheritance:
VoVAllen's avatar
VoVAllen committed
96
97
98
    
ChebConv
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
99
100
101
102

.. autoclass:: dgl.nn.pytorch.conv.ChebConv
    :members: forward
    :show-inheritance:
VoVAllen's avatar
VoVAllen committed
103
104
105
    
AGNNConv
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
106
107
108
109

.. autoclass:: dgl.nn.pytorch.conv.AGNNConv
    :members: forward
    :show-inheritance:
VoVAllen's avatar
VoVAllen committed
110
111
112
    
NNConv
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
113
114
115
116

.. autoclass:: dgl.nn.pytorch.conv.NNConv
    :members: forward
    :show-inheritance:
VoVAllen's avatar
VoVAllen committed
117
118
119
120
121
122
    
Dense Conv Layers
----------------------------------------

DenseGraphConv
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
123
124
125
126

.. autoclass:: dgl.nn.pytorch.conv.DenseGraphConv
    :members: forward
    :show-inheritance:
VoVAllen's avatar
VoVAllen committed
127
128
129
    
DenseSAGEConv
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
130
131
132
133

.. autoclass:: dgl.nn.pytorch.conv.DenseSAGEConv
    :members: forward
    :show-inheritance:
VoVAllen's avatar
VoVAllen committed
134
135
136
    
DenseChebConv
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
137
138
139
140

.. autoclass:: dgl.nn.pytorch.conv.DenseChebConv
    :members: forward
    :show-inheritance:
VoVAllen's avatar
VoVAllen committed
141
142
143
    
Global Pooling Layers 
----------------------------------------
144

145
146
.. automodule:: dgl.nn.pytorch.glob

VoVAllen's avatar
VoVAllen committed
147
148
149
SumPooling
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

150
151
152
.. autoclass:: dgl.nn.pytorch.glob.SumPooling
    :members:
    :show-inheritance:
VoVAllen's avatar
VoVAllen committed
153
154
155
    
AvgPooling
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
156
157
158
159

.. autoclass:: dgl.nn.pytorch.glob.AvgPooling
    :members:
    :show-inheritance:
VoVAllen's avatar
VoVAllen committed
160
161
162
    
MaxPooling
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
163
164
165
166

.. autoclass:: dgl.nn.pytorch.glob.MaxPooling
    :members:
    :show-inheritance:
VoVAllen's avatar
VoVAllen committed
167
168
169
    
SortPooling
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
170
171
172
173

.. autoclass:: dgl.nn.pytorch.glob.SortPooling
    :members:
    :show-inheritance:
VoVAllen's avatar
VoVAllen committed
174
175
176
    
GlobalAttentionPooling
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
177
178
179
180

.. autoclass:: dgl.nn.pytorch.glob.GlobalAttentionPooling
    :members:
    :show-inheritance:
VoVAllen's avatar
VoVAllen committed
181
182
183
    
Set2Set
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
184
185
186
187

.. autoclass:: dgl.nn.pytorch.glob.Set2Set
    :members: forward
    :show-inheritance:
VoVAllen's avatar
VoVAllen committed
188
189
190
    
SetTransformerEncoder
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
191
192
193
194

.. autoclass:: dgl.nn.pytorch.glob.SetTransformerEncoder
    :members:
    :show-inheritance:
VoVAllen's avatar
VoVAllen committed
195
196
197
    
SetTransformerDecoder
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
198
199
200
201

.. autoclass:: dgl.nn.pytorch.glob.SetTransformerDecoder
    :members:
    :show-inheritance:
VoVAllen's avatar
VoVAllen committed
202
203
204
    
Utility Modules
----------------------------------------
205

VoVAllen's avatar
VoVAllen committed
206
207
KNNGraph
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
208
209

.. autoclass:: dgl.nn.pytorch.factory.KNNGraph
210
211
    :members:
    :show-inheritance:
VoVAllen's avatar
VoVAllen committed
212
213
214
    
SegmentedKNNGraph
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
215

216
.. autoclass:: dgl.nn.pytorch.factory.SegmentedKNNGraph
217
218
    :members:
    :show-inheritance:
VoVAllen's avatar
VoVAllen committed
219
220
221
222
223
224
225
226
    
Edge Softmax
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. automodule:: dgl.nn.pytorch.softmax
    :members: edge_softmax