Skip to content

[BMS] StageNet with Attention#707

Merged
jhnwu3 merged 11 commits into
sunlabuiuc:masterfrom
Logiquo:stagenet_atten
Jan 14, 2026
Merged

[BMS] StageNet with Attention#707
jhnwu3 merged 11 commits into
sunlabuiuc:masterfrom
Logiquo:stagenet_atten

Conversation

@Logiquo
Copy link
Copy Markdown
Collaborator

@Logiquo Logiquo commented Dec 8, 2025

Contributor: Yongda Fan (yongdaf2@illinois.edu)

Contribution Type: Model

Description
Create a new model StageNet with Attention, with MHA layers inserted between SA-LSTM and SA-CNN.

Files to Review
pyhealth/models/stagenet_mha.py
tests/core/test_stagenet_mha.py

@Logiquo Logiquo added the component: model Contribute a new model to PyHealth label Dec 19, 2025
@Logiquo Logiquo added the status: need review Pending maintainer's review label Dec 27, 2025
@Logiquo Logiquo requested a review from jhnwu3 December 30, 2025 18:04
Copy link
Copy Markdown
Collaborator

@jhnwu3 jhnwu3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we also add it to the docs/?

I think it makes sense to stack attention between each RNN pass. So it's probably good enough here. We just need to rename the StageNet layer and also check that we can pull out both the attention scores and its gradients for the attn-grad visualizations.

Comment thread pyhealth/models/stagenet_mha.py Outdated
Comment thread pyhealth/models/stagenet_mha.py
@Logiquo Logiquo requested a review from jhnwu3 January 9, 2026 01:51
Copy link
Copy Markdown
Collaborator

@jhnwu3 jhnwu3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

@jhnwu3 jhnwu3 merged commit dc69b17 into sunlabuiuc:master Jan 14, 2026
1 check passed
@Logiquo Logiquo deleted the stagenet_atten branch January 15, 2026 04:49
racoffey pushed a commit to jburhan/PyHealth that referenced this pull request Apr 21, 2026
* Copy from stagenet

* add mha to stagenet

* rename

* Fix test

* rename class name

* Add hook for attn

* Add documentation

* Fix docstring
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component: model Contribute a new model to PyHealth status: need review Pending maintainer's review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants