code: def forward_cpu(self, inputs):
      self.retain_inputs((0, 1, 2))
      x, W, gloss = inputs
  
      samples = self.samples
      gx = numpy.zeros_like(x)
      gW = numpy.zeros_like(W)
  
      for i in numpy.arange(len(self.ignore_mask))[self.ignore_mask]:
          ix = x[i]
  
          k = samples[i]
          if self.reduce == "sum":
              igy = gloss
          else:
              igy = gloss[i]
  
          w = W[k]
          f = w.dot(ix)
  
          # g == -y * gloss / (1 + exp(yf))
          f[0] *= -1
          g = igy / (1 + numpy.exp(-f))
          g[0] *= -1
  
          gx[i] = g.dot(w)
          for ik, ig in six.moves.zip(k, g):
              gW[ik] += ig * ix
      return gx, None, gW
  
imports: import numpy
  import six
  import chainer
  from chainer import backend
  from chainer.backends import cuda
  from chainer import function_node
  from chainer import utils
  from chainer.utils import argument
  from chainer.utils import precision
  from chainer.utils import type_check
label_desc: Use image node_id 2 for calling the NegativeSamplingFunctionGrad obj's underlying member method code with example usage: obj.forward_cpu(inputs) and returns: gx,  None,  gW