How does Keras evaluate loss on a test case?

I am implementing a neural network classifier to print out the loss and accuracy of this NN, which I use:

score = model.evaluate(x_test, y_test, verbose=False) 
model.metrics_names
print('Test score: ', score[0])    #Loss on test
print('Test accuracy: ', score[1])

I would like to know how Keras calculates the loss of a model. Especially if it is evaluated in the first (and only) step of the test suite. I have a search on keras.io but I haven't found anything about it.

+6
source share
2 answers

From the documentation :

evaluate

Computes losses for some input data, batch by batch.

Returns

Loss of a scalar test (if the model does not have metrics) or a list of scalars (if the model calculates other metrics). The attribute model.metrics_nameswill give you display labels for scalar outputs.

, , , , , . , .. . x_test y_test.

+5

, 1 ?

0

Source: https://habr.com/ru/post/1668268/


All Articles