The title might be a bit convoluted.
I have an image recognition problem where I have to detect a direction. If I represent the direction as an angle it has a discontinuity at 0-360.
This is not exactly my problem, but similar. I want to tell the time from an image of an analog clock. If it is 11:59 and I predict 00:01 then the error is wrong (11:58) but more importantly in the wrong direction.
How do I represent the output in such a way that will work in training.
Edit: Not sure why this was tagged as duplicate, the question is not about measuring distance between points on a circle, the question is on how to perform backpropagation when the output is a continuous circular variable
372 %% 360returns $12$ and12.03 %% 12returns $0.03.$ – BruceET Feb 12 '21 at 21:53359 %% 360returns359. It can be made to work with some care, essentially by taking the smaller ofxmodulo 360 and360-xmodulo 360 wherexis the difference between angles. – whuber Feb 12 '21 at 22:25