-
Notifications
You must be signed in to change notification settings - Fork 10
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
Features returned from the Captum package does not match the Captum output #56
Comments
Hi @shrezaei, would you might sharing your parametrization for both captum and TSInterpret? captum uses for IG zeros as baseline default. We use random noise, as zeros are contain information in time series and therefore do not provide masking. (More details here: #33) If you want to have a similar behavior of TSInterpet to captum you can provide the baseline in the **kwargs of the explain call: I Hope this helps to solve the issue. |
Hi @shrezaei, my guess is that the problem is the normalization of the attributions to range of [0,1] (leaned onto [1]). I opened up a parameter that takes away the normalization here: Simply set normalization = False when instantiating the method. Hope the results are now identical. [1] Ismail, Aya Abdelsalam, et al. "Benchmarking deep learning interpretability in time series predictions." Advances in neural information processing systems 33 (2020): 6441-6452. |
That is a good feature to have. I appreciate it. |
Hi @shrezaei, I just realized that TSR = True (So temporal Saliency Rescaling is turned on). For TSR = True, I could find a problem for univariate data: For univariate data the calculation of the time series feature importance leads to many time step being attributed with 0.1 as this is the fallback if the time contribution is not larger than the mean of all contributions. If the mean of all contribution is smaller that the time contribution at time step t, the feature contribution x time contribution leads to squaring (in case of attribution <1, the attribution gets smaller and smaller). In such a inconvenient setting, the default setting can lead to a higher attribution than the original attribution. If we only have one time series feature, it is supposed to be one (only feature = always most important feature). It is fixed here :
Thanks for pinpointing the issue. |
Closed due to inactivity. |
Describe the bug
The attribution returned by Saliency_PTY did not make any sense to me. So, I checked with the original Captum package and I found out that the Captum output is different than the attribution returned by TSInterpret.
Here is the output of TSinterpret
Here is the output of Captum.
The dataset is synthetic. Just a portion of Sine wave (distinguishable feature) added to a random noise. So, it is clear that the attribution of the TSInterpret is incorrect. In this example I used IG. But, this is the case for others that I tried as well.
I hope it helps you fix the issue.
The text was updated successfully, but these errors were encountered: