コード例 #1
0
    def __init__(
        self,
        dataset,
        rw_hops=64,
        subgraph_size=64,
        restart_prob=0.8,
        positional_embedding_size=32,
        step_dist=[1.0, 0.0, 0.0],
    ):
        self.rw_hops = rw_hops
        self.subgraph_size = subgraph_size
        self.restart_prob = restart_prob
        self.positional_embedding_size = positional_embedding_size
        self.step_dist = step_dist
        assert positional_embedding_size > 1

        if dataset == "motif":
            self.graphs = self._create_dgl_graph2()
        else:
            self.data = data_util.create_node_classification_dataset(dataset).data
            print(self.data)
            self.graphs = [self._create_dgl_graph(self.data)]
        print(self.graphs)
        #exit(0)
        self.length = sum([g.number_of_nodes() for g in self.graphs])
        self.total = self.length
コード例 #2
0
    def __init__(self, dataset, model, hidden_size, num_shuffle, seed,
                 **model_args):
        self.data = create_node_classification_dataset(dataset).data
        self.label_matrix = self.data.y
        self.num_nodes, self.num_classes = self.data.y.shape

        self.model = build_model(model, hidden_size, **model_args)
        self.hidden_size = hidden_size
        self.num_shuffle = num_shuffle
        self.seed = seed