Please make sure that the boxes below are checked before you submit your issue. Thank you!
I am afraid, I don't fully understand what you mean by multiple inputs. If you're simply looking at getting the output of the intermediate layer, you can take a look at this.
https://keras.io/getting-started/faq/#how-can-i-visualize-the-output-of-an-intermediate-layer
@lqj1990 : Did you manage to get your answer? Could you please post it here.
@stillbreeze If you have multiple input, you can see the order of your input layer when you use model.summary() to print the structure of your network. Then you just need to pick up the order number of the input layer and use them in your code.
Let's suppose your input layer is the first and third layer, then you can use the code
get_3rd_layer_output = K.function([model.layers[0].input, model.layers[2].input, K.learning_phase()],
[model.layers[3].output])
to get the intermediate layers output.
I hope I had make it clear. (●'◡'●)
Thanks a lot!
I actually figured out that for my use case, with the new functional API, I could simply write:
model = Model(input=[input1, input2], output=[intermediate_layer, intermediate_layer2])
Thanks for the reply anyway!
@stillbreeze
where did you made the changes. i have two model which are concatenated in the last layers . how can i get intermediate ourputs
More generally you can visualise the output/activations of every layer of your model. I wrote an example with MNIST to show how here:
https://github.com/philipperemy/keras-visualize-activations
So far it's the less painful I've seen.
Most helpful comment
Thanks a lot!
I actually figured out that for my use case, with the new functional API, I could simply write:
model = Model(input=[input1, input2], output=[intermediate_layer, intermediate_layer2])Thanks for the reply anyway!