# MultiLayerFullNeighborSampler¶

class dgl.dataloading.MultiLayerFullNeighborSampler(num_layers, **kwargs)[source]

Bases: dgl.dataloading.neighbor_sampler.NeighborSampler

Sampler that builds computational dependency of node representations by taking messages from all neighbors for multilayer GNN.

This sampler will make every node gather messages from every single neighbor per edge type.

Parameters

Examples

To train a 3-layer GNN for node classification on a set of nodes train_nid on a homogeneous graph where each node takes messages from all neighbors for the first, second, and third layer respectively (assuming the backend is PyTorch):

>>> sampler = dgl.dataloading.MultiLayerFullNeighborSampler(3)