class_docstr: ## Graph Attention Network (GAT)
  
  This graph attention network has two [graph attention layers](index.html).
class_docstr_tok: ["#","#","Graph","Attention","Network","(","GAT",")","This","graph","attention","network","has","two","[","graph","attention","layers","]","(","index.html",")","."]
docstr: * `in_features` is the number of features per node
  * `n_hidden` is the number of features in the first graph attention layer
  * `n_classes` is the number of classes
  * `n_heads` is the number of heads in the graph attention layers
  * `dropout` is the dropout probability
docstr_tok: ["*","`","in_features","`","is","the","number","of","features","per","node","*","`","n_hidden","`","is","the","number","of","features","in","the","first","graph","attention","layer","*","`","n_classes","`","is","the","number","of","classes","*","`","n_heads","`","is","the","number","of","heads","in","the","graph","attention","layers","*","`","dropout","`","is","the","dropout","probability"]
code: def __init__(
      self,
      in_features: int,
      n_hidden: int,
      n_classes: int,
      n_heads: int,
      dropout: float,
  ):
      """
      * `in_features` is the number of features per node
      * `n_hidden` is the number of features in the first graph attention layer
      * `n_classes` is the number of classes
      * `n_heads` is the number of heads in the graph attention layers
      * `dropout` is the dropout probability
      """
      super().__init__()
  
      # First graph attention layer where we concatenate the heads
      self.layer1 = GraphAttentionLayer(
          in_features,
          n_hidden,
          n_heads,
          is_concat=True,
          dropout=dropout,
      )
      # Activation function after first graph attention layer
      self.activation = nn.ELU()
      # Final graph attention layer where we average the heads
      self.output = GraphAttentionLayer(
          n_hidden, n_classes, 1, is_concat=False, dropout=dropout
      )
      # Dropout
      self.dropout = nn.Dropout(dropout)
  
imports: from typing import Dict
  import numpy
  import torch
  from torch import nn
  from labml import lab, monit, tracker, experiment
  from labml.configs import BaseConfigs, option, calculate
  from labml.utils import download
  from labml_helpers.device import DeviceConfigs
  from labml_helpers.module import Module
  from labml_nn.graphs.gat import GraphAttentionLayer
  from labml_nn.optimizers.configs import OptimizerConfigs
label_desc: Use image node_id 1 to create a new GAT object from inherited base classes: Module with example: obj = GAT(in_features, n_hidden, n_classes, n_heads, dropout)