Rate this Page

Struct HingeEmbeddingLossImpl#

Inheritance Relationships#

Base Type#

Struct Documentation#

structHingeEmbeddingLossImpl:publictorch::nn::Cloneable<HingeEmbeddingLossImpl>#

Creates a criterion that measures the loss given an input tensor :math:x and 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 fortorch::nn::HingeEmbeddingLossOptions class 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 theHingeEmbeddingLoss module into the givenstream.

Tensorforward(constTensor&input,constTensor&target)#

Public Members

HingeEmbeddingLossOptionsoptions#

The options with which thisModule was constructed.