Skip to content

Instantly share code, notes, and snippets.

@visionNoob
Created September 30, 2019 07:38
Show Gist options
  • Save visionNoob/f2596e2d907af4462712c66b232f8ded to your computer and use it in GitHub Desktop.
Save visionNoob/f2596e2d907af4462712c66b232f8ded to your computer and use it in GitHub Desktop.
from keras import backend as K
inp = model.input # input placeholder
outputs = [layer.output for layer in model.layers] # all layer outputs
functor = K.function([inp, K.learning_phase()], outputs ) # evaluation function
# Testing
test = x_test[0][np.newaxis,...]
layer_outs = functor([test, 1.])
#print layer_outs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment