To receive notifications about scheduled maintenance, please subscribe to the mailing-list gitlab-operations@sympa.ethz.ch. You can subscribe to the mailing-list at https://sympa.ethz.ch

Commit e257acf7 authored by Lukas Wolf's avatar Lukas Wolf
Browse files

update angle loss to MSE

parent ce0c540c
......@@ -10,4 +10,4 @@ def angle_loss(a, b):
Angles pi/2 and -pi/2 should lead to a large loss, since this is a difference by pi on the unit circle
Therefore we compute the absolute error of the "shorter" direction on the unit circle
"""
return torch.mean(torch.abs(torch.atan2(torch.sin(a - b), torch.cos(a - b))))
\ No newline at end of file
return torch.mean(torch.square(torch.abs(torch.atan2(torch.sin(a - b), torch.cos(a - b)))))
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment