From f537ab86861aa6531154358a841ab4f3081f4c6e Mon Sep 17 00:00:00 2001 From: Max Gorog Date: Fri, 8 May 2026 13:16:38 -0500 Subject: [PATCH] models scene: paint the knn bar (CSS color + demo entry) The model-bar widget rendered .model-fill.knn with no gradient when a model_metric{model:"knn"} arrived, leaving an empty track. Add a green gradient and include knn in the demo-mode set so the row is visible without waiting on the producer. Co-Authored-By: Claude Opus 4.7 (1M context) --- training/dashboard/static/dashboard.css | 1 + training/dashboard/static/dashboard.js | 8 +++++++- training/dashboard/static/index.html | 4 ++-- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/training/dashboard/static/dashboard.css b/training/dashboard/static/dashboard.css index 5b581f1..7035d6e 100644 --- a/training/dashboard/static/dashboard.css +++ b/training/dashboard/static/dashboard.css @@ -987,6 +987,7 @@ html, body { overflow-anchor: none; } .model-fill.gru { background: linear-gradient(90deg, #db61a2, #a8327f); } .model-fill.rnn { background: linear-gradient(90deg, #d29922, #8a6a17); } .model-fill.bert { background: linear-gradient(90deg, #f85149, #b22e2a); } +.model-fill.knn { background: linear-gradient(90deg, #3fb950, #1a7f37); } .model-acc { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: clamp(13px, 1vw, 15px); color: var(--fg-dim); text-align: right; } diff --git a/training/dashboard/static/dashboard.js b/training/dashboard/static/dashboard.js index 9b0c7ef..73a15eb 100644 --- a/training/dashboard/static/dashboard.js +++ b/training/dashboard/static/dashboard.js @@ -1570,7 +1570,13 @@ for epoch in range(20): r.acc.textContent = accuracy.toFixed(3); } on('demo_start', () => { - [ ['rnn', 0.872], ['gru', 0.911], ['lstm', 0.928], ['bert', 0.954] ] + // KNN sits below the recurrent/transformer family; it memorizes + // the train host's feature space and generalizes worse than a + // model that learned temporal structure. Bar visible-scale starts + // at 0.5 so the real cross-host F1 (~0.43) reads as 0% — that's + // honest, just visually flat. Demo value here is the in-distribution + // ballpark for a healthier display. + [ ['knn', 0.736], ['rnn', 0.872], ['gru', 0.911], ['lstm', 0.928], ['bert', 0.954] ] .forEach(([m, a]) => render(m, a)); }); on('demo_stop', () => { rows.clear(); emptyState(); }); diff --git a/training/dashboard/static/index.html b/training/dashboard/static/index.html index 15ab772..f58ea07 100644 --- a/training/dashboard/static/index.html +++ b/training/dashboard/static/index.html @@ -4,7 +4,7 @@ CIS490 — live - +