dgs.models.metric.metric.NegativeSoftmaxEuclideanDistance

class dgs.models.metric.metric.NegativeSoftmaxEuclideanDistance(*args: Any, **kwargs: Any)[source]

Class to compute the Softmax distribution of the negative Euclidean distance.

Keyword Arguments:

softmax_dim (int) – The dimension along which to compute the softmax.

__init__(*args, softmax_dim: int = -1, **kwargs)[source]

Methods

forward(input1, input2)

First compute the Euclidean distance between the two inputs, of which the second dimension has to match.