[{'role': 'system', 'content': "You are an expert in machine learning and your task is to classify code snippets into one of the following categories: ['helper_functions', 'load_data', 'data_exploration', 'data_preprocessing', 'evaluation', 'modelling', 'prediction', 'result_visualization', 'save_results', 'comment_only']."}, {'role': 'user', 'content': 'Identify the single most appropriate category to which the provided code belongs. Provide your response as a single category label without any additional information, commentary, or personal opinions.\\nPython Code:encoder_hidden_sz = 400\n\ndevice = torch.device("cuda")\n\nclass CorefResolver(nn.Module):\n  def __init__(self, encoder, dropout_p=0.3):\n    super(CorefResolver, self).__init__()\n    self.encoder = encoder\n    self.dropout = nn.Dropout(dropout_p)\n    self.hidden2hidden = nn.Linear(encoder_hidden_sz * 2 + 1, 25)\n    self.hidden2logits = nn.Linear(50, 3)\n    self.relu = nn.ReLU()\n    self.activation = nn.LogSoftmax(dim=1)\n    self.loss = nn.NLLLoss()\n    \n  def forward(self, seqs, offsets, labels=None):\n    encoded = self.dropout(self.encoder(seqs)[0][2])\n    a_q = list()\n    b_q = list()\n    for enc, offs in zip(encoded, offsets):\n      # extract the hidden states that correspond to A, B and the pronoun, and make pairs of those \n      a_repr = enc[offs[2]]\n      b_repr = enc[offs[4]]\n      a_q.append(torch.cat([enc[offs[0]], a_repr, torch.dot(enc[offs[0]], a_repr).unsqueeze(0)]))\n      b_q.append(torch.cat([enc[offs[0]], b_repr, torch.dot(enc[offs[0]], b_repr).unsqueeze(0)]))\n    a_q = torch.stack(a_q)\n    b_q = torch.stack(b_q)\n    # apply the same "detector" layer to both batches of pairs\n    is_a = self.relu(self.dropout(self.hidden2hidden(a_q)))\n    is_b = self.relu(self.dropout(self.hidden2hidden(b_q)))\n    # concatenate outputs of the "detector" layer to get the final probability distribution\n    is_a_b = torch.cat([is_a, is_b], dim=1)\n    is_logits = self.hidden2logits(self.dropout(self.relu(is_a_b)))\n\n    activation = self.activation(is_logits)\n    if labels is not None:\n      return activation, self.loss(activation, labels)\n    else:\n      return activation'}, {'role': 'assistant', 'content': 'helper_functions'}]