本文整理汇总了Python中utils.graph_reader方法的典型用法代码示例。如果您正苦于以下问题:Python utils.graph_reader方法的具体用法?Python utils.graph_reader怎么用?Python utils.graph_reader使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类utils
的用法示例。
在下文中一共展示了utils.graph_reader方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: main
# 需要导入模块: import utils [as 别名]
# 或者: from utils import graph_reader [as 别名]
def main():
"""
Parsing command line parameters, reading data.
Doing sparsification, fitting a GWNN and saving the logs.
"""
args = parameter_parser()
tab_printer(args)
graph = graph_reader(args.edge_path)
features = feature_reader(args.features_path)
target = target_reader(args.target_path)
sparsifier = WaveletSparsifier(graph, args.scale, args.approximation_order, args.tolerance)
sparsifier.calculate_all_wavelets()
trainer = GWNNTrainer(args, sparsifier, features, target)
trainer.fit()
trainer.score()
save_logs(args, trainer.logs)
示例2: main
# 需要导入模块: import utils [as 别名]
# 或者: from utils import graph_reader [as 别名]
def main():
"""
Parsing command line parameters, reading data.
Fitting an NGCN and scoring the model.
"""
args = parameter_parser()
torch.manual_seed(args.seed)
tab_printer(args)
graph = graph_reader(args.edge_path)
features = feature_reader(args.features_path)
target = target_reader(args.target_path)
trainer = Trainer(args, graph, features, target, True)
trainer.fit()
if args.model == "mixhop":
trainer.evaluate_architecture()
args = trainer.reset_architecture()
trainer = Trainer(args, graph, features, target, False)
trainer.fit()
示例3: main
# 需要导入模块: import utils [as 别名]
# 或者: from utils import graph_reader [as 别名]
def main():
"""
Parsing command line parameters, creating EgoNets.
Creating a partition of the persona graph. Saving the memberships.
"""
args = parameter_parser()
tab_printer(args)
graph = graph_reader(args.edge_path)
splitter = EgoNetSplitter(args.resolution)
splitter.fit(graph)
membership_saver(args.output_path, splitter.overlapping_partitions)
示例4: main
# 需要导入模块: import utils [as 别名]
# 或者: from utils import graph_reader [as 别名]
def main():
"""
Parsing command line parameters.
Reading data, embedding base graph, creating persona graph and learning a splitter.
Saving the persona mapping and the embedding.
"""
args = parameter_parser()
torch.manual_seed(args.seed)
tab_printer(args)
graph = graph_reader(args.edge_path)
trainer = SplitterTrainer(graph, args)
trainer.fit()
trainer.save_embedding()
trainer.save_persona_graph_mapping()
示例5: main
# 需要导入模块: import utils [as 别名]
# 或者: from utils import graph_reader [as 别名]
def main():
"""
Parsing command line parameters, reading data, graph decomposition, fitting a ClusterGCN and scoring the model.
"""
args = parameter_parser()
torch.manual_seed(args.seed)
tab_printer(args)
graph = graph_reader(args.edge_path)
features = feature_reader(args.features_path)
target = target_reader(args.target_path)
clustering_machine = ClusteringMachine(args, graph, features, target)
clustering_machine.decompose()
gcn_trainer = ClusterGCNTrainer(args, clustering_machine)
gcn_trainer.train()
gcn_trainer.test()
示例6: main
# 需要导入模块: import utils [as 别名]
# 或者: from utils import graph_reader [as 别名]
def main():
"""
Parsing command line parameters, reading data, fitting an APPNP/PPNP and scoring the model.
"""
args = parameter_parser()
torch.manual_seed(args.seed)
tab_printer(args)
graph = graph_reader(args.edge_path)
features = feature_reader(args.features_path)
target = target_reader(args.target_path)
trainer = APPNPTrainer(args, graph, features, target)
trainer.fit()
示例7: main
# 需要导入模块: import utils [as 别名]
# 或者: from utils import graph_reader [as 别名]
def main():
"""
Parsing command line parameters, reading data, fitting EdMot and scoring the model.
"""
args = parameter_parser()
tab_printer(args)
graph = graph_reader(args.edge_path)
model = EdMot(graph, args.components, args.cutoff)
memberships = model.fit()
membership_saver(args.membership_path, memberships)