class_docstr: Recurrent LSTM language model.
  
  Generate captions given features extracted from images.
docstr: Batch of image features and image captions to a singe loss.
  
  Compute the softmax cross-entropy captioning loss.
docstr_tok: ["Batch","of","image","features","and","image","captions","to","a","singe","loss",".","Compute","the","softmax","cross-entropy","captioning","loss","."]
code: def forward(self, img_feats, captions):
      """Batch of image features and image captions to a singe loss.
  
      Compute the softmax cross-entropy captioning loss.
      """
      self.reset(img_feats)
  
      loss = 0
      size = 0
      caption_length = captions.shape[1]
      for i in range(caption_length - 1):
          # Compute the loss based on the prediction of the next token in the
          # sequence
          x = Variable(self.xp.asarray(captions[:, i]))
          t = Variable(self.xp.asarray(captions[:, i + 1]))
          if (t.array == self.embed_word.ignore_label).all():
              # Preprocessed captions are padded to reach a maximum length.
              # Often, you want to set the `ignore_label` to this padding.
              # If all targets are simply paddings, predictions are no longer
              # required.
              break
          y = self.step(x)
          loss += F.softmax_cross_entropy(
              y, t, ignore_label=self.embed_word.ignore_label
          )
          size += 1
      return loss / max(size, 1)
  
imports: import numpy
  import chainer
  from chainer import functions
  from chainer import initializers
  from chainer import links
  from chainer import reporter
  from chainer import Variable
label_desc: Use image node_id 2 for calling the LSTMLanguageModel obj's underlying member method code with example usage: obj.forward(img_feats, captions) and returns: unknown