class_docstr: Negative sampling loss layer.
  
  This link wraps the :func:`~chainer.functions.negative_sampling` function.
  It holds the weight matrix as a parameter. It also builds a sampler
  internally given a list of word counts.
  
  Args:
      in_size (int): Dimension of input vectors.
      counts (int list): Number of each identifiers.
      sample_size (int): Number of negative samples.
      power (float): Power factor :math:`\alpha`.
      dtype (numpy.dtype): Type to use in computing.
  
  .. seealso:: :func:`~chainer.functions.negative_sampling` for more detail.
  
  Attributes:
      W (~chainer.Variable): Weight parameter matrix.
docstr: forward(x, t, reduce='sum', *, return_samples=False)
  
  Computes the loss value for given input and ground truth labels.
  
  Args:
      x (~chainer.Variable): Input of the weight matrix multiplication.
      t (~chainer.Variable): Batch of ground truth labels.
      reduce (str): Reduction option. Its value must be either
          ``'sum'`` or ``'no'``. Otherwise, :class:`ValueError` is
          raised.
      return_samples (bool):
          If ``True``, the sample array is also returned.
          The sample array is a
          :math:`(\text{batch_size}, \text{sample_size} + 1)`-array of
          integers whose first column is fixed to the ground truth labels
          and the other columns are drawn from the
          :class:`chainer.utils.WalkerAlias` sampler.
  
  Returns:
      ~chainer.Variable or tuple:
          If ``return_samples`` is ``False`` (default), loss value is
          returned.
  
          Otherwise, a tuple of the loss value and the sample array
          is returned.
code: def forward(self, x, t, reduce="sum", **kwargs):
      """forward(x, t, reduce='sum', *, return_samples=False)
  
      Computes the loss value for given input and ground truth labels.
  
      Args:
          x (~chainer.Variable): Input of the weight matrix multiplication.
          t (~chainer.Variable): Batch of ground truth labels.
          reduce (str): Reduction option. Its value must be either
              ``'sum'`` or ``'no'``. Otherwise, :class:`ValueError` is
              raised.
          return_samples (bool):
              If ``True``, the sample array is also returned.
              The sample array is a
              :math:`(\\text{batch_size}, \\text{sample_size} + 1)`-array of
              integers whose first column is fixed to the ground truth labels
              and the other columns are drawn from the
              :class:`chainer.utils.WalkerAlias` sampler.
  
      Returns:
          ~chainer.Variable or tuple:
              If ``return_samples`` is ``False`` (default), loss value is
              returned.
  
              Otherwise, a tuple of the loss value and the sample array
              is returned.
  
      """
      return_samples = False
      if kwargs:
          (return_samples,) = argument.parse_kwargs(
              kwargs, ("return_samples", return_samples)
          )
  
      ret = negative_sampling.negative_sampling(
          x,
          t,
          self.W,
          self.sampler.sample,
          self.sample_size,
          reduce=reduce,
          return_samples=return_samples,
      )
      return ret
  
file_path: chainer/chainer/links/loss/negative_sampling.py
imports: import numpy
  import chainer
  from chainer.functions.loss import negative_sampling
  from chainer import link
  from chainer.utils import argument
  from chainer.utils import walker_alias
  from chainer import variable
label_desc: Use image node_id 3 for calling the NegativeSampling obj's underlying member method code with example usage: obj.forward(x, t, reduce) and returns: ret