train: --eval-ckpt eval-only mode (v0-vs-v1 same-set val loss)
Expose eval_loss() and add a --eval-ckpt <path> branch to bin/train: load an existing checkpoint into a model of the given arch and score it on the held-out val split, then exit. Lets v0 and v1 be measured on the identical validation set (the acceptance metric) without a separate eval binary. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -153,8 +153,8 @@ pub fn train(
|
||||
|
||||
/// Mean cross-entropy over `batches` deterministic, non-overlapping windows of
|
||||
/// the validation corpus (no backward — eval only). Deterministic so val loss is
|
||||
/// comparable across steps and runs.
|
||||
fn eval_loss(
|
||||
/// comparable across steps and runs (and across models — the v0-vs-v1 metric).
|
||||
pub fn eval_loss(
|
||||
model: &TinyTransformer,
|
||||
device: Device,
|
||||
valid: &Corpus,
|
||||
|
||||
Reference in New Issue
Block a user