Skip to content
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

Visualize attention matrix in SAITS #302

Closed
wants to merge 7 commits into from
Closed

Conversation

gugababa
Copy link

@gugababa gugababa commented Jan 19, 2024

Added file visualizeAttention.py to pypots.utils.visual for visualization of attention matrix from DMSA heads of SAITS.
The required dependencies are: numpy, seaborn, matplotlib

Fixing #178

  • I have commented my code, particularly in hard-to-understand areas.
  • I have written necessary tests and already run them locally.

WenjieDu and others added 4 commits January 16, 2024 13:23
Fixing the issue in time-decay matrix calculation and simplify the code
Roll back the delta calculation of M-RNN to the same with GRU-D
@coveralls
Copy link
Collaborator

coveralls commented Jan 20, 2024

Pull Request Test Coverage Report for Build 8246897395

Details

  • 1 of 19 (5.26%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.2%) to 81.405%

Changes Missing Coverage Covered Lines Changed/Added Lines %
pypots/utils/visual/visualizeAttention.py 0 18 0.0%
Totals Coverage Status
Change from base Build 8246332478: -0.2%
Covered Lines: 5122
Relevant Lines: 6292

💛 - Coveralls

@WenjieDu WenjieDu self-requested a review January 20, 2024 13:39
@WenjieDu WenjieDu added this to the v0.4 milestone Jan 20, 2024
@WenjieDu
Copy link
Owner

Many thanks, Anshu, for your first PR to PyPOTS! I've refactored your code by removing typos and unused imports.

Could you please run your function visualize_attention() just after obtaining results from SAITS in this line of code here

imputation_results = self.saits.predict(TEST_SET, return_latent_vars=True)

so we can test and ensure the function works well

Copy link

github-actions bot commented Feb 6, 2024

This pull request had no activity for 14 days. It will be closed in 1 week unless there is some new activity.

@github-actions github-actions bot added the stale label Feb 6, 2024
Changed typos leading to errors in the function. Returns the figure object instead of axis object. Added a parameter for setting the font scale in the heatmap
@gugababa
Copy link
Author

Hi Wenjie,

I have made edits to the file to address errors in setting axis parameters. I have also made a change to return the Figure object as opposed to an Axes object and added an option for adjusting the font scale of the Seaborn heatmap. The function has been tested locally and works with the output of self.saits.predict(). Thank you!

@github-actions github-actions bot removed the stale label Feb 12, 2024
Copy link

This pull request had no activity for 14 days. It will be closed in 1 week unless there is some new activity.

@github-actions github-actions bot added the stale label Feb 27, 2024
@github-actions github-actions bot closed this Mar 6, 2024
@WenjieDu WenjieDu reopened this Mar 12, 2024
@github-actions github-actions bot removed the stale label Mar 13, 2024
Copy link

This pull request had no activity for 14 days. It will be closed in 1 week unless there is some new activity.

@github-actions github-actions bot added the stale label Mar 28, 2024
@github-actions github-actions bot closed this Apr 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants