class_docstr: DeCov loss (https://arxiv.org/abs/1511.06068)
class_docstr_tok: ["DeCov","loss","(","https",":","\/\/arxiv.org\/abs\/1511.06068",")"]
code: def forward(self, inputs):
      xp = backend.get_array_module(*inputs)
      (h,) = inputs
  
      self.h_centered = h - h.mean(axis=0, keepdims=True)
      self.covariance = self.h_centered.T.dot(self.h_centered)
      xp.fill_diagonal(self.covariance, 0.0)
      self.covariance /= len(h)
      if self.reduce == "half_squared_sum":
          cost = xp.vdot(self.covariance, self.covariance)
          cost *= h.dtype.type(0.5)
          return (utils.force_array(cost),)
      else:
          return (self.covariance,)
  
file_path: chainer/chainer/functions/loss/decov.py
imports: from chainer import backend
  from chainer import function
  from chainer import utils
  from chainer.utils import type_check
label_desc: Use image node_id 3 for calling the DeCov obj's underlying member method code with example usage: obj.forward(inputs) and returns: utils, self