dgl.dataloading.rst 2 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
31
32
    NodeDataLoader
    EdgeDataLoader
    DistNodeDataLoader
    DistEdgeDataLoader
33

34
.. _api-dataloading-neighbor-sampling:
35

36
37
Samplers
--------
38

39
40
.. autosummary::
    :toctree: ../../generated/
41
42
    :nosignatures:
    :template: classtemplate.rst
43

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

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

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

58
    as_edge_prediction_sampler
59
    BlockSampler
60

61
.. _api-dataloading-negative-sampling:
62
63
64
65
66

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

67
68
.. autosummary::
    :toctree: ../../generated/
69
70
    :nosignatures:
    :template: classtemplate.rst
71

72
73
74
    Uniform
    PerSourceUniform
    GlobalUniform
75

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

80
81
.. autosummary::
    :toctree: ../../generated/
82
83
    :nosignatures:
    :template: classtemplate.rst
84

85
86
87
88
    set_node_lazy_features
    set_edge_lazy_features
    set_src_lazy_features
    set_dst_lazy_features
89
    LazyFeature