[Python] Torch Euclidian Norm (L2)

Discussão em 'Python' iniciado por Stack, Janeiro 20, 2025.

  1. Stack

    Stack Membro Participativo

    I am trying to compute the L2 norm between two tensors as part of a loss function, but somehow my loss ends up being NaN and I suspect it it because of the way the L2 norm is computed. Can you please explain me the difference between torch.linalg.vector_norm(x-y) and torch.norm(x-y) functions? I think that the x-y difference is getting to small and I want to make sure that these functions handle this case properly.

    Continue reading...

Compartilhe esta Página