I have a model in Keras which I\'m optimizing the mean squared error. However, if I use the same code as in losses.py from Keras in the metric, I get a differen
losses.py
Remember - that if you use any kind of regularization - it affects your loss. Your actual loss is equal to:
loss
loss = mse + regularization
and this is where your discrepancy comes from.