PyHealth
PyHealth copied to clipboard
adding TapNet model
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.rstwith usage snippet and test instructions.
Testing
-
PYTHONPATH=. python -m pytest tests/core/test_tapnet.py- Ensure
pytestis installed in the active env. - If
~/.cache/pyhealth/is not writable, set a writableHOMEbefore running.
- Ensure