Guest User

Untitled

a guest
Dec 16th, 2018
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. import keras
  2.  
  3. input = ...
  4. x = keras.layer.Dense(100)(input)
  5. dp = keras.layer.Dropout(0.5)(x, training=True)
  6. output = keras.layer.Activation('relu')
  7.  
  8. model = keral.Model(input, output)
  9.  
  10. T = 1000 # Do 1000 predictions to estimate uncertainty
  11. predictions = np.array([model.predict(X_test)] for _ in range(T)])
  12.  
  13. pred_mean = results.mean(axis=0)
  14. pre_std = results.std(axis=0)
Add Comment
Please, Sign In to add comment