marcoancona / DeepExplain

A unified framework of perturbation and gradient-based attribution methods for Deep Neural Networks interpretability. DeepExplain also includes support for Shapley Values sampling. (ICLR 2018)
https://arxiv.org/abs/1711.06104
MIT License
720 stars 133 forks source link

Explain can be called only within a DeepExplain context. #39

Open linchundan88 opened 5 years ago

linchundan88 commented 5 years ago

with DeepExplain(session=K.get_session()) as de:

I developed a RPC service which provide explanation service. Because any explain operation can only be executed within a DeepExplain context, and initialization process takes longer than generating saliency maps. I have to create another process which loads models and create a DeepExplain context, the main process communicate with it through queues. It makes the program a little complex.

Some other libraries do not need explicit execution context.

We can manually release resources.

marcoancona commented 5 years ago

Not sure I understand the question here. What takes time is the creation of a new graph with replaced gradients, not the context itself.