fix(spatial): 补上"观测自己承认缺失了什么"的输入,cond.p1/cond.p1h 不再是同一张量

hidden_layers 和 hidden_faces 一直只在 digest 里,没进过张量。于是
"不存在隐藏支路"和"有隐藏支路但在视野外"到达模型时是同一个输入、标签却相反
(前者 false,后者 unknown)。这不是欠拟合,是契约承诺了、张量化却丢掉了的信息。

现在把观测的"缺失声明"投影到 query token 上:隐藏层 1..3 指示位、未见面的数量、
"确有东西被隐藏"一位、场景规模。模型因此有机会说"我看不到决定这件事的那部分"。
This commit is contained in:
liuhuajie committed 2026-12-03 18:31:25 +08:00
1 parent 1e0dcd6fb4
commit 08153b987d
4 files changed
+38 -4

No files matched your search

+1 -1
View File
@@ -37,7 +37,7 @@ def batch_loss(model, tensors):
out = model(tensors["feat"], tensors["pad_mask"], tensors["edge_index"],
tensors["edge_type"], tensors["edge_mask"], tensors["q_ents"], tensors["q_kind"],
tensors.get("edit_op"), tensors.get("edit_idx"), tensors.get("edge_removed"),
tensors.get("edge_feat"))
tensors.get("edge_feat"), tensors.get("scene"))
l_ans = F.cross_entropy(out["answer"], tensors["answer"])
l_chg = F.cross_entropy(out["change"], tensors["change"])
ev_logits = out["evidence"][tensors["edge_mask"]]