pub fn sparse_goal_reward(
achieved: &[f32],
desired: &[f32],
tolerance: f32,
) -> f32Expand description
Compute sparse goal-conditioned reward.
Returns 0.0 if ||achieved - desired||_2 < tolerance, else -1.0.
Uses squared distance comparison to avoid a costly sqrt.