binary_cross_entropy_with_logits

dragon.vm.torch.nn.functional.binary_cross_entropy_with_logits(
  input,
  target,
  weight=None,
  size_average=None,
  reduce=None,
  reduction='mean',
  pos_weight=None
)[source]

Compute the sigmoid cross entropy with contiguous target.

Parameters:
  • input (dragon.vm.torch.Tensor) The input tensor.
  • target (dragon.vm.torch.Tensor) The target tensor.
  • weight (dragon.vm.torch.Tensor, optional) The weight for each class.
  • size_average (bool, optional) Whether to average the loss.
  • reduce (bool, optional) Whether to reduce the loss.
  • reduction ({'none', 'mean', 'sum', 'valid'}, optional) The reduce method.
  • pos_weight (dragon.vm.torch.Tensor, optional) The weight for positive examples.
Returns:

dragon.vm.torch.Tensor The output tensor.