Commit Graph

5 Commits

Author SHA1 Message Date
pikaliov
ce7892926f Add Recall@K and AP panels to train_metrics.png
train_metrics.png now has 6 panels (2x3):
  Row 1: Train Loss, Train R@1/5/10, Train AP
  Row 2: Temperature, Gates, Learning Rate

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-24 13:01:51 +03:00
pikaliov
4a05d05ccd Add Average Precision (AP) metric for train and val
- Compute AP (Mean Reciprocal Rank) in _evaluate() for both q→g and g→q
- AP saved in val.csv and train_recall.csv alongside R@K
- New AP plot panel in val_metrics.png (train vs val, both directions)
- Log AP in console output for train-recall and val epochs

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-22 08:08:48 +03:00
pikaliov
df60e83ead Add val/train loss to evaluation and plots
- _evaluate() now computes per-batch loss when loss_fn is provided
- Val loss and train recall loss saved in val.csv and train_recall.csv
- Overview plot shows train vs val loss curves side by side
- Helps detect overfitting: val loss diverging from train loss

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-22 08:05:12 +03:00
pikaliov
93ad66810d Add train recall evaluation (R@K on train subset each epoch)
- Evaluate R@K on train set (subset matching test size) alongside val
- New train_recall.csv with per-epoch train R@1/R@5/R@10
- Plot train vs val recall on same chart (solid=val, dashed=train)
- Helps detect overfitting: train R@1 up + val R@1 flat = overfit
- Train eval uses clean transforms (no augmentation)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-22 08:01:09 +03:00
pikaliov
83ce04150d Add seaborn/matplotlib metric plots, auto-generated after each eval
New: src/training/plot_metrics.py
  - train_metrics.png: loss, temperature, gates, lr
  - val_metrics.png: R@K q→g and g→q
  - overview.png: combined loss + R@1 + gates/tau

Auto-generates plots in {output_dir}/logs/ after each validation epoch.
Also callable standalone: python -m src.training.plot_metrics --log-dir ...

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-21 19:54:18 +03:00