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

Merged
merged 4 commits into from
Jul 25, 2024
Merged

Visualize attention matrix in SAITS #302

merged 4 commits into from
Jul 25, 2024

Conversation

gugababa
Copy link
Contributor

@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.

@coveralls
Copy link
Collaborator

coveralls commented Jan 20, 2024

Pull Request Test Coverage Report for Build 10088161856

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 0 of 18 (0.0%) changed or added relevant lines in 1 file are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage decreased (-0.2%) to 83.883%

Changes Missing Coverage Covered Lines Changed/Added Lines %
pypots/utils/visual/visualizeAttention.py 0 18 0.0%
Files with Coverage Reduction New Missed Lines %
pypots/imputation/gpvae/model.py 1 86.21%
Totals Coverage Status
Change from base Build 10073025864: -0.2%
Covered Lines: 10576
Relevant Lines: 12608

💛 - 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
Contributor 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
@WenjieDu WenjieDu reopened this Jul 25, 2024
@WenjieDu WenjieDu merged commit b655637 into WenjieDu:dev Jul 25, 2024
5 of 18 checks passed
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.

3 participants