class_docstr: Recurrent NStepLSTM 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 in a single pass
  without iterating over the sequences.
docstr_tok: ["Batch","of","image","features","and","image","captions","to","a","singe","loss",".","Compute","the","softmax","cross-entropy","captioning","loss","in","a","single","pass","without","iterating","over","the","sequences","."]
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 in a single pass
      without iterating over the sequences.
      """
      hx, cx, _ = self.reset(img_feats)
  
      # Extract all inputs and targets for all captions in the batch
      xs = [c[:-1] for c in captions]  # del eos
      ts = [c[1:] for c in captions]  # del bos
  
      # Get the predictions `ys`
      _, _, ys = self.step(hx, cx, xs)
  
      # Since `ys` is concatenated, we also concatenate the target tokens
      # before computing the loss
      ts = F.concat(ts, axis=0)
  
      loss = F.softmax_cross_entropy(ys, ts)
      return loss
  
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 NStepLSTMLanguageModel obj's underlying member method code with example usage: obj.forward(img_feats, captions) and returns: loss