Skip to content

Pretrain with alignment loss #10

@l3th4l

Description

@l3th4l

Feature Request: Angular Alignment Loss for Normal Vector Comparison

Context:
We want to implement an angular alignment loss to compare predicted surface normals with their corresponding ideal normals during training. The predicted normals are not directly regressed; instead, they are computed by rotating a predicted action vector by a known angular error.


Description

This loss should compute the angular misalignment between:

  • n_hat: the error-affected surface normal (predicted),
  • n_star: the ideal surface normal (ground truth).

The predicted normal vector is computed as:

n_hat = rotate(A, theta)

Where:

  • A is the action (a unit normal vector predicted by the model),
  • theta is the angular error vector (e.g., from simulator/environment dynamics),
  • rotate(A, theta) applies the rotation defined by theta to A.

Loss Function

The final loss should be calculated as:

loss = alpha * alignment_loss(n_hat, n_star)

Where:

  • alignment_loss is a function that measures angular discrepancy (e.g., using cosine similarity or arccosine of dot product),
  • alpha is a scalar weight to control the contribution of this loss term.

Acceptance Criteria

  • Implement the rotation function rotate(A, theta)
  • Define alignment_loss (preferably cosine-based)
  • Integrate the new loss into the training pipeline
  • Validate using a toy example where angular deviation can be visualized

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions