Struct CosineEmbeddingLossOptions¶
Defined in File loss.h
Page Contents
Struct Documentation¶
-
struct
torch::nn
::
CosineEmbeddingLossOptions
¶ Options for the
CosineEmbeddingLoss
module.Example:
CosineEmbeddingLoss model(CosineEmbeddingLossOptions().margin(0.5));
Public Functions
-
auto
margin
(const double &new_margin) -> decltype(*this)¶ Specifies the threshold for which the distance of a negative sample must reach in order to incur zero loss.
Should be a number from -1 to 1, 0 to 0.5 is suggested. Default: 0.0
-
auto
margin
(double &&new_margin) -> decltype(*this)¶
-
const double &
margin
() const noexcept¶
-
double &
margin
() noexcept¶
-
auto
reduction
(const reduction_t &new_reduction) -> decltype(*this)¶ Specifies the reduction to apply to the output. Default: Mean.
-
auto
reduction
(reduction_t &&new_reduction) -> decltype(*this)¶
-
const reduction_t &
reduction
() const noexcept¶
-
reduction_t &
reduction
() noexcept¶
-
auto