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

Output shape of analyze does not match input shape #226

Open
daviddliu opened this issue Oct 24, 2020 · 1 comment
Open

Output shape of analyze does not match input shape #226

daviddliu opened this issue Oct 24, 2020 · 1 comment

Comments

@daviddliu
Copy link

daviddliu commented Oct 24, 2020

On most recent commit of updates_towards_tf2.0 branch, the output of the analyzer doesn't seem to match my input:

 # Add an explicit input layer
    input_layer = KL.Input(shape=input_shape)
    x = model.layers[0](input_layer)

    for layer in model.layers[1:]:
        x = layer(x)

    new_model = tf.keras.models.Model(input_layer, x)
    analyzer = innvestigate.create_analyzer('lrp.epsilon', new_model)

    lrp_ims = analyzer.analyze(input_images)['input_3'][0]

Here, input_images is of shape (1000, 200, 100, 1), as it is a tensor of 1000 images of size 200x100. However, lrp_ims is of shape (1000, 1, 100, 1). It should clearly still be (1000, 200, 100, 1). I'm not sure what happens to the second axis' shape here?

This is not an issue on prior commit 5c67fd5, where the output of analyzer.analyze was a list, not a dictionary.

@daviddliu daviddliu reopened this Oct 24, 2020
@daviddliu
Copy link
Author

Furthermore, the output shape isn't correct if I add a batch axis, or if I do the same thing with individual images. I guess I am confused what the input tensor to analyze should be? Excited to use this package!

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

No branches or pull requests

1 participant