Why binary_crossentropy and categorical_crossentropy give different performances for the same problem?

The reason for this apparent performance discrepancy between categorical & binary cross entropy is what user xtof54 has already reported in his answer below, i.e.: the accuracy computed with the Keras method evaluate is just plain wrong when using binary_crossentropy with more than 2 labels I would like to elaborate more on this, demonstrate the … Read more

What is the role of the bias in neural networks? [closed]

I think that biases are almost always helpful. In effect, a bias value allows you to shift the activation function to the left or right, which may be critical for successful learning. It might help to look at a simple example. Consider this 1-input, 1-output network that has no bias: The output of the network … Read more

Is there any standard rule for considering the best result or at which stage I have to stop train the data with minimum error

Normally, if you are using a neural network, you should not have too different results between different runs on the same training set. So, first of all, check that your algorithm is working correctly using some standard benchmark problems (like iris/wisconsin from UCI repository) Regarding when to stop the training, there are two options: 1. … Read more

How can I use a weight matrix created by a trained neural network to make predictions in another file?

Save your model or the weights of your model: model.save(filename) np.save(filename, model.get_weights()) For loading, in the first case: from keras.models import load_model model = load_model(filename) In the second case: #recreate the model then: model.set_weights(np.load(filename)) Then: results = model.predict(batch_of_data)