Repository navigation
Multimodal stack 2/3: unified embedding, frozen text cache, unified mode in five backbones, BottleneckTransformer #1596
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
Draft
jhnwu3
wants to merge
17
commits into
mm/01-foundations
Choose a base branch
from
mm/02-unified-models
base: mm/01-foundations
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
5ac1caa
Give time embeddings a 10-year multi-scale span.
rianfyi c6ca07f
Reuse unimodal encoders and pool patch image tokens in the unified mo…
rianfyi 3f3c3f2
Flatten nested code events and expose the content embedding.
rianfyi 50e0e60
Standardize numerics before projection and bound the content scale.
rianfyi b2e67cb
Keep frozen text encoders in eval when Trainer calls train().
rianfyi ad3c39c
Avoid ambiguous -1 reshapes on batches with no note or image slots.
rianfyi 81964b0
Cache frozen [CLS] embeddings keyed on real tokens, not padded rows.
rianfyi f382bd7
Encode a frozen-cache miss once per forward, even when the cache is f…
rianfyi 61a3019
Cap the frozen text cache and expose hit/miss counters.
rianfyi e9a3e5f
Add unified-embedding mode to the Transformer.
rianfyi 88e5c4c
Add unified-embedding mode to EHRMamba.
rianfyi 3f1703d
Add unified-embedding mode to JambaEHR.
rianfyi 7748336
Add unified-embedding mode to the RNN.
rianfyi 441306c
Skip collate padding in the unified sequence.
rianfyi a66e17f
Thread collate pad_mask through the unified MLP path.
rianfyi 73608f0
Add BottleneckTransformer model with unified-embedding mode.
rianfyi bcb47f9
Use BaseModel's mode property and fix a docstring reference in Bottle…
jhnwu3 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| pyhealth.models.BottleneckTransformer | ||
| ====================================== | ||
|
|
||
|
|
||
| The shared bottleneck encoder and the complete Bottleneck Transformer model. | ||
|
|
||
| .. autoclass:: pyhealth.models.MultimodalBottleneckTransformerEncoder | ||
| :members: | ||
| :undoc-members: | ||
| :show-inheritance: | ||
|
|
||
| .. autoclass:: pyhealth.models.BottleneckTransformer | ||
| :members: | ||
| :undoc-members: | ||
| :show-inheritance: | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[medium] Autodoc target for the encoder is not exported from pyhealth.models
The page autodocs
pyhealth.models.MultimodalBottleneckTransformerEncoder, but pyhealth/models/init.py only exportsBottleneckTransformer(from .bottleneck_transformer import BottleneckTransformer as BottleneckTransformer). Sphinx will not resolve the class, so this part of the API page will be broken. Fix: point the autoclass atpyhealth.models.bottleneck_transformer.MultimodalBottleneckTransformerEncoder, or export the encoder from pyhealth/models/init.py and describe that export in the PR.