class_docstr: DeCov loss (https://arxiv.org/abs/1511.06068)
class_docstr_tok: ["DeCov","loss","(","https",":","\/\/arxiv.org\/abs\/1511.06068",")"]
code: def backward(self, inputs, grad_outputs):
      xp = backend.get_array_module(*inputs)
      (h,) = inputs
      (gcost,) = grad_outputs
      gcost_div_n = gcost / gcost.dtype.type(len(h))
      if self.reduce == "half_squared_sum":
          gh = 2.0 * self.h_centered.dot(self.covariance)
          gh *= gcost_div_n
      else:
          xp.fill_diagonal(gcost_div_n, 0.0)
          gh = self.h_centered.dot(gcost_div_n + gcost_div_n.T)
      return (gh,)
  
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 4 for calling the DeCov obj's underlying member method code with example usage: obj.backward(inputs, grad_outputs) and returns: gh