RankMe#
- class stable_ssl.callbacks.RankMe(name: str, target: str, queue_length: int, target_shape: int | Iterable[int])[source]#
Bases:
Callback
RankMe (effective rank) monitor using queue discovery.
RankMe measures the effective rank of feature representations by computing the exponential of the entropy of normalized singular values. This metric helps detect dimensional collapse in self-supervised learning.
- Parameters:
name – Unique name for this callback instance
target – Key in batch dict containing the feature embeddings to monitor
queue_length – Required queue length
target_shape – Shape of the target embeddings (e.g., 768 for 768-dim features)