feat: 目标写法开关 mf_target(mf/lin/sq/mid),默认 mf 且原地路径逐位不变;float32 接线用解析高斯场自证

This commit is contained in:
cbb
2026-10-20 21:48:28 +08:00
parent 78786881e7
commit 3b8682a345
3 changed files with 97 additions and 7 deletions
+2 -1
View File
@@ -161,7 +161,8 @@ def main():
l_mf, xh = wta_loss(model, mem, Y); mf_raw = l_mf.detach(); xh = xh.float()
else:
p_neq = tc['p_neq'] if step >= warm else 0.0
l_mf, mf_raw, aux = meanflow_loss(model, mem, Y, p_neq=p_neq, return_aux=True, p_edge=tc.get('p_edge', 0.0))
l_mf, mf_raw, aux = meanflow_loss(model, mem, Y, p_neq=p_neq, return_aux=True, p_edge=tc.get('p_edge', 0.0),
target=tc.get('mf_target', 'mf'), lam=tc.get('mf_lam', 0.5))
sel = ((aux['r'] == aux['t']) & (aux['t'] <= tc.get('fk_tmax', 0.3))).nonzero(as_tuple=True)[0]
tt = aux['t'][sel][:, None, None]
xh = aux['z'][sel] - tt * aux['u'][sel] # 配对去噪估计(fp32)