KLDivLoss¶
- class
dragon.vm.torch.nn.
KLDivLoss
(
size_average=None,
reduce=None,
reduction='mean',
log_target=False
)[source]¶ Compute the Kullback-Leibler divergence.
Examples:
See also
__init__¶
KLDivLoss.
__init__
(
size_average=None,
reduce=None,
reduction='mean',
log_target=False
)[source]¶Create a
KDivLoss
module.- Parameters:
- size_average (bool, optional) –
True
to set thereduction
to ‘mean’. - reduce (bool, optional) –
True
to set thereduction
to ‘sum’ or ‘mean’. - reduction ({'none', 'batchmean', 'mean', 'sum'}, optional) – The reduce method.
- log_target (bool, optional, default=False) – The flag indicating whether
target
is passed in log space.
- size_average (bool, optional) –