Skip to main content

Subject continuity

The toolbox features a subject continuity loss. This may be useful if the model is trained on a dataset where the assigned subjects are expected to change smoothly and continuosly over time. This could be the case when modeling slowly changing, non-stationary data.

This can be configured using the dsr_continuous_subject_groups (list[list[int]]) parameter. Each entry in the outside list is a list of subject indices, which is regularized such that the subject vectors are continuosly changing:

Ln=i=1Nn1p(i)p(i+1)2, \mathcal{L}_n = \sum_{i=1}^{N_{n} - 1}||p^{(i)} - p^{(i+1)}||^2,

where nn is the index of the entry and pp is a subject vector. Note that the index ii goes over the given list at the nnth entry, thus the order of continuity does not have to match the order of the subject indices.

The regularization can be weighted using the alpha_subject_continuity parameter, which is part of the value_scheduler.