title: Calculate the loss of discriminator in keras
body: <p>I want to calculate the loss error of the discriminator in keras, however, without updating the weights of the network. So far, I am using the following function (train_on_batch) to update the weights of the network using the gradient descent:</p>
  
  <pre><code>d_loss = d.train_on_batch(X, y)
  </code></pre>
  
  <p>However, what I want to do is firstly to calculate the d_loss and then to update the weights according to the d_loss value. How can i do so in Keras?</p>