class_docstr: Linear unit regularized by simplified dropconnect.
class_docstr_tok: ["Linear","unit","regularized","by","simplified","dropconnect","."]
code: def backward(self, indexes, grad_outputs):
      inputs = self.get_retained_inputs()
      ret = []
  
      scale = inputs[1].dtype.type(1.0 / (1 - self.ratio))
      x = _as_mat(inputs[0])
  
      W = inputs[1]
      if self.use_batchwise_mask:
          W = (
              chainer.functions.broadcast_to(W, self.mask.shape)
              * scale
              * self.mask
          )
      else:
          W = chainer.functions.broadcast_to(
              W * scale * self.mask, (x.shape[0],) + self.mask.shape
          )
      gy = grad_outputs[0]
  
      if 0 in indexes:
          # ij,(i)jk->ik
          gx = chainer.functions.matmul(gy[:, None, :], W).reshape(
              inputs[0].shape
          )
          gx = chainer.functions.cast(gx, x.dtype)
          ret.append(gx)
  
      if 1 in indexes:
          # ij,ik,ijk->jk
          gy2 = gy[:, :, None]
          x2 = x[:, None, :]
          shape = (gy2.shape[0], gy2.shape[1], x2.shape[2])
          gy2 = chainer.functions.broadcast_to(gy2, shape)
          x2 = chainer.functions.broadcast_to(x2, shape)
          gW = (
              chainer.functions.sum(gy2 * x2 * self.mask, axis=0)
              * scale
          )
          gW = chainer.functions.cast(gW, W.dtype)
          ret.append(gW)
  
      if 2 in indexes:
          gb = chainer.functions.sum(gy, axis=0)
          ret.append(gb)
  
      return ret
  
file_path: chainer/chainer/functions/noise/simplified_dropconnect.py
imports: import numpy
  from chainer import backend
  from chainer import function_node
  import chainer.functions
  from chainer.utils import type_check
  from chainer import variable
label_desc: Use image node_id 4 for calling the SimplifiedDropconnect obj's underlying member method code with example usage: obj.backward(indexes, grad_outputs) and returns: ret