The Temporal Consistency Sensor (TCS) monitors the evolution of a latent representation
over time. It quantifies "drift" as the relative rate of change and converts it
into a stability score.
Usage
tcs(z_t, z_prev, eps = 1e-06)
Value
A list containing:
drift
The relative drift score (non-negative).
consistency
The consistency score (0 to 1).
Arguments
z_t
Numeric vector or matrix. The current latent representation.
z_prev
Numeric vector or matrix. The previous latent representation. Must have the same shape as z_t.
eps
Numeric. Small constant to avoid division by zero. Defaults to 1e-6.
Details
Temporal Consistency Sensor
The sensor computes the L2 distance between the current state z_t and the previous state z_prev.
This distance is normalized by the magnitude of the previous state to produce a relative drift score.
Consistency is defined as exp(-drift).
This metric is essential for detecting "shock" events where the representation changes
too rapidly for the downstream system to adapt safely.