Skip to content

Conversation

@lehendo
Copy link
Contributor

@lehendo lehendo commented Jan 13, 2026

Contributor: Arjun Chatterjee (arjunc4@illinois.edu)
Contribution Type: Model

Description
Merge Jathurshan's model TFM-Tokenizer to PyHealth and be able to load his pre-trained weights

Files to review
pyhealth/models/tfm_tokenizer.py - New TFM-Tokenizer model implementation including:

TFMTokenizer - Main PyHealth-integrated model class
TFM_VQVAE2_deep - Tokenizer with frequency and temporal encoding
TFM_TOKEN_Classifier - Token-based classifier for downstream tasks
EMAVectorQuantizer - Exponential moving average VQ-VAE quantizer
Helper methods: get_embeddings(), get_tokens(), load_pretrained_weights()

pyhealth/models/init.py - Added imports for TFMTokenizer and related classes
pyproject.toml - Added dependencies: einops>=0.8.0, linear-attention-transformer>=0.19.1

@jhnwu3 jhnwu3 requested a review from Jathurshan0330 January 13, 2026 16:53
Copy link
Collaborator

@Jathurshan0330 Jathurshan0330 left a comment

Choose a reason for hiding this comment

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

The code is good and replicates tfmtokenizer well

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants