-
Notifications
You must be signed in to change notification settings - Fork 487
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
Function for visualising time series attribution #958
Comments
Summary: Add a convenience function to plot time series data with attributions overlaid (`captum.attr.visualization.visualize_timeseries_attr`). This addresses #958 . Comes with three styles, shown here for some dummy data: 1) Plot each channel in a separate panel, with separate heatmaps overlaid ![overlaid_individual](https://user-images.githubusercontent.com/30171842/174852816-f3c7d67f-d03f-4d04-91b4-6766052a640d.png) 2) Plot all channels in a single panel, with average heatmap overlaid ![overlaid_combined](https://user-images.githubusercontent.com/30171842/174852821-1ab089b2-9e30-4233-9726-dd3e3d9f03f5.png) 3) Plot each channel in a separate panel and color the graphs by attribution values at each time step ![colored_graph](https://user-images.githubusercontent.com/30171842/174852820-f0be8148-d432-43f3-a301-e783b98dece0.png) The function accepts matplotlib keyword arguments for additional styling. Pull Request resolved: #980 Reviewed By: vivekmig Differential Revision: D37495470 Pulled By: i-jones fbshipit-source-id: d218dc035d7158af39480a4df63a0bb9500f495c
@smaeland Thank you for your helpful function for plotting time series. In any case, thanks for your help. |
Hi @ic085908, here is the script I used to produce the plots shown in #980: visualize_synthetic_data.py (data is randomly generated, so it won't look exactly identical). Let me know if you run into any problems or find things that could be improved |
Hello @smaeland, I really appreciate your help. |
Great! I'll close this then, since the corresponding PR is merged now. |
🚀 Feature
Function for visualising time series along with attribution values, just like
captum.attr.visualization.visualize_image_attr
does for images.Motivation
Working with time series a lot, I often copy the same plotting function around between projects, so I think it would be great to have a basic 1D plotting method built-in. Since 1D attributions are prepared the same way as for images (normalisation and choice of sign), it would fit in nicely with the existing code. I would be happy to submit a PR with my own (adapted) plotting function, but probably best to first discuss the scope and need.
Pitch
A built-in plotting function would simplify and speed up the model development cycle. But besides convenience, it could also be valuable to new users, since the applicability of Captum to time series is somewhat undercommunicated 😄
Alternatives
Users write their own custom plotting functions. This is likely to happen anyway because of the big variation in different time series' length, number of channels, etc., but in that case, a built-in function is a good starting point.
Additional context
The text was updated successfully, but these errors were encountered: