Reputation: 5444
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:
d_loss = d.train_on_batch(X, y)
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?
Upvotes: 0
Views: 153
Reputation: 3473
d.evaluate(x, y)
will return all losses and metrics defined in your model. Refer to the documentation.
d.test_on_batch(x, y)
might also be of interest.
Upvotes: 2