GithubHelp home page GithubHelp logo

how to deal with multi input about keras-vis HOT 19 OPEN

raghakot avatar raghakot commented on August 30, 2024 8
how to deal with multi input

from keras-vis.

Comments (19)

raghakot avatar raghakot commented on August 30, 2024 2

I need to update the API. There are a couple of options.

  1. You want to visualize attention over all inputs or input at a specific index.
  2. Same could be done for guided backprop as well.

I guess it is reasonable to use add an additional param input_indices to various visualize methods that defaults to 0, take a single value or array of indices. Does that sound reasonable?

I am making this change unless you have any other use-cases to add.

from keras-vis.

cambermudez avatar cambermudez commented on August 30, 2024 2

Hi,

I'm trying to use visualize_saliency on a network that takes two inputs: one is a 3D image and the other is a 1D vector. I'd like to visualize saliency on the 3D image. I'm confused about the usage of the parameters 'wrt_tensor' and 'input_indices'. Could you provide an example?

In my case, the 3D image is input_1 and the 1D vector is input_2.

Thanks

from keras-vis.

kevinwu23 avatar kevinwu23 commented on August 30, 2024 1

Has this enhancement been implemented?

from keras-vis.

xangma avatar xangma commented on August 30, 2024 1

It would indeed be great to get this enhancement working. I don't mind trying to implement it myself, I just need a tiny bit more guidance than in your single post @raghakot ...

Looking to run activation maximisation for multiple inputs.

from keras-vis.

 avatar commented on August 30, 2024 1

@raghakot @xangma has there been any progress regarding this issue? It would be extremely helpful. I also asked on Stackoverflow, maybe somebody came up with a hack in the meantime:
Multiple Inputs - SO

from keras-vis.

buptxiaofeng avatar buptxiaofeng commented on August 30, 2024

It would be great to add such a param. In my case, I am trying some mutli-view architectures and I want to get the salience map of these views so that I can explore the relations among these views.

from keras-vis.

aendrs avatar aendrs commented on August 30, 2024

Has anyone made progress regarding the visualization with multiple inputs?

from keras-vis.

jawhster avatar jawhster commented on August 30, 2024

Where would input_indices need to be included to implement this enhancement? Thanks!

from keras-vis.

sulantha2006 avatar sulantha2006 commented on August 30, 2024

Is there any update on this? Is this already implemented?

from keras-vis.

manuelblancovalentin avatar manuelblancovalentin commented on August 30, 2024

More than a year after this was asked and we still don't have an answer?? Come on guys! In raghakot comment it looked like a straightforward thing to do..! I would REALLY, REALLY appreciate it if you could modify the toolbox to allow multiple inputs. I am finishing the paper I'm gonna submit to Elsevier and I would like to cite you guys in there (@raghakot)

from keras-vis.

keisen avatar keisen commented on August 30, 2024

Hi, There.

Now, I'm challenging this matter.
Anyone, please give me a trained-model file with multiple inputs.

from keras-vis.

KatieHYT avatar KatieHYT commented on August 30, 2024

Hi @keisen,
https://www.dropbox.com/s/1unw41xoivrxrgh/species_keras_Resnet50_fold4_3input.zip?dl=0
Here are the trained model (with 3 inputs) and the sample images ( input 1, input 2, and input 3 )
Thank you in advance !

from keras-vis.

keisen avatar keisen commented on August 30, 2024

@KatieHYT , Thank you so, so much !
I think this work will be completed within a few days.

from keras-vis.

keisen avatar keisen commented on August 30, 2024

Hi, @KatieHYT

I don't completed this issue yet.
Now, faceing a problem of gradients calculation of Keras (or Tensorflow),
so it may take a while.

This problem is occured on nested models.
(However, if inputs of sub-model set to as inputs of root-model, It is not occured.)
so GradCAM may be that can not be calculated with your model.

from keras-vis.

KatieHYT avatar KatieHYT commented on August 30, 2024

Hi @keisen ,
I really appreciate your help.
Attached are the model and model architecture. Hope this will help :)
https://drive.google.com/drive/folders/1DTbVejKfglvZH4t6xPNrBlO3bDbjdH3A?usp=sharing

from keras-vis.

keisen avatar keisen commented on August 30, 2024

Hi, There.

I made the implementation for this feature.
The implementation can be to calculate multi-input model.

API specification is just @raghakot's idea ( #33 (comment) ) which the argument of visualize_* functions was added input_indices.
Of course, Its default value is zero, so this feature has compatibility.

Anyone, Please try this implementation.

https://github.com/keisen/keras-vis/tree/features/%2333

@raghakot

Please make sure of the concept and API specification of this feature.
Is this just what you imagined ?
If it isn't, I'll reimplement this feature from scratch.

PR #128

@KatieHYT

Thank you for sharing model file.
I was happy because you helped me.

But, Unfortunately, I couldn't visualized using your model, i.e., It couldn't calculate gradients.
Because your model include Lambda layer between model's input tensor and three sub-models.
Sorry, Could you try other models.

Regard.

from keras-vis.

keisen avatar keisen commented on August 30, 2024

Now, faceing a problem of gradients calculation of Keras (or Tensorflow),

Since I could not find a workaround, I gave up this problem.
Nested models don't support, because may no longer able to calculate gradients with Keras.

from keras-vis.

KatieHYT avatar KatieHYT commented on August 30, 2024

Thank you so so much, @keisen ! :)

from keras-vis.

Dovermore avatar Dovermore commented on August 30, 2024

Hi,

I'm trying to use visualize_saliency on a network that takes two inputs: one is a 3D image and the other is a 1D vector. I'd like to visualize saliency on the 3D image. I'm confused about the usage of the parameters 'wrt_tensor' and 'input_indices'. Could you provide an example?

In my case, the 3D image is input_1 and the 1D vector is input_2.

Thanks

I don't think it's possible. I read the source code, the input to Optimizer is always model.input which is a list of input tensors. The only work around will be removing one of the inputs. Though I don't know how to achieve this (should be something like to feeding a constant input to the Input tensor).

from keras-vis.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.