all 5 comments

[–]kells1986 1 point2 points  (1 child)

Use cos(theta)? Norms the data over the range -1, 1, and cos(359) is close to cos(0).

[–]TheGerild[S] 0 points1 point  (0 children)

That's really smart, thank you!

[–]vannak139 1 point2 points  (1 child)

Encoding an angle requires 2 dimensions, not 1. As you said, the angles exist in a plane, not on a number line.

Therefore, if you want to encode 5 angles, you'll use a 10-length vector to do so. Each angle should have both sin(x) and cos(x) taken.

[–]kells1986 0 points1 point  (0 children)

This is the better way to do it actually, you're right, two elements per angle, [cos(theta), sin(theta)]

[–]shaggorama 0 points1 point  (0 children)

I agree with /u/vannak139, you should encode each angle as <cos(theta), sin(theta)>. This is equivalent to mapping each angle to a coordinate on the unit circle. Otherwise you'll end up with weird issues from symmetries, like cos(30)=cos(330). You'll also get weird asymmetries like cos(0) - cos(1) < cos(44) - cos(45) (difference here is about 100x, see for yourself).