當前位置: 首頁>>代碼示例>>Python>>正文


Python utils.read_graph方法代碼示例

本文整理匯總了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) 
開發者ID:benedekrozemberczki,項目名稱:SGCN,代碼行數:19,代碼來源:main.py

示例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() 
開發者ID:benedekrozemberczki,項目名稱:GraRep,代碼行數:11,代碼來源:main.py

示例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() 
開發者ID:benedekrozemberczki,項目名稱:BANE,代碼行數:13,代碼來源:main.py

示例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() 
開發者ID:benedekrozemberczki,項目名稱:AttentionWalk,代碼行數:10,代碼來源:attentionwalk.py

示例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) 
開發者ID:benedekrozemberczki,項目名稱:DANMF,代碼行數:14,代碼來源:main.py

示例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() 
開發者ID:benedekrozemberczki,項目名稱:SINE,代碼行數:13,代碼來源:sine.py


注:本文中的utils.read_graph方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。