How to use the cogdl.options function in cogdl

To help you get started, we’ve selected a few cogdl examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github THUDM / cogdl / scripts / display_data.py View on Github external
fig, ax = plt.subplots()
        plot_network(G.subgraph(list(node_set)), node_style=use_attributes())
        plt.savefig(pic_file)
        print(f"Sampled ego network saved to {pic_file} .")


if __name__ == "__main__":
    """
    parser = argparse.ArgumentParser()
    parser.add_argument('--seed', '-s', type=int, default=0, help='random seed')
    parser.add_argument('--depth', '-d', type=int, default=3, help='neighborhood depth')
    parser.add_argument('--name', '-n', type=str, default='Cora', help='dataset name')
    parser.add_argument('--file', '-f', type=str, default='graph.jpg', help='saved file name')
    args = parser.parse_args()
    """
    parser = options.get_display_data_parser()
    args = parser.parse_args()

    if isinstance(args.seed, list):
        args.seed = args.seed[0]

    random.seed(args.seed)
    np.random.seed(args.seed)

    plot_graph(args)