mirror of
https://github.com/wassname/moral-maps.git
synced 2026-09-11 12:20:38 +08:00
core: drop prompt_nll plumbing in analyse()
Follow-up to e8b51b2 which removed prompt_nll from GuidedResult. Nothing
in eval.py or analyse callers reads it anymore.
This commit is contained in:
@@ -153,7 +153,6 @@ def analyse(
|
||||
p_true: torch.Tensor | list[float],
|
||||
meta: list[tuple],
|
||||
bool_mass: torch.Tensor | list[float] | None = None,
|
||||
prompt_nll: list[float] | None = None,
|
||||
) -> dict[str, Any]:
|
||||
"""Aggregate raw p_true per (vid, cond, frame) into per-foundation scores.
|
||||
|
||||
@@ -214,24 +213,16 @@ def analyse(
|
||||
}
|
||||
if bool_mass is not None:
|
||||
info["bool_mass_mean"] = float(sum(map(float, bool_mass)) / len(bool_mass))
|
||||
if prompt_nll is not None:
|
||||
nlls = list(map(float, prompt_nll))
|
||||
info["prompt_nll_mean"] = float(sum(nlls) / len(nlls))
|
||||
|
||||
raw_pmass = (
|
||||
{f"{vid}|{cond}|{frame}": float(b) for (vid, _, cond, frame, _), b in zip(meta, bool_mass)}
|
||||
if bool_mass is not None else {}
|
||||
)
|
||||
raw_nll = (
|
||||
{f"{vid}|{cond}|{frame}": float(n) for (vid, _, cond, frame, _), n in zip(meta, prompt_nll)}
|
||||
if prompt_nll is not None else {}
|
||||
)
|
||||
return {
|
||||
"wrongness": float(df["s_other_violate"].mean()),
|
||||
"gap": float(df["gap"].mean()),
|
||||
"table": df,
|
||||
"raw": {f"{vid}|{cond}|{frame}": p for (vid, _, cond, frame, _), p in zip(meta, p_true)},
|
||||
"raw_pmass": raw_pmass,
|
||||
"raw_nll": raw_nll,
|
||||
"info": info,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user