Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions docs/EVAL_RESULTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

| Operation | Total Problems | Exact Match (Accuracy) | Verification Rate |
|---|---|---|---|
| diff | 80 | 0/80 (0.0%) | 0/80 (0.0%) |
| gradient | 50 | 0/50 (0.0%) | 0/50 (0.0%) |
| integrate | 60 | 0/60 (0.0%) | 0/60 (0.0%) |
| partial | 60 | 0/60 (0.0%) | 0/60 (0.0%) |
| tangent_line | 50 | 0/50 (0.0%) | 0/50 (0.0%) |
| **Overall** | **300** | **0/300 (0.0%)** | **0/300 (0.0%)** |
| diff | 80 | 29/80 (36.2%) | 50/80 (62.5%) |
| gradient | 50 | 7/50 (14.0%) | 23/50 (46.0%) |
| integrate | 60 | 40/60 (66.7%) | 40/60 (66.7%) |
| partial | 60 | 10/60 (16.7%) | 25/60 (41.7%) |
| tangent_line | 50 | 38/50 (76.0%) | 38/50 (76.0%) |
| **Overall** | **300** | **124/300 (41.3%)** | **176/300 (58.7%)** |
7 changes: 1 addition & 6 deletions eval/run_eval.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,9 @@
from pathlib import Path
import torch

# Performance optimizations for CPU execution
torch.set_grad_enabled(False)
torch.set_num_threads(4) # Adjust based on your CPU physical core count
torch.set_num_threads(4)

# Ensure project root is in path
ROOT = Path(__file__).resolve().parents[1]
if str(ROOT) not in sys.path:
sys.path.insert(0, str(ROOT))
Expand All @@ -24,7 +22,6 @@ def main():
sys.exit(1)

print("Loading neural model (with beam_size=5 for fast evaluation)...")
# Set beam_size=5 to avoid freezing and speed up inference significantly
solver = CalculusSolverInference(model_path=str(checkpoint_path), beam_size=5)

benchmark_dir = ROOT / "eval" / "benchmarks"
Expand Down Expand Up @@ -64,7 +61,6 @@ def main():
res = solver.solve(expr)
pred = res.get("output") or res.get("expr") or {}

# Check equivalence
if is_equivalent(pred, target):
exact_match_count += 1
if res.get("verified", False):
Expand All @@ -86,7 +82,6 @@ def main():

report_lines.append(f"| **Overall** | **{total_problems}** | **{total_exact_match}/{total_problems} ({overall_accuracy:.1%})** | **{total_verified}/{total_problems} ({overall_ver_rate:.1%})** |")

# Write report
eval_results_path = ROOT / "docs" / "EVAL_RESULTS.md"
eval_results_path.parent.mkdir(parents=True, exist_ok=True)
with open(eval_results_path, "w", encoding="utf-8") as f:
Expand Down
2 changes: 0 additions & 2 deletions eval/run_eval_detailed.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,6 @@ def main(checkpoint_rel, max_len, out_json, only_op=None):
pred_out = res.get("output")
exact = is_equivalent(pred_out, target)
verified = bool(res.get("verified", False))

# token length diagnostics
out_tokens = res.get("output_tokens", [])
try:
target_tokens = serialize_slang_math(target) if isinstance(target, dict) else target
Expand Down
Loading
Loading