tausurv.nn.functional.dsm
Reference
Section titled “Reference”dsm_nll function
Section titled “dsm_nll ”dsm_nll(predictions: Tensor, event_time: Tensor, event_indicator: Tensor, *, distribution: Literal['weibull', 'lognormal'] = 'weibull', reduction: str = 'mean') -> TensorDeep Survival Machines mixture NLL (Nagpal et al., 2021).
The model predicts raw values per subject — interpreted as shape (or location), scale, and mixture-weight logits. After constraining shape/scale to be positive and softmaxing the weights, the marginal survival and density are mixtures:
The log-likelihood is computed with logsumexp for stability:
- Event (): .
- Censored (): .
Parameters
Section titled “Parameters”predictions— (n, 3K) tensor — Raw output ofDSM.forward. Columns[:K],[K:2K],[2K:3K]are the raw shape (or location), raw scale, and raw mixture logits respectively.event_time— (n,) tensorevent_indicator— (n,) tensor — for events, for right-censored.distribution— lognormal, default “weibull” — Per-component distribution family. Must match the model’sconfig.distribution_family.reduction— none, default “mean”
References
Section titled “References”Nagpal, C., Li, X., Dubrawski, A. (2021). Deep Survival Machines: Fully Parametric Survival Regression and Representation Learning for Censored Data with Competing Risks. IEEE JBHI 25(8).