[from-B] Point2RBoxV2ConsistencyLoss: loss_ssa(N,1) × keep(N,) 广播成 (N,N) 外积,square_mask 失效且数值随 N 膨胀

Open Beginner friendly
#2 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
78/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Quiet
Tech stack
python, pytorch

Research direction

Start in losses/point2rbox_v2_loss.py at Point2RBoxV2ConsistencyLoss, focusing on the loss_ssa and keep/mask multiplication. Use the N=3 golden cases in tests/test_v3_head_loss.py as regression coverage. Done means the mask remains pairwise, N=3 values match the reference, and the temporary runtime workaround can be removed.

Written by the indexing model from the issue text.

Description

现象

losses/point2rbox_v2_loss.pyPoint2RBoxV2ConsistencyLossloss_ssa 形状 (N,1) 与 keep/mask 形状 (N,) 相乘触发广播 → (N,N) 外积:

  1. square_cls 的 keep 掩码失效(本应逐对置零的项经外积求和后重新混入);
  2. loss 数值随配对数 N 二次膨胀(实测 N=3 时 0.985 → 2.627)。

你们的 parity 没抓到是因为 rot 用例只有 1 对(N=1 时外积退化成标量,数值恰好一致)。

修复

keep.unsqueeze(-1)(或 loss_ssa squeeze 到 (N,)),一行。

参照

我在 B 仓库 tests/test_v3_head_loss.py 里有多对(N=3)的 golden 用例可直接搬来做回归;当前我测试里挂了标记 TEMP-PATCH(from-B) 的运行时 workaround(你的文件未动),你修复后我会移除。v3 的 loss_ss 分量在 N=3 下与 torch golden rel 2.8e-6(打补丁后)。

影响

v2/v3 训练中 ss 一致性 loss 的实际权重被放大且 square 类处理错误——你正在跑的 M6 v2 训练建议评估是否需要重启。

Dominant language
Python
Stars
1
Forks
0
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from VisionXLab/Point2RBox-v2-jittor

All issues in VisionXLab/Point2RBox-v2-jittor

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.