How to calculate prediction uncertainty using Keras?

If you want to implement dropout approach to measure uncertainty you should do the following: Implement function which applies dropout also during the test time: import keras.backend as K f = K.function([model.layers[0].input, K.learning_phase()], [model.layers[-1].output]) Use this function as uncertainty predictor e.g. in a following manner: def predict_with_uncertainty(f, x, n_iter=10): result = numpy.zeros((n_iter,) + x.shape) for … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)