class_docstr: Image captioning model.
docstr: Batch of images to a single loss.
docstr_tok: ["Batch","of","images","to","a","single","loss","."]
code: def forward(self, imgs, captions):
      """Batch of images to a single loss."""
      imgs = Variable(imgs)
      if self.finetune_feat_extractor:
          img_feats = self.feat_extractor(imgs)
      else:
          # Extract features with the `train` configuration set to `False` in
          # order to basically skip the dropout regularizations. This is how
          # dropout is used during standard inference. Also, since we are not
          # going to optimize the feature extractor, we explicitly set the
          # backpropgation mode to not construct any computational graphs.
          with chainer.using_config(
              "train", False
          ), chainer.no_backprop_mode():
              img_feats = self.feat_extractor(imgs)
  
      loss = self.lang_model(img_feats, captions)
  
      # Report the loss so that it can be printed, logged and plotted by
      # other trainer extensions
      reporter.report({"loss": loss}, self)
  
      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 3 for calling the ImageCaptionModel obj's underlying member method code with example usage: obj.forward(imgs, captions) and returns: loss