예제 #1
0
from util.train import execute_train, build_arg_parser

# Training settings
parser = build_arg_parser()
parser.add_argument('--nheads', type=int, default=4, help='Number of attentions heads.')
parser.add_argument('--alpha', type=float, default=0.2, help='Alpha for the leaky_relu.')
args = parser.parse_args()

execute_train(gnn_args=dict(nfeat=None,
                            nhid=args.hidden,
                            nodes_out=None,
                            graph_out=None,
                            dropout=args.dropout,
                            device=None,
                            first_conv_descr=dict(layer_type=GATLayer,
                                                  args=dict(
                                                      nheads=args.nheads,
                                                      alpha=args.alpha
                                                  )),
                            middle_conv_descr=dict(layer_type=GATLayer,
                                                   args=dict(
                                                       nheads=args.nheads,
                                                       alpha=args.alpha
                                                   )),
                            fc_layers=args.fc_layers,
                            conv_layers=args.conv_layers,
                            skip=args.skip,
                            gru=args.gru,
                            fixed=args.fixed,
                            variable=args.variable), args=args)
예제 #2
0
파일: train.py 프로젝트: jdc08161063/pna
execute_train(gnn_args=dict(nfeat=None,
                            nhid=args.hidden,
                            nodes_out=None,
                            graph_out=None,
                            dropout=args.dropout,
                            device=None,
                            first_conv_descr=dict(layer_type=PNALayer,
                                                  args=dict(
                                                      aggregators=args.aggregators.split(),
                                                      scalers=args.scalers.split(), avg_d=None,
                                                      towers=args.towers,
                                                      self_loop=args.self_loop,
                                                      divide_input=False,
                                                      pretrans_layers=args.pretrans_layers,
                                                      posttrans_layers=args.posttrans_layers
                                                  )),
                            middle_conv_descr=dict(layer_type=PNALayer,
                                                   args=dict(
                                                       aggregators=args.aggregators.split(),
                                                       scalers=args.scalers.split(),
                                                       avg_d=None, towers=args.towers,
                                                       self_loop=args.self_loop,
                                                       divide_input=True,
                                                       pretrans_layers=args.pretrans_layers,
                                                       posttrans_layers=args.posttrans_layers
                                                   )),
                            fc_layers=args.fc_layers,
                            conv_layers=args.conv_layers,
                            skip=args.skip,
                            gru=args.gru,
                            fixed=args.fixed,
                            variable=args.variable), args=args)
예제 #3
0
    '--gin_fc_layers',
    type=int,
    default=2,
    help='Number of fully connected layers after the aggregation.')
parser.add_argument('--aggregation',
                    type=str,
                    default='mean',
                    help='Type of LAF aggregation')
args = parser.parse_args()

execute_train(gnn_args=dict(
    nfeat=None,
    nhid=args.hidden,
    nodes_out=None,
    graph_out=None,
    dropout=args.dropout,
    device=None,
    first_conv_descr=dict(layer_type=GINLafLayer,
                          args=dict(function=args.aggregation,
                                    fc_layers=args.gin_fc_layers)),
    middle_conv_descr=dict(layer_type=GINLafLayer,
                           args=dict(function=args.aggregation,
                                     fc_layers=args.gin_fc_layers)),
    fc_layers=args.fc_layers,
    conv_layers=args.conv_layers,
    skip=args.skip,
    gru=args.gru,
    fixed=args.fixed,
    variable=args.variable),
              args=args)