anhtld commited on
Commit
6e253a2
·
verified ·
1 Parent(s): 26eaed5

manual-sync 2026-07-02T21:01:54Z workspace/scripts

Browse files
workspace/scripts/eval_positive_tangent_local_atlas.py CHANGED
@@ -31,6 +31,8 @@ def main(argv: list[str] | None = None) -> int:
31
  parser.add_argument("--neighbor-pool", type=int, default=16)
32
  parser.add_argument("--utility-weight", type=float, default=0.0)
33
  parser.add_argument("--diversity-weight", type=float, default=0.0)
 
 
34
  parser.add_argument("--all-tasks", action="store_true")
35
  parser.add_argument("--no-groups", action="store_true", help="Drop per-group rows from output.")
36
  args = parser.parse_args(argv)
@@ -44,6 +46,8 @@ def main(argv: list[str] | None = None) -> int:
44
  neighbor_pool=args.neighbor_pool,
45
  utility_weight=args.utility_weight,
46
  diversity_weight=args.diversity_weight,
 
 
47
  same_task_only=not args.all_tasks,
48
  )
49
  report = evaluate_local_atlas_retrieval(
 
31
  parser.add_argument("--neighbor-pool", type=int, default=16)
32
  parser.add_argument("--utility-weight", type=float, default=0.0)
33
  parser.add_argument("--diversity-weight", type=float, default=0.0)
34
+ parser.add_argument("--negative-margin-weight", type=float, default=0.0)
35
+ parser.add_argument("--negative-pool", type=int, default=64)
36
  parser.add_argument("--all-tasks", action="store_true")
37
  parser.add_argument("--no-groups", action="store_true", help="Drop per-group rows from output.")
38
  args = parser.parse_args(argv)
 
46
  neighbor_pool=args.neighbor_pool,
47
  utility_weight=args.utility_weight,
48
  diversity_weight=args.diversity_weight,
49
+ negative_margin_weight=args.negative_margin_weight,
50
+ negative_pool=args.negative_pool,
51
  same_task_only=not args.all_tasks,
52
  )
53
  report = evaluate_local_atlas_retrieval(
workspace/scripts/summarize_positive_tangent_local_atlas_sweep.py CHANGED
@@ -52,6 +52,8 @@ def _summarize(path: Path, data: dict[str, Any]) -> dict[str, Any]:
52
  "neighbor_pool": config.get("neighbor_pool"),
53
  "utility_weight": config.get("utility_weight"),
54
  "diversity_weight": config.get("diversity_weight"),
 
 
55
  "same_task_only": config.get("same_task_only"),
56
  "code_dim": data.get("code_dim"),
57
  "num_val_groups_with_positive": data.get("num_val_groups_with_positive"),
@@ -80,17 +82,19 @@ def _render_markdown(summary: dict[str, Any]) -> str:
80
  lines = [
81
  "# Positive Tangent Local-Atlas Retrieval Sweep",
82
  "",
83
- "| rank | file | pool | utility | diversity | same task | K16 PTR@0.20 | K16 PTR@0.40 | K16 neg@0.20 | K16 pos<neg | mean pos dist |",
84
- "|---:|---|---:|---:|---:|---|---:|---:|---:|---:|---:|",
85
  ]
86
  for index, row in enumerate(summary.get("rows", []), start=1):
87
  lines.append(
88
- "| {rank} | {file} | {pool} | {utility} | {diversity} | {same_task} | {ptr02} | {ptr04} | {neg02} | {closer} | {dist} |".format(
89
  rank=index,
90
  file=row["path"],
91
  pool=row.get("neighbor_pool", "n/a"),
92
  utility=_fmt(row.get("utility_weight")),
93
  diversity=_fmt(row.get("diversity_weight")),
 
 
94
  same_task=str(row.get("same_task_only")),
95
  ptr02=_pct(row.get("ptr_proxy_at_16_thr_0p2")),
96
  ptr04=_pct(row.get("ptr_proxy_at_16_thr_0p4")),
 
52
  "neighbor_pool": config.get("neighbor_pool"),
53
  "utility_weight": config.get("utility_weight"),
54
  "diversity_weight": config.get("diversity_weight"),
55
+ "negative_margin_weight": config.get("negative_margin_weight"),
56
+ "negative_pool": config.get("negative_pool"),
57
  "same_task_only": config.get("same_task_only"),
58
  "code_dim": data.get("code_dim"),
59
  "num_val_groups_with_positive": data.get("num_val_groups_with_positive"),
 
82
  lines = [
83
  "# Positive Tangent Local-Atlas Retrieval Sweep",
84
  "",
85
+ "| rank | file | pool | utility | diversity | neg margin | neg pool | same task | K16 PTR@0.20 | K16 PTR@0.40 | K16 neg@0.20 | K16 pos<neg | mean pos dist |",
86
+ "|---:|---|---:|---:|---:|---:|---:|---|---:|---:|---:|---:|---:|",
87
  ]
88
  for index, row in enumerate(summary.get("rows", []), start=1):
89
  lines.append(
90
+ "| {rank} | {file} | {pool} | {utility} | {diversity} | {neg_margin} | {neg_pool} | {same_task} | {ptr02} | {ptr04} | {neg02} | {closer} | {dist} |".format(
91
  rank=index,
92
  file=row["path"],
93
  pool=row.get("neighbor_pool", "n/a"),
94
  utility=_fmt(row.get("utility_weight")),
95
  diversity=_fmt(row.get("diversity_weight")),
96
+ neg_margin=_fmt(row.get("negative_margin_weight")),
97
+ neg_pool=row.get("negative_pool", "n/a"),
98
  same_task=str(row.get("same_task_only")),
99
  ptr02=_pct(row.get("ptr_proxy_at_16_thr_0p2")),
100
  ptr04=_pct(row.get("ptr_proxy_at_16_thr_0p4")),