title: Custom loss function in Keras based on the input data
body: <p>I am trying to create the custom loss function using Keras. I want to compute the loss function based on the input and predicted the output of the neural network. </p>
  
  <p>I tried using the customloss function in Keras. I think y_true is the output that we give for training and y_pred is the predicted output of the neural network. The below loss function is same as "mean_squared_error" loss in Keras.   </p>
  
  <pre><code>def customloss(y_true, y_pred):
      return K.mean(K.square(y_pred - y_true), axis=-1)
  </code></pre>
  
  <p>I would like to use the input to the neural network also to compute the custom loss function in addition to mean_squared_error loss. Is there a way to send an input to the neural network as an argument to the customloss function. </p>
  
  <p>Thank you.</p>