Rate this Page

Struct AdaptiveLogSoftmaxWithLossOptions#

Page Contents

Struct Documentation#

struct AdaptiveLogSoftmaxWithLossOptions#

Options for the AdaptiveLogSoftmaxWithLoss module.

Example:

AdaptiveLogSoftmaxWithLoss model(AdaptiveLogSoftmaxWithLossOptions(8, 10,
{4, 8}).div_value(2.).head_bias(true));

Public Functions

AdaptiveLogSoftmaxWithLossOptions(int64_t in_features, int64_t n_classes, std::vector<int64_t> cutoffs)#
inline auto in_features(const int64_t &new_in_features) -> decltype(*this)#

Number of features in the input tensor.

inline auto in_features(int64_t &&new_in_features) -> decltype(*this)#
inline const int64_t &in_features() const noexcept#
inline int64_t &in_features() noexcept#
inline auto n_classes(const int64_t &new_n_classes) -> decltype(*this)#

Number of classes in the dataset.

inline auto n_classes(int64_t &&new_n_classes) -> decltype(*this)#
inline const int64_t &n_classes() const noexcept#
inline int64_t &n_classes() noexcept#
inline auto cutoffs(const std::vector<int64_t> &new_cutoffs) -> decltype(*this)#

Cutoffs used to assign targets to their buckets.

inline auto cutoffs(std::vector<int64_t> &&new_cutoffs) -> decltype(*this)#
inline const std::vector<int64_t> &cutoffs() const noexcept#
inline std::vector<int64_t> &cutoffs() noexcept#
inline auto div_value(const double &new_div_value) -> decltype(*this)#

value used as an exponent to compute sizes of the clusters. Default: 4.0

inline auto div_value(double &&new_div_value) -> decltype(*this)#
inline const double &div_value() const noexcept#
inline double &div_value() noexcept#
inline auto head_bias(const bool &new_head_bias) -> decltype(*this)#

If true, adds a bias term to the ‘head’ of the adaptive softmax.

Default: false

inline auto head_bias(bool &&new_head_bias) -> decltype(*this)#
inline const bool &head_bias() const noexcept#
inline bool &head_bias() noexcept#