Struct HingeEmbeddingLossImpl#
Defined inFile loss.h
Inheritance Relationships#
Base Type#
publictorch::nn::Cloneable<HingeEmbeddingLossImpl>(Template Class Cloneable)
Struct Documentation#
- structHingeEmbeddingLossImpl:publictorch::nn::Cloneable<HingeEmbeddingLossImpl>#
Creates a criterion that measures the loss given an input tensor :math:
xand a labels tensor :math:y(containing 1 or -1).Seehttps://pytorch.org/docs/main/nn.html#torch.nn.HingeEmbeddingLoss to learn about the exact behavior of this module.
See the documentation for
torch::nn::HingeEmbeddingLossOptionsclass to learn what constructor arguments are supported for this module.Example:
HingeEmbeddingLossmodel(HingeEmbeddingLossOptions().margin(4).reduction(torch::kNone));
Public Functions
- explicitHingeEmbeddingLossImpl(HingeEmbeddingLossOptionsoptions_={})#
- virtualvoidreset()override#
reset()must perform initialization of all members with reference semantics, most importantly parameters, buffers and submodules.
- virtualvoidpretty_print(std::ostream&stream)constoverride#
Pretty prints the
HingeEmbeddingLossmodule into the givenstream.
- Tensorforward(constTensor&input,constTensor&target)#
Public Members
- HingeEmbeddingLossOptionsoptions#
The options with which this
Modulewas constructed.
- explicitHingeEmbeddingLossImpl(HingeEmbeddingLossOptionsoptions_={})#