dgl.dataloading.rst 1.87 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
46
47
48
49
    Sampler
    NeighborSampler
    MultiLayerFullNeighborSampler
    ClusterGCNSampler
    ShaDowKHopSampler
    as_edge_prediction_sampler
50
    BlockSampler
51

52
.. _api-dataloading-negative-sampling:
53
54
55
56
57

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

58
59
.. autosummary::
    :toctree: ../../generated/
60
61
    :nosignatures:
    :template: classtemplate.rst
62

63
64
65
    Uniform
    PerSourceUniform
    GlobalUniform
66

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

71
72
.. autosummary::
    :toctree: ../../generated/
73
74
    :nosignatures:
    :template: classtemplate.rst
75

76
77
78
79
    set_node_lazy_features
    set_edge_lazy_features
    set_src_lazy_features
    set_dst_lazy_features
80
    LazyFeature