Hello pvardanis!



 pvardanis:

My true labels are int numbers from 0 to 127 representing values from 0 to 2pi in discrete levels, due to hardware limitations.


I understand this as saying that, in some sense, your “real” problem
involves an angular variable that ranges from 0 to 2pi (and where
0 = 2pi, etc.), and that, in practice, you use 128 discrete values for
“technical” reasons.


I think I need to approach this problem as a classification task …  Thus, a CrossEntropy loss might be better.


I think that this is actually backwards.  If you treat this as a classification
problem, then you (and the CrossEntropyLoss you suggest using) are
saying that if your label for a sample is 0, then, while a prediction of 0 is
right, a prediction of 1 is just as wrong as a prediction of, say, 64.  In my
understanding of your problem, a prediction of 1 (and also 127) is quite
good, although not the very best, and a prediction of 64 is very bad.
Do you really want to penalize a prediction of 1 anywhere near as much
as a prediction of 64?


because right now it doesnt seem to converge,


Well, that’s a problem, but I really don’t think working with a seven-bit
discretization of an angular variable is the cause.


plus I think it’s a little bottleneck to try to predict continuous values when my true labels are not continuous.


I don’t see this as a problem.  128 values (seven bits) is a bit coarse,
but still a fair approximation to a continuous variable.
Best.
K. Frank