How to choose a loss function in general?

Up until now, I have seen the mean square error and cross-entropy loss being used throughout the 1 and 2nd course, I understood why we used them but is there a general method or guideline by which we can make sure a particular loss function will work for this particular problem or not. Or is it up to us, to figure out which loss function will be compatible with our problem? I have seen a lot of loss functions used in math, so just wanted to ask this.

We can create our own custom loss functions as well in tensorflow.
We can override the relevant methods to do so.

  • Mean squared error is for regression problems.
  • Cross entropy loss for classification problem.

Hi Chris,

This site also provides a good list of loss functions and when to use what. Let us know if there’s any further clarification required.


1 Like