Skip to content

[Metrics] Implement Cosine Similarity in Validation Pipeline #30

Description

@DsThakurRawat

Description

Currently, reflex validate and the core validate_outputs function only track absolute and relative differences (max_abs_diff, max_rel_diff).

Rationale

In 6DoF robotics, the direction of the action vector is often more critical than the absolute magnitude (especially for rotation). Cosine similarity is the industry-standard metric for verifying that a model's 'intent' remains aligned after ONNX/TensorRT optimization.

Tasks

  • Add cos_sim to the ValidationResult dataclass in src/reflex/validate.py.
  • Implement the cosine similarity calculation using np.dot / (norm_a * norm_b).
  • Surface this metric in the VERIFICATION.md report.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions