I want to build a network that, for a given input, predicts the hour of the day. The result should be in range 0 to 24.
I tried to solve it as a classification problem but that doesn't seem to be the right way. My problem is that I don't know how to build a cyclic loss function. For example, in my case, if the network gets an output of 1 and the true label is 23 I want the distance to be 2 and not 22. Is there a layer for that which I can use?