Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get output/activation of a network layer #14

Open
maet3608 opened this issue Jul 11, 2017 · 1 comment
Open

Get output/activation of a network layer #14

maet3608 opened this issue Jul 11, 2017 · 1 comment
Assignees

Comments

@maet3608
Copy link
Owner

Example code for Keras:

@nut_function
def GetActivations(batch, model, layer, istrain=1):
from keras import backend as K

f = K.function([model.input, K.learning_phase()],
               [model.get_layer(layer).output])
return f([batch[0], istrain])

build_batch >> GetActivations(network.model) >> FlattenCol(0) >> Collect()

Having a network function for it would be nice, e.g.
build_batch >> network.activation('layername') >> Collect()

@maet3608 maet3608 self-assigned this Jul 11, 2017
@maet3608
Copy link
Owner Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant