本文整理匯總了Python中utils.read_graph方法的典型用法代碼示例。如果您正苦於以下問題:Python utils.read_graph方法的具體用法?Python utils.read_graph怎麽用?Python utils.read_graph使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類utils
的用法示例。
在下文中一共展示了utils.read_graph方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: main
# 需要導入模塊: import utils [as 別名]
# 或者: from utils import read_graph [as 別名]
def main():
"""
Parsing command line parameters.
Creating target matrix.
Fitting an SGCN.
Predicting edge signs and saving the embedding.
"""
args = parameter_parser()
tab_printer(args)
edges = read_graph(args)
trainer = SignedGCNTrainer(args, edges)
trainer.setup_dataset()
trainer.create_and_train_model()
if args.test_size > 0:
trainer.save_model()
score_printer(trainer.logs)
save_logs(args, trainer.logs)
示例2: learn_model
# 需要導入模塊: import utils [as 別名]
# 或者: from utils import read_graph [as 別名]
def learn_model(args):
"""
Method to create adjacency matrix powers, read features, and learn embedding.
:param args: Arguments object.
"""
A = read_graph(args.edge_path)
model = GraRep(A, args)
model.optimize()
model.save_embedding()
示例3: main
# 需要導入模塊: import utils [as 別名]
# 或者: from utils import read_graph [as 別名]
def main():
"""
Parsing command lines, creating target matrix, fitting BANE and saving the embedding.
"""
args = parameter_parser()
tab_printer(args)
P = read_graph(args)
X = read_features(args)
model = BANE(args, P, X)
model.fit()
model.save_embedding()
示例4: __init__
# 需要導入模塊: import utils [as 別名]
# 或者: from utils import read_graph [as 別名]
def __init__(self, args):
"""
Initializing the training object.
:param args: Arguments object.
"""
self.args = args
self.graph = read_graph(self.args.edge_path)
self.initialize_model_and_features()
示例5: main
# 需要導入模塊: import utils [as 別名]
# 或者: from utils import read_graph [as 別名]
def main():
"""
Parsing command lines, creating target matrix, fitting DANMF and saving the embedding.
"""
args = parameter_parser()
tab_printer(args)
graph = read_graph(args)
model = DANMF(graph, args)
model.pre_training()
model.training()
if args.calculate_loss:
loss_printer(model.loss)
示例6: __init__
# 需要導入模塊: import utils [as 別名]
# 或者: from utils import read_graph [as 別名]
def __init__(self, args):
"""
Initializing the training object.
:param args: Arguments parsed from command line.
"""
self.args = args
self.graph = read_graph(self.args.edge_path)
self.features = read_features(self.args.feature_path)
self.device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
self.initialize_model()
self.simulate_walks()