Hi I'm using neural network to solve a multi regression problem. I'm trying to predict continuous values, to be more specific I'm making a tracking algorithm to track the position of an Object, I'm trying to predict two values, the latitude and longitude of an Object. Now to calculate the loss of the Model there is some common functions like mean squared Error or mean absolute error etc.. but I'm wondering if I can use some custom function like this to calculate the distance between the two longitude and latitude values and then the loss would be the difference between the real distance (calculated from the real longitude and latitude) and the predicted distance (calculatd from the predicted longitude and latitude). this was some thoughts from me so I'm wondering if such an Idea would make sense?

anyone have an Idea whether this would work in my case better than using the mean squared error as a loss function?

I had another question in Mind. in my case I'm predicting two values (longitude and latitude) but is there a way to transform these two target values to only one value so that my neural network can learn better and faster? if yes which method should I use? should I calculate the summation of the two and make that as a new Target? does this make sense?


Using two value and using MSE is probably a better approach. I'd you combine the value to one value, like the case of summation, the network may fits to output 0 on one axis and the value on the other. The method you propose also have the same issue. There are many combination to the real distance, but only one is correct. For a neural network to learn faster, one value will not help it learn faster. Instead, accuracy is often increased if the predicted value is a one hot vector of labels instead of a single value. Hope this can help you.

| improve this answer | |
  • $\begingroup$ I didn't understand what you mean by this: " the network may fits to output 0 on one axis and the value on the other". and how can the accuracy be increased with one hot encoding? I'm trying to predict continuous values that means accuracy doesn't make sense in this case. Accuracy would make a sense in case of discrete values not continuous values $\endgroup$ – basilisk Oct 22 '19 at 10:34
  • $\begingroup$ If you use 2 values a and b and you use the (a+b) as the value to compute the loss, there is many different ways that a and b can form a combination, not only the combination (longitude and latitude) you want. $\endgroup$ – Clement Hui Oct 22 '19 at 11:28
  • $\begingroup$ exactly, that's why I hope that someone can give me a better way to do this because obviously I need to calculate the distance between two coordinates and use it as a loss function otherwise I don't know how my loss should be $\endgroup$ – basilisk Oct 22 '19 at 11:40
  • $\begingroup$ MSE should work. $\endgroup$ – Clement Hui Oct 22 '19 at 12:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.