dgl.dataloading.rst 1.64 KB
Newer Older
1
2
3
4
5
6
.. _api-dataloading:

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

.. automodule:: dgl.dataloading
7
.. currentmodule:: dgl.dataloading
8
9
10
11

DataLoaders
-----------

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
.. autosummary::
    :toctree: ../../generated/
19

20
21
22
23
24
25
    DataLoader
    NodeDataLoader
    EdgeDataLoader
    GraphDataLoader
    DistNodeDataLoader
    DistEdgeDataLoader
26

27
.. _api-dataloading-neighbor-sampling:
28

29
30
Samplers
--------
31

32
33
.. autosummary::
    :toctree: ../../generated/
34

35
36
37
38
39
40
    Sampler
    BlockSampler
    NeighborSampler
    MultiLayerFullNeighborSampler
    ClusterGCNSampler
    ShaDowKHopSampler
41

42
43
Sampler Transformations
-----------------------
44

45
46
.. autosummary::
    :toctree: ../../generated/
47

48
    as_edge_prediction_sampler
49

50
.. _api-dataloading-negative-sampling:
51
52
53
54
55

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

56
Negative samplers are classes that control the behavior of the edge prediction samplers
57

58
59
.. autosummary::
    :toctree: ../../generated/
60

61
62
63
    Uniform
    PerSourceUniform
    GlobalUniform
64

65
66
67
Utility Class and Functions for Feature Prefetching
---------------------------------------------------
.. currentmodule:: dgl.dataloading.base
68

69
70
.. autosummary::
    :toctree: ../../generated/
71

72
73
74
75
76
    LazyFeature
    set_node_lazy_features
    set_edge_lazy_features
    set_src_lazy_features
    set_dst_lazy_features