Skip to content

Instantly share code, notes, and snippets.

@joelouismarino
Created July 30, 2017 04:16
Show Gist options
  • Save joelouismarino/b3ab571006d4b719a4eccde1b9bc0cb6 to your computer and use it in GitHub Desktop.
Save joelouismarino/b3ab571006d4b719a4eccde1b9bc0cb6 to your computer and use it in GitHub Desktop.
import theano
def get_activations(model, layer, X_batch):
get_activations = theano.function([model.layers[0].input,K.learning_phase()], layer.output, allow_input_downcast=True)
activations = get_activations(X_batch,0)
return activations
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment