The Agreement Sensor measures the alignment between two latent representations, typically
from different modalities or redundant sensors. It uses cosine similarity to quantify
agreement.
Usage
agreement(z1, z2, eps = 1e-08)
Value
A list containing:
agreement
The cosine similarity score (-1 to 1).
Arguments
z1
Numeric vector or matrix. The first representation.
z2
Numeric vector or matrix. The second representation. Must have the same shape as z1.
eps
Numeric. Small constant for numerical stability. Defaults to 1e-8.
Details
Agreement Sensor
The sensor computes the cosine similarity between z1 and z2:
$$A = \frac{z_1 \cdot z_2}{||z_1|| ||z_2|| + \epsilon}$$
Values close to 1 indicate strong agreement, 0 indicates orthogonality (no agreement),
and -1 indicates opposition. In the context of RLCS, high positive agreement is generally
required for a PROCEED signal.