Providing a basic template of building a Dataset object for DGL. The recommend logic of processing the Dataset is as the following:
1) Check whether there is a cached Dataset (already processed and stored in the disk) by invoking has_cache
2) If there is no cache, loading the raw dataset through process, otherwise goto 4
3) Save the processed dataset into disk. We can use dgl.data.save_graphs to serialize DGLGraphs. The goto 5
4) Load the cached Dataset. We can use dgl.data.load_graphs to deserialize saved DGLGraphs.
5) Done
All builtin dataset will follow the above instructions.
Providing a basic template of building a Dataset object for DGL. The recommend logic of processing the Dataset is as the following: 1) Check whether there is a cached Dataset (already processed and stored in the disk) by invoking
has_cache
2) If there is no cache, loading the raw dataset throughprocess
, otherwise goto 4 3) Save the processed dataset into disk. We can usedgl.data.save_graphs
to serialize DGLGraphs. The goto 5 4) Load the cached Dataset. We can usedgl.data.load_graphs
to deserialize saved DGLGraphs. 5) DoneAll builtin dataset will follow the above instructions.