def __init__(self, c, args): super(GCN, self).__init__(c) assert args.num_layers > 0 dims, acts = get_dim_act(args) gc_layers = [] for i in range(len(dims) - 1): in_dim, out_dim = dims[i], dims[i + 1] act = acts[i] gc_layers.append( GraphConvolution(in_dim, out_dim, args.dropout, act, args.bias)) self.layers = nn.Sequential(*gc_layers) self.encode_graph = True
def __init__(self, c, args): super(GCNDecoder, self).__init__(c) act = lambda x: x self.cls = GraphConvolution(args.dim, args.n_classes, args.dropout, act, args.bias) self.decode_adj = True