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

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

6
.. currentmodule:: dgl.dataloading
7

8
9
10
11
12
13
14
15
16
17
18
The ``dgl.dataloading`` package provides two privimitives to compose a data pipeline
for loading from graph data. ``Sampler`` represents algorithms
to generate subgraph samples from the original graph, and ``DataLoader``
represents the iterable over these samples.

DGL provides a number of built-in samplers that subclass :class:`~dgl.dataloading.Sampler`.
Creating new samplers follow the same paradigm. Read our user guide chapter
:ref:`guide-minibatch` for more examples and explanations.

The entire package only works for PyTorch backend.

19
20
21
DataLoaders
-----------

22
23
.. autosummary::
    :toctree: ../../generated/
24
25
    :nosignatures:
    :template: classtemplate.rst
26

27
    DataLoader
28
    GraphDataLoader
29
30
    DistNodeDataLoader
    DistEdgeDataLoader
31

32
.. _api-dataloading-neighbor-sampling:
33

34
35
Samplers
--------
36

37
38
.. autosummary::
    :toctree: ../../generated/
39
40
    :nosignatures:
    :template: classtemplate.rst
41

42
43
    Sampler
    NeighborSampler
44
    LaborSampler
45
46
47
    MultiLayerFullNeighborSampler
    ClusterGCNSampler
    ShaDowKHopSampler
48
49
50
51
52
53
54
55
    SAINTSampler

Sampler Transformations
-----------------------

.. autosummary::
    :toctree: ../../generated/

56
    as_edge_prediction_sampler
57
    BlockSampler
58

59
.. _api-dataloading-negative-sampling:
60
61
62
63
64

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

65
66
.. autosummary::
    :toctree: ../../generated/
67
68
    :nosignatures:
    :template: classtemplate.rst
69

70
71
72
    Uniform
    PerSourceUniform
    GlobalUniform
73

74
75
76
Utility Class and Functions for Feature Prefetching
---------------------------------------------------
.. currentmodule:: dgl.dataloading.base
77

78
79
.. autosummary::
    :toctree: ../../generated/
80
81
    :nosignatures:
    :template: classtemplate.rst
82

83
84
85
86
    set_node_lazy_features
    set_edge_lazy_features
    set_src_lazy_features
    set_dst_lazy_features
87
    LazyFeature