class_docstr: ## [Cora Dataset](https://linqs.soe.ucsc.edu/data)
  
  Cora dataset is a dataset of research papers.
  For each paper we are given a binary feature vector that indicates the presence of words.
  Each paper is classified into one of 7 classes.
  The dataset also has the citation network.
  
  The papers are the nodes of the graph and the edges are the citations.
  
  The task is to classify the nodes to the 7 classes with feature vectors and
  citation network as input.
class_docstr_tok: ["#","#","[","Cora","Dataset","]","(","https",":","\/\/linqs.soe.ucsc.edu\/data",")","Cora","dataset","is","a","dataset","of","research","papers",".","For","each","paper","we","are","given","a","binary","feature","vector","that","indicates","the","presence","of","words",".","Each","paper","is","classified","into","one","of","7","classes",".","The","dataset","also","has","the","citation","network",".","The","papers","are","the","nodes","of","the","graph","and","the","edges","are","the","citations",".","The","task","is","to","classify","the","nodes","to","the","7","classes","with","feature","vectors","and","citation","network","as","input","."]
docstr: Load the dataset
docstr_tok: ["Load","the","dataset"]
code: def __init__(self, include_edges: bool = True):
      """
      Load the dataset
      """
  
      # Whether to include edges.
      # This is test how much accuracy is lost if we ignore the citation network.
      self.include_edges = include_edges
  
      # Download dataset
      self._download()
  
      # Read the paper ids, feature vectors, and labels
      with monit.section("Read content file"):
          content = np.genfromtxt(
              str(lab.get_data_path() / "cora/cora.content"),
              dtype=np.dtype(str),
          )
      # Load the citations, it's a list of pairs of integers.
      with monit.section("Read citations file"):
          citations = np.genfromtxt(
              str(lab.get_data_path() / "cora/cora.cites"),
              dtype=np.int32,
          )
  
      # Get the feature vectors
      features = torch.tensor(
          np.array(content[:, 1:-1], dtype=np.float32)
      )
      # Normalize the feature vectors
      self.features = features / features.sum(dim=1, keepdim=True)
  
      # Get the class names and assign an unique integer to each of them
      self.classes = {s: i for i, s in enumerate(set(content[:, -1]))}
      # Get the labels as those integers
      self.labels = torch.tensor(
          [self.classes[i] for i in content[:, -1]], dtype=torch.long
      )
  
      # Get the paper ids
      paper_ids = np.array(content[:, 0], dtype=np.int32)
      # Map of paper id to index
      ids_to_idx = {id_: i for i, id_ in enumerate(paper_ids)}
  
      # Empty adjacency matrix - an identity matrix
      self.adj_mat = torch.eye(len(self.labels), dtype=torch.bool)
  
      # Mark the citations in the adjacency matrix
      if self.include_edges:
          for e in citations:
              # The pair of paper indexes
              e1, e2 = ids_to_idx[e[0]], ids_to_idx[e[1]]
              # We build a symmetrical graph, where if paper $i$ referenced
              # paper $j$ we place an adge from $i$ to $j$ as well as an edge
              # from $j$ to $i$.
              self.adj_mat[e1][e2] = True
              self.adj_mat[e2][e1] = True
  
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 2 to create a new CoraDataset object  with example: obj = CoraDataset(include_edges)