Alireza Samadi
Alireza Samadi

Reputation: 61

graph isomorphism neural network

I am trying to understand graph isomorphism network and graph attention network through PyTorch (GIN) and GAT for some classification tasks. however, I can't find already implemented projects to read and understand as hints. there are some for GCN and they are ok. I wanted to know if anyone can suggest any kind of material except raw theoretical papers so I can refer to.

Upvotes: 1

Views: 284

Answers (1)

mindstorm84
mindstorm84

Reputation: 102

Graph Isomorphism networks (GIN) can be built using Tensorflow and spektral libraries.

Here is an example of GIN network built using above mentioned libraries:

class GIN0(Model):
    def __init__(self, channels, n_layers):
        super().__init__()
        self.conv1 = GINConv(channels, epsilon=0, mlp_hidden=[channels, channels])
        self.convs = []
        for _ in range(1, n_layers):
            self.convs.append(
                GINConv(channels, epsilon=0, mlp_hidden=[channels, channels])
            )
        self.pool = GlobalAvgPool()
        self.dense1 = Dense(channels, activation="relu")

    def call(self, inputs):
        x, a, i = inputs
        x = self.conv1([x, a])
        for conv in self.convs:
            x = conv([x, a])
        x = self.pool([x, i])
        return self.dense1(x)

You can use this model for training and testing just like any other tensorflow model with some limitations.

Upvotes: 1

Related Questions