Example #1
0
    def __getitem__(self, index):
        g, target = xyz_graph_reader(os.path.join(self.root, self.ids[index]))
        if self.vertex_transform is not None:
            h = self.vertex_transform(g)

        if self.edge_transform is not None:
            g, e = self.edge_transform(g, self.e_representation)

        if self.target_transform is not None:
            target = self.target_transform(target)

        return (g, h, e), target
Example #2
0
File: qm9.py Project: lzx325/nmp_qc
    def __getitem__(self, index):
        g, target = xyz_graph_reader(os.path.join(self.root, self.ids[index]))
        if self.vertex_transform is not None:
            h = self.vertex_transform(g)

        if self.edge_transform is not None:
            g, e = self.edge_transform(g, self.e_representation)

        if self.target_transform is not None:
            target = self.target_transform(target)
        # g is the graph matrix (na,na), na: number of atoms
        # h is the list of node features, len(h): na
        # e is the dict of edge features, len(e): ne, ne: number of edges
        # target is the list of targets, len(target): nt, nt: number of targets
        return (g, h, e), target