Struct KLDivLossOptions¶
Defined in File loss.h
Page Contents
Struct Documentation¶
-
struct
torch::nn
::
KLDivLossOptions
¶ Options for the
KLDivLoss
module.Example:
KLDivLoss model(KLDivLossOptions().reduction(torch::kNone).log_target(false));
Public Types
-
typedef c10::variant<enumtype::kNone, enumtype::kBatchMean, enumtype::kSum, enumtype::kMean>
reduction_t
¶
Public Functions
-
KLDivLossOptions
() = default¶
-
KLDivLossOptions
(torch::enumtype::kBatchMean reduction)¶
-
auto
reduction
(const reduction_t &new_reduction) -> decltype(*this)¶ Specifies the reduction to apply to the output.
'none'
|'batchmean'
|'sum'
|'mean'
. Default:'mean'
-
auto
reduction
(reduction_t &&new_reduction) -> decltype(*this)¶
-
const reduction_t &
reduction
() const noexcept¶
-
reduction_t &
reduction
() noexcept¶
-
auto
log_target
(const bool &new_log_target) -> decltype(*this)¶ Specifies whether
target
is accepted in the log space. Default: False.
-
auto
log_target
(bool &&new_log_target) -> decltype(*this)¶
-
const bool &
log_target
() const noexcept¶
-
bool &
log_target
() noexcept¶
-
typedef c10::variant<enumtype::kNone, enumtype::kBatchMean, enumtype::kSum, enumtype::kMean>