(self, nfeat, nhid, nclass, dropout, alpha, nheads)
Sparse version of GAT.
Sparse version of GAT.
Sparse version of GAT .
def __init__(self, nfeat, nhid, nclass, dropout, alpha, nheads):
        """Sparse version of GAT."""
        super(SpGAT, self).__init__()
        self.dropout = dropout

        self.attentions = [SpGraphAttentionLayer(nfeat, 
                                                 nhid, 
                                                 dropout=dropout, 
                                                 alpha=alpha, 
                                                 concat=True) for _ in range(nheads)]
        for i, attention in enumerate(self.attentions):
            self.add_module('attention_{}'.format(i), attention)

        self.out_att = SpGraphAttentionLayer(nhid * nheads, 
                                             nclass, 
                                             dropout=dropout, 
                                             alpha=alpha, 
                                             concat=False)
def __init__ ( self , nfeat , nhid , nclass , dropout , alpha , nheads ) : super ( SpGAT , self ) . __init__ ( ) self . dropout = dropout self . attentions = [ SpGraphAttentionLayer ( nfeat , nhid , dropout = dropout , alpha = alpha , concat = True ) for _ in range ( nheads ) ] for i , attention in enumerate ( self . attentions ) : self . add_module ( 'attention_{}' . format ( i ) , attention ) self . out_att = SpGraphAttentionLayer ( nhid * nheads , nclass , dropout = dropout , alpha = alpha , concat = False )