# -*- coding: utf-8 -*-"""Graph Neural Networks Encoders"""# Author: Kay Liu <zliu234@uic.edu># License: BSD 2 clauseimporttorchimporttorch.nn.functionalasFfrom.convimportGNAConv
[docs]classGNA(torch.nn.Module):""" Graph Node Attention Network (GNA). See :cite:`yuan2021higher` for more details. """def__init__(self,in_channels,hidden_channels,num_layers,out_channels,dropout,act):super().__init__()self.layers=torch.nn.ModuleList()self.layers.append(GNAConv(in_channels,hidden_channels))forlayerinrange(num_layers-2):self.layers.append(GNAConv(hidden_channels,hidden_channels))self.layers.append(GNAConv(hidden_channels,out_channels))self.dropout=dropoutself.act=act