code: def setUp(self):
      super(TestMaximumMarginalLikelihood, self).setUp()
      self.initial_state = SimpleDecoderState(
          [0, 1],
          [[], []],
          [torch.Tensor([0.0]), torch.Tensor([0.0])],
          [0, 1],
      )
      self.decoder_step = SimpleDecoderStep()
      self.targets = torch.Tensor(
          [
              [[2, 3, 4], [1, 3, 4], [1, 2, 4]],
              [[3, 4, 0], [2, 3, 4], [0, 0, 0]],
          ]
      )
      self.target_mask = torch.Tensor(
          [
              [[1, 1, 1], [1, 1, 1], [1, 1, 1]],
              [[1, 1, 0], [1, 1, 1], [0, 0, 0]],
          ]
      )
  
      self.supervision = (self.targets, self.target_mask)
      # High beam size ensures exhaustive search.
      self.trainer = MaximumMarginalLikelihood()
  
file_path: magnitude/pymagnitude/third_party/allennlp/tests/nn/decoding/decoder_trainers/maximum_marginal_likelihood_test.py
imports: from __future__ import division
  from __future__ import absolute_import
  import math
  from numpy.testing import assert_almost_equal
  import torch
  from allennlp.common.testing import AllenNlpTestCase
  from allennlp.nn.decoding.decoder_trainers import MaximumMarginalLikelihood
  from ..simple_transition_system import SimpleDecoderState, SimpleDecoderStep
label_desc: Use image node_id 1 for calling the TestMaximumMarginalLikelihood obj's underlying member method code with example usage: obj.setUp() without return types