"git@developer.sourcefind.cn:renzhc/diffusers_dcu.git" did not exist on "c7df846decbe9aa335a5292df9e5c87c5fb56d2d"
dgl.dataloading.rst 1.48 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
.. _api-dataloading:

dgl.dataloading
=================================

.. automodule:: dgl.dataloading

DataLoaders
-----------
.. currentmodule:: dgl.dataloading.pytorch

12
13
14
15
16
DGL DataLoader for mini-batch training works similarly to PyTorch's DataLoader.
It has a generator interface that returns mini-batches sampled from some given graphs.
DGL provides two DataLoaders: a ``NodeDataLoader`` for node classification task
and an ``EdgeDataLoader`` for edge/link prediction task.

17
18
19
.. autoclass:: NodeDataLoader
.. autoclass:: EdgeDataLoader

20
.. _api-dataloading-neighbor-sampling:
21
Neighbor Sampler
22
-----------------------------
23
.. currentmodule:: dgl.dataloading.neighbor
24

25
26
27
28
Neighbor samplers are classes that control the behavior of ``DataLoader`` s
to sample neighbors. All of them inherit the base :class:`BlockSampler` class, but implement
different neighbor sampling strategies by overriding the ``sample_frontier`` or
the ``sample_blocks`` methods.
29
30
31
32
33
34

.. autoclass:: BlockSampler
    :members: sample_frontier, sample_blocks

.. autoclass:: MultiLayerNeighborSampler
    :members: sample_frontier
35
36
37
38
    :show-inheritance:

.. autoclass:: MultiLayerFullNeighborSampler
    :show-inheritance:
39

40
.. _api-dataloading-negative-sampling:
41
42
43
44
45

Negative Samplers for Link Prediction
-------------------------------------
.. currentmodule:: dgl.dataloading.negative_sampler

46
47
48
Negative samplers are classes that control the behavior of the ``EdgeDataLoader``
to generate negative edges.

49
50
.. autoclass:: Uniform
    :members: __call__