BCEWithLogitsLoss¶
- class dragon.vm.torch.nn.BCEWithLogitsLoss(
 weight=None,
 size_average=None,
 reduce=None,
 reduction='mean',
 pos_weight=None
 )[source]¶
- Compute the sigmoid cross entropy. - Examples: - m = torch.nn.BCEWithLogitsLoss() loss = m(torch.randn(2, 1), torch.tensor([0., 1.], 'float32')) 
__init__¶
- BCEWithLogitsLoss.- __init__(
 weight=None,
 size_average=None,
 reduce=None,
 reduction='mean',
 pos_weight=None
 )[source]¶
- Create a - BCEWithLogitsLossmodule.- Parameters:
- weight (dragon.vm.torch.Tensor, optional) – The weight for each class.
- size_average (bool, optional) – Trueto set thereductionto ‘mean’.
- reduce (bool, optional) – Trueto set thereductionto ‘sum’ or ‘mean’.
- reduction ({'none', 'mean', 'sum', 'valid'}, optional) – The reduce method.
 
 
