当前位置: 首页>>代码示例>>Python>>正文


Python param_parser.parameter_parser方法代码示例

本文整理汇总了Python中param_parser.parameter_parser方法的典型用法代码示例。如果您正苦于以下问题:Python param_parser.parameter_parser方法的具体用法?Python param_parser.parameter_parser怎么用?Python param_parser.parameter_parser使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在param_parser的用法示例。


在下文中一共展示了param_parser.parameter_parser方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: main

# 需要导入模块: import param_parser [as 别名]
# 或者: from param_parser import parameter_parser [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: main

# 需要导入模块: import param_parser [as 别名]
# 或者: from param_parser import parameter_parser [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) 
开发者ID:benedekrozemberczki,项目名称:GraphWaveletNeuralNetwork,代码行数:18,代码来源:main.py

示例3: main

# 需要导入模块: import param_parser [as 别名]
# 或者: from param_parser import parameter_parser [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() 
开发者ID:benedekrozemberczki,项目名称:MixHop-and-N-GCN,代码行数:20,代码来源:main.py

示例4: main

# 需要导入模块: import param_parser [as 别名]
# 或者: from param_parser import parameter_parser [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

示例5: main

# 需要导入模块: import param_parser [as 别名]
# 或者: from param_parser import parameter_parser [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) 
开发者ID:benedekrozemberczki,项目名称:EgoSplitting,代码行数:13,代码来源:main.py

示例6: main

# 需要导入模块: import param_parser [as 别名]
# 或者: from param_parser import parameter_parser [as 别名]
def main():
    """
    Parsing command lines, creating target matrix.
    Fitting an Attention Walker and saving the embedding.
    """
    args = parameter_parser()
    tab_printer(args)
    model = AttentionWalkTrainer(args)
    model.fit()
    model.save_model() 
开发者ID:benedekrozemberczki,项目名称:AttentionWalk,代码行数:12,代码来源:main.py

示例7: main

# 需要导入模块: import param_parser [as 别名]
# 或者: from param_parser import parameter_parser [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() 
开发者ID:benedekrozemberczki,项目名称:Splitter,代码行数:16,代码来源:main.py

示例8: main

# 需要导入模块: import param_parser [as 别名]
# 或者: from param_parser import parameter_parser [as 别名]
def main():
    """
    Parsing command lines, creating target matrix.
    Fitting SINE and saving the embedding.
    """
    args = parameter_parser()
    tab_printer(args)
    model = SINETrainer(args)
    model.fit()
    model.save_embedding() 
开发者ID:benedekrozemberczki,项目名称:SINE,代码行数:12,代码来源:main.py

示例9: main

# 需要导入模块: import param_parser [as 别名]
# 或者: from param_parser import parameter_parser [as 别名]
def main():
    """
    Parsing command line parameters, processing graphs, fitting a GAM.
    """
    args = parameter_parser()
    tab_printer(args)
    model = GAMTrainer(args)
    model.fit()
    model.score()
    model.save_predictions_and_logs() 
开发者ID:benedekrozemberczki,项目名称:GAM,代码行数:12,代码来源:main.py

示例10: execute_factorization

# 需要导入模块: import param_parser [as 别名]
# 或者: from param_parser import parameter_parser [as 别名]
def execute_factorization():
    """
    Reading the target matrix, running optimization and saving to hard drive.
    """
    args = parameter_parser()
    tab_printer(args)
    X = read_features(args.input_path)
    print("\nTraining started.\n")
    model = ADMM_NMF(X, args)
    model.optimize()
    print("\nFactors saved.\n")
    model.save_user_factors()
    model.save_item_factors() 
开发者ID:benedekrozemberczki,项目名称:NMFADMM,代码行数:15,代码来源:main.py

示例11: main

# 需要导入模块: import param_parser [as 别名]
# 或者: from param_parser import parameter_parser [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() 
开发者ID:benedekrozemberczki,项目名称:APPNP,代码行数:14,代码来源:main.py

示例12: main

# 需要导入模块: import param_parser [as 别名]
# 或者: from param_parser import parameter_parser [as 别名]
def main():
    """
    Parsing command line parameters, reading data.
    Fitting and scoring a SimGNN model.
    """
    args = parameter_parser()
    tab_printer(args)
    trainer = SimGNNTrainer(args)
    trainer.fit()
    trainer.score() 
开发者ID:benedekrozemberczki,项目名称:SimGNN,代码行数:12,代码来源:main.py

示例13: main

# 需要导入模块: import param_parser [as 别名]
# 或者: from param_parser import parameter_parser [as 别名]
def main():
    """
    Parsing command line parameters, reading data.
    Fitting and scoring a SEAL-CI model.
    """
    args = parameter_parser()
    tab_printer(args)
    trainer = SEALCITrainer(args)
    trainer.fit()
    trainer.score() 
开发者ID:benedekrozemberczki,项目名称:SEAL-CI,代码行数:12,代码来源:main.py

示例14: main

# 需要导入模块: import param_parser [as 别名]
# 或者: from param_parser import parameter_parser [as 别名]
def main():
    """
    Parsing command line parameters, processing graphs, fitting a CapsGNN.
    """
    args = parameter_parser()
    tab_printer(args)
    model = CapsGNNTrainer(args)
    model.fit()
    model.score()
    model.save_predictions() 
开发者ID:benedekrozemberczki,项目名称:CapsGNN,代码行数:12,代码来源:main.py

示例15: main

# 需要导入模块: import param_parser [as 别名]
# 或者: from param_parser import parameter_parser [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) 
开发者ID:benedekrozemberczki,项目名称:EdMot,代码行数:12,代码来源:main.py


注:本文中的param_parser.parameter_parser方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。