Rate this Page

Struct CTCLossOptions#

Page Contents

Struct Documentation#

struct CTCLossOptions#

Options for the CTCLoss module.

Example:

CTCLoss
model(CTCLossOptions().blank(42).zero_infinity(false).reduction(torch::kSum));

Public Types

typedef std::variant<enumtype::kNone, enumtype::kMean, enumtype::kSum> reduction_t#

Public Functions

inline auto blank(const int64_t &new_blank) -> decltype(*this)#

blank label. Default 0.

inline auto blank(int64_t &&new_blank) -> decltype(*this)#
inline const int64_t &blank() const noexcept#
inline int64_t &blank() noexcept#
inline auto reduction(const reduction_t &new_reduction) -> decltype(*this)#

Specifies the reduction to apply to the output. Default: Mean.

inline auto reduction(reduction_t &&new_reduction) -> decltype(*this)#
inline const reduction_t &reduction() const noexcept#
inline reduction_t &reduction() noexcept#
inline auto zero_infinity(const bool &new_zero_infinity) -> decltype(*this)#

Whether to zero infinite losses and the associated gradients.

Default: false. Infinite losses mainly occur when the inputs are too short to be aligned to the targets.

inline auto zero_infinity(bool &&new_zero_infinity) -> decltype(*this)#
inline const bool &zero_infinity() const noexcept#
inline bool &zero_infinity() noexcept#