Skip to content

Towards Unified Sequence Representation VI: Add Unified_MLP and Unified_LogisticRegression for packed records - #1355

Draft
Logiquo wants to merge 1 commit into
feat/seq-v2-5from
feat/seq-v2-6
Draft

Logiquo wants to merge 1 commit into
feat/seq-v2-5from
feat/seq-v2-6

Conversation

@Logiquo

@Logiquo Logiquo commented Oct 30, 2026 •

Copy link
Copy Markdown
Collaborator

Sixth PR in the stack toward a unified sequence representation, on top of #1354. It adds two pooling baselines over sequence_v2 fields and static tensors, built on SequenceEmbeddingModel.

Changes

  • Unified_LogisticRegression embeds each level and mean-pools the records of every group bottom-up (an empty group gives zeros). It concatenates the field summaries with the raw static vectors and applies one linear layer.
  • Unified_MLP adds an MLP at every level and on each static field before pooling. hidden_dim, num_layers and dropout are set per field.
  • Per-step labels: each label record uses the mean of the top-level records at or before its time (a prefix mean), so it never sees later records. Fields need a series top level.
  • Both are exported from pyhealth.models and listed in the model guide, with API pages.

@github-actions

github-actions Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Test Coverage

Total: 75.21% (21499 / 28584 lines)

Modified file Coverage Lines
pyhealth/benchmarks/__init__.py 100.00% 2 / 2
pyhealth/benchmarks/_serialization.py 95.95% 71 / 74
pyhealth/benchmarks/base.py 98.33% 59 / 60
pyhealth/models/__init__.py 100.00% 56 / 56
pyhealth/models/logistic_regression.py 86.00% 129 / 150
pyhealth/models/mlp.py 76.67% 115 / 150
pyhealth/models/vae.py 96.77% 90 / 93
pyhealth/tasks/__init__.py 89.74% 35 / 39
pyhealth/tasks/covid19_cxr_generation.py 100.00% 9 / 9

Workflow run · c3d0a02

Two pooling baselines over sequence_v2 fields and static tensors, built
on SequenceEmbeddingModel.

- Unified_LogisticRegression embeds each level, mean-pools the records of
  every group bottom-up (an empty group gives zeros), concatenates the
  field summaries with the raw static vectors, and applies one linear
  layer.
- Unified_MLP adds an MLP at every level and on each static field before
  pooling; hidden_dim, num_layers and dropout are set per field.
- Per-step labels: each label record uses the mean of the top-level
  records at or before its time (a prefix mean), so it never sees later
  records. Fields need a series top level.

This branch has not been deployed

No deployments
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.

1 participant