How can I define my own loss function?

Hi!. I am trying to define my own loss function. However I get an error when I try to compile my neural network and I do not understand why it brings that error. I have attached the model I am using for
, the definition of my loss function and the error. Any advice will be helpful. Thanks!!

The error is in the definition of Normal. I guess that your Normal class has a typo in the argument mean.