PyHealth icon indicating copy to clipboard operation
PyHealth copied to clipboard

adding TapNet model

Open JustinStephan opened this issue 1 month ago • 0 comments

Summary

  • Add Time Series Attentional Prototype Network (pyhealth.models.tapnet.TapNet, TapNetLayer) that combines temporal conv, attention pooling, and learnable prototypes per feature stream, with optional embedding and prototype-attention outputs.
  • Register TapNet in pyhealth.models.__init__.
  • Add unit tests (tests/core/test_tapnet.py) covering init metadata, forward shapes/outputs, backward gradients, optional embeddings/prototype attention, and custom hyperparameters.
  • Add top-level doc TAPNET_README.rst with usage snippet and test instructions.

Testing

  • PYTHONPATH=. python -m pytest tests/core/test_tapnet.py
    • Ensure pytest is installed in the active env.
    • If ~/.cache/pyhealth/ is not writable, set a writable HOME before running.

JustinStephan avatar Dec 07 '25 23:12 JustinStephan