dmlc--dgl
b1e8d95e99
* tutorial notebook added * lg tutorial cleaned up * dataset scaffold * move dataloader to data * fix model * remove todo * utils seperated * [model]line graph new implementation + tutorial + binary sub graph dataset * [tutorial] line graph sphinx scaffold * [tutorial] lgnn tutorial improved * [tutorial] remove notebook * [tutorial] fix lg and gcn links * [tutorial] fix random seed * [tutorial]fix * WIP * code refactor done * new mini dataset; remove utils code * fix * word fix * fix link * minor fix * minor fix * minor fix
26 行
776 B
Python
26 行
776 B
Python
"""Data related package."""
|
|
from __future__ import absolute_import
|
|
|
|
from . import citation_graph as citegrh
|
|
from .citation_graph import CoraBinary
|
|
from .tree import *
|
|
from .utils import *
|
|
from .sbm import SBMMixture
|
|
|
|
def register_data_args(parser):
|
|
parser.add_argument("--dataset", type=str, required=False,
|
|
help="The input dataset.")
|
|
citegrh.register_args(parser)
|
|
|
|
def load_data(args):
|
|
if args.dataset == 'cora':
|
|
return citegrh.load_cora()
|
|
elif args.dataset == 'citeseer':
|
|
return citegrh.load_citeseer()
|
|
elif args.dataset == 'pubmed':
|
|
return citegrh.load_pubmed()
|
|
elif args.dataset == 'syn':
|
|
return citegrh.load_synthetic(args)
|
|
else:
|
|
raise ValueError('Unknown dataset: {}'.format(args.dataset))
|