Hi, I believe there may be an issue with SmoothGrad and IntegratedGradients methods when there's need to set allow_lambda_layers=True during the creation of the analyzer.
In particular I think that "allow_lambda_layers" is missing in kwargs_keys defined in the __init__() method of both classes SmoothGrad and IntegratedGradient, so it cannot be passed to the inner Gradient constructor for both methods.
A snippet of the code I use is the following (but the same happens for method "integrated_gradients"):
Traceback (most recent call last):
File "/home/davide/PycharmProjects/innvestigate-gui/innvestigate-gui/main.py", line 890, in visualize
allow_lambda_layers=True)
File "/usr/local/lib/python3.6/dist-packages/innvestigate/analyzer/__init__.py", line 140, in create_analyzer
return analyzer_class(model, **kwargs)
File "/usr/local/lib/python3.6/dist-packages/innvestigate/analyzer/gradient_based.py", line 310, in __init__
**kwargs)
File "/usr/local/lib/python3.6/dist-packages/innvestigate/analyzer/wrapper.py", line 219, in __init__
*args, **kwargs)
File "/usr/local/lib/python3.6/dist-packages/innvestigate/analyzer/wrapper.py", line 97, in __init__
*args, **kwargs)
File "/usr/local/lib/python3.6/dist-packages/innvestigate/analyzer/wrapper.py", line 49, in __init__
*args, **kwargs)
TypeError: __init__() got an unexpected keyword argument 'allow_lambda_layers'
Among these 2 methods, with all the others creating the analyzer with allow_lambda_layers=True works correctly.
If you need any extra information let me know.
Thanks.
Hi, I believe there may be an issue with SmoothGrad and IntegratedGradients methods when there's need to set
allow_lambda_layers=True
during the creation of the analyzer.In particular I think that
"allow_lambda_layers"
is missing inkwargs_keys
defined in the__init__()
method of both classesSmoothGrad
andIntegratedGradient
, so it cannot be passed to the innerGradient
constructor for both methods.A snippet of the code I use is the following (but the same happens for method "integrated_gradients"):
while the stacktrace is:
Among these 2 methods, with all the others creating the analyzer with
allow_lambda_layers=True
works correctly.If you need any extra information let me know. Thanks.