UI pass: linked hover, normal reference line, labelled start pictures, frozen_final bars
Browse filesFiles changed (2)
- app.js+69-31
- index.html+39-6
47 unmodified lines48495051525341 unmodified lines95969798991001011021031041051061071081091101111121131141151161171181191201211221231 unmodified line1251261271281291309 unmodified lines1401411421431441455 unmodified lines1511521531541551561571581591601611621631641651661671681691701711721731741751761778 unmodified lines1861871881891901911 unmodified line1931941951961971981992002012022032042052062072082092102112122132142152165 unmodified lines2222232242252262272282292302312322332342352362372382392402412422434 unmodified lines24824925025125225325499 unmodified lines35435535635735835936047 unmodified linesif (r.key) {const k = ht("i", { class: r.key === "line" ? "key-line" : r.key === "dot" ? "key-dot" : "key-rect" }, null, row);if (r.key === "line") k.style.borderColor = r.color; else k.style.background = r.color;}ht("strong", null, r.value, row);ht("span", null, r.label, row);41 unmodified linesfor (const [s, val] of tok) { if (s > step) break; v = val; }return v;}// keyboard + pointer crosshair over a frame. pick(px) -> index; draw(i) -> {x, title, rows, y?}function crosshair(card, f, n, pick, draw) {const tip = tooltipFor(card);const line = sv("line", { class: "cross", y1: f.m.t, y2: f.H - f.m.b, visibility: "hidden" }, f.svg);const overlay = sv("rect", { x: f.m.l, y: 0, width: f.W - f.m.l - f.m.r, height: f.H, fill: "transparent" }, f.svg);let cur = 0;const plotBox = () => f.svg.getBoundingClientRect();function show(i) {cur = Math.max(0, Math.min(n - 1, i));const d = draw(cur);line.setAttribute("x1", d.x); line.setAttribute("x2", d.x); line.setAttribute("visibility", "visible");const pb = plotBox(), cb = card.getBoundingClientRect();showTip(card, tip, pb.left - cb.left + d.x, pb.top - cb.top + (d.y !== undefined ? d.y : f.m.t + 10), d.title, d.rows);}function hide() { line.setAttribute("visibility", "hidden"); hideTip(tip); if (draw.clear) draw.clear(); }overlay.addEventListener("pointermove", (e) => {const pb = plotBox();show(pick(e.clientX - pb.left));});overlay.addEventListener("pointerleave", hide);f.svg.setAttribute("tabindex", "0");f.svg.addEventListener("focus", () => show(cur));f.svg.addEventListener("blur", hide);f.svg.addEventListener("keydown", (e) => {const big = Math.max(1, Math.round(n / 20));if (e.key === "ArrowRight") { show(cur + (e.shiftKey ? big : 1)); e.preventDefault(); }1 unmodified lineif (e.key === "Escape") hide();});}function table(container, head, rows) {container.replaceChildren();const t = ht("table", null, null, container);9 unmodified lines// ---------- chart 1: the note over the run ----------function tokenChart(card, task, arm, i, opts) {const T = DATA.tasks[task], A = T.arms[arm], S = A.streams[i];const ds = DATA.ds, xmax = opts.xmax || DATA.n_steps, kmax = Math.floor((xmax - 1) / ds);const plot = card.querySelector(".plot");const W0 = plot.clientWidth;5 unmodified linesconst pts = (arr, k1) => arr.slice(0, k1 + 1).map((v, k) => `${f.x(k * ds).toFixed(1)},${f.y(v / 1000).toFixed(1)}`).join(" ");sv("polyline", { points: pts(S.raw, kmax), class: "ln orange" }, f.svg);if (opts.mean) sv("polyline", { points: pts(A.tok_mean, kmax), class: "ln gray" }, f.svg);let d = "";S.tok.forEach(([s, v], j) => {if (s > xmax) return;d += j === 0 ? `M${f.x(s).toFixed(1)},${f.y(v / 1000).toFixed(1)}` : `H${f.x(s).toFixed(1)}V${f.y(v / 1000).toFixed(1)}`;});d += `H${f.x(xmax).toFixed(1)}`;sv("path", { d, class: "ln blue" }, f.svg);crosshair(card, f, kmax + 1, (px) => Math.round(((px - f.m.l) / (f.W - f.m.l - f.m.r)) * xmax / ds),(k) => {const step = k * ds;const rows = [{ key: "line", color: "var(--blue)", value: milli(tokAt(S.tok, step)), label: "this run's note" },{ key: "line", color: "var(--orange)", value: milli(S.raw[k]), label: "critic's guess" }];if (opts.mean) rows.push({ key: "line", color: "var(--gray)", value: milli(A.tok_mean[k]), label: "average note, 20 runs" });return { x: f.x(step), title: `move ${int(step)}`, rows };});return f;}// ---------- chart 2: episode scores over the run ----------function episodeChart(card, task, arm, i) {const T = DATA.tasks[task], A = T.arms[arm], S = A.streams[i], W = DATA.window, n = DATA.n_steps;const plot = card.querySelector(".plot");const f = frame(plot, { height: 230, x0: 0, x1: n, y0: 0, y1: 1.05, yticks: [0, 0.5, 1],xticks: stepTicks(n, plot.clientWidth), xlabel: "move of the run (at the end of each episode)", ylabel: "score",8 unmodified linessv("circle", { cx: f.x(e).toFixed(1), cy: f.y(v / 1000).toFixed(1), r, class: dense ? "dot dense" : "dot" }, f.svg);}sv("path", { d, class: "ln gray" }, f.svg);const ring = sv("circle", { r: r + 3, class: "hl", visibility: "hidden" }, f.svg);const ends = S.ep.map((p) => p[0]);function nearest(step) {1 unmodified linefor (let j = 0; j < ends.length; j++) if (Math.abs(ends[j] - step) < Math.abs(ends[best] - step)) best = j;return best;}const draw = (k) => {const step = Math.min(n - 1, k * 10), w = Math.floor(step / W), j = nearest(step);const [e, v] = S.ep[j];ring.setAttribute("cx", f.x(e)); ring.setAttribute("cy", f.y(v / 1000)); ring.setAttribute("visibility", "visible");const inWin = S.ep.filter((p) => Math.floor(p[0] / W) === w).length;return { x: f.x(e), y: f.y(v / 1000), title: `episode that ended at move ${int(e)}`, rows: [{ key: "dot", color: "var(--blue)", value: milli(v), label: "its score" },{ key: "dot", color: "var(--blue)", value: milli(S.win[w]), label: `this run, moves ${int(w * W)}–${int((w + 1) * W - 1)} (${inWin} episodes)` },{ key: "line", color: "var(--gray)", value: milli(A.win_ret[w]), label: "same moves, average of 20 runs" }] };};draw.clear = () => ring.setAttribute("visibility", "hidden");crosshair(card, f, n / 10, (px) => Math.round(((px - f.m.l) / (f.W - f.m.l - f.m.r)) * n / 10), draw);}// ---------- chart 3: paper vs ours ----------function barsChart(card) {const plot = card.querySelector(".plot");const rowsPerTask = ["normal", "zero", "frozen"], bh = 12, gap = 2, rowH = 2 * bh + gap + 14, head = 26;const H = 2 * (head + rowsPerTask.length * rowH) + 44;const f = frame(plot, { height: H, x0: 0, x1: 1, y0: 0, y1: 1, xticks: [0, 0.25, 0.5, 0.75, 1], xgrid: true,ml: 70, mr: 46, mt: 4, mb: 38, xlabel: "average score (mean of 20 runs)",5 unmodified linessv("text", { x: 0, y: y0 + 16, class: "rlabel", "font-weight": "600" }, f.svg).textContent = LABEL[task];y0 += head;for (const arm of rowsPerTask) {const A = T.arms[arm], paper = T.paper[arm].split(" ± "), ours = parseFloat(A.aer_mean);sv("text", { x: f.m.l - 8, y: y0 + bh + 5, "text-anchor": "end", class: "rlabel" }, f.svg).textContent = arm;const bar = (yy, v, cls) => {const w = Math.max(1, f.x(v) - f.x(0)), rr = Math.min(4, w / 2);sv("path", { d: `M${f.x(0)},${yy}H${f.x(0) + w - rr}a${rr},${rr} 0 0 1 ${rr},${rr}V${yy + bh - rr}a${rr},${rr} 0 0 1 ${-rr},${rr}H${f.x(0)}Z`, class: cls }, f.svg);};bar(y0, parseFloat(paper[0]), "bar-paper");bar(y0 + bh + gap, ours, "bar-ours");sv("text", { x: f.x(parseFloat(paper[0])) + 5, y: y0 + bh - 2, class: "vlabel" }, f.svg).textContent = paper[0];sv("text", { x: f.x(ours) + 5, y: y0 + 2 * bh + gap - 2, class: "vlabel" }, f.svg).textContent = A.aer_mean;const hit = sv("rect", { x: 0, y: y0 - 4, width: f.W, height: 2 * bh + gap + 8, fill: "transparent", tabindex: "0" }, f.svg);const show = () => {const pb = f.svg.getBoundingClientRect(), cb = card.getBoundingClientRect();showTip(card, tip, pb.left - cb.left + f.x(Math.max(ours, parseFloat(paper[0]))), pb.top - cb.top + parseFloat(hit.getAttribute("y")),`${LABEL[task]}, ${arm}`, [{ key: "rect", color: "var(--paper)", value: T.paper[arm], label: "paper (mean ± SD)" },{ key: "rect", color: "var(--blue)", value: `${A.aer_mean} ± ${A.aer_sd}`, label: "ours (mean ± SD)" }]);};hit.addEventListener("pointerenter", show); hit.addEventListener("focus", show);4 unmodified linesconst rows = [];for (const task of ["sc", "bup"]) for (const arm of rowsPerTask) {const T = DATA.tasks[task], A = T.arms[arm];rows.push([`${LABEL[task]}, ${arm}`, T.paper[arm], `${A.aer_mean} ± ${A.aer_sd}`]);}table(document.getElementById("t-bars"), ["Task, note", "Paper (mean ± SD)", "Ours (mean ± SD)"], rows);}99 unmodified linesdocument.getElementById("c-ep-sub").textContent =`${LABEL[state.task]} · ${ARM_TEXT[state.arm]} · run ${i + 1}: ${int(A.episodes[i])} finished episodes in ${int(DATA.n_steps)} moves`;tiles();tokenChart(document.getElementById("c-token"), state.task, state.arm, i, { mean: true });episodeChart(document.getElementById("c-ep"), state.task, state.arm, i);tablesInteractive();}47 unmodified lines4849505152535441 unmodified lines969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341 unmodified line1361371381391401411421431441451461471481491509 unmodified lines1601611621631641651665 unmodified lines1721731741751761771781791801811821831841851861871881891901911921931941958 unmodified lines2042052062072082092102112122132142152161 unmodified line2182192202212222232242252262272282292302312322332342352362372382392402412422432442452465 unmodified lines2522532542552562572582592602612622632642652662672682692702712722732742752762772782794 unmodified lines28428528628728828929099 unmodified lines39039139239339439539639739847 unmodified linesif (r.key) {const k = ht("i", { class: r.key === "line" ? "key-line" : r.key === "dot" ? "key-dot" : "key-rect" }, null, row);if (r.key === "line") k.style.borderColor = r.color; else k.style.background = r.color;if (r.dash) k.classList.add("ref");}ht("strong", null, r.value, row);ht("span", null, r.label, row);41 unmodified linesfor (const [s, val] of tok) { if (s > step) break; v = val; }return v;}// Charts that share the move axis (the note and the episode scores of the selected run): a position shown in// one of them is shown in the others too. Reset whenever those charts are drawn again.let LINKED = [];// keyboard + pointer crosshair over a frame. pick(px) -> index; draw(i) -> {x, title, rows, y?}// link: {stepOf(i), indexOf(step)} joins the chart to LINKED, so the same move shows in every linked chart.function crosshair(card, f, n, pick, draw, link) {const tip = tooltipFor(card);const line = sv("line", { class: "cross", y1: f.m.t, y2: f.H - f.m.b, visibility: "hidden" }, f.svg);const overlay = sv("rect", { x: f.m.l, y: 0, width: f.W - f.m.l - f.m.r, height: f.H, fill: "transparent" }, f.svg);let cur = 0;const plotBox = () => f.svg.getBoundingClientRect();const ctl = link ? { showStep: (s) => show(link.indexOf(s), true), hide: () => hide(true) } : null;if (ctl) LINKED.push(ctl);function show(i, passive) {cur = Math.max(0, Math.min(n - 1, i));const d = draw(cur);line.setAttribute("x1", d.x); line.setAttribute("x2", d.x); line.setAttribute("visibility", "visible");const pb = plotBox(), cb = card.getBoundingClientRect();showTip(card, tip, pb.left - cb.left + d.x, pb.top - cb.top + (d.y !== undefined ? d.y : f.m.t + 10), d.title, d.rows);if (ctl && !passive) for (const o of LINKED) if (o !== ctl) o.showStep(link.stepOf(cur));}function hide(passive) {line.setAttribute("visibility", "hidden"); hideTip(tip); if (draw.clear) draw.clear();if (ctl && passive !== true) for (const o of LINKED) if (o !== ctl) o.hide();}const fromPointer = (e) => { const pb = plotBox(); show(pick(e.clientX - pb.left)); };overlay.addEventListener("pointerdown", fromPointer);overlay.addEventListener("pointermove", fromPointer);overlay.addEventListener("pointerleave", () => hide());overlay.addEventListener("pointercancel", () => hide());f.svg.setAttribute("tabindex", "0");f.svg.addEventListener("focus", () => show(cur));f.svg.addEventListener("blur", () => hide());f.svg.addEventListener("keydown", (e) => {const big = Math.max(1, Math.round(n / 20));if (e.key === "ArrowRight") { show(cur + (e.shiftKey ? big : 1)); e.preventDefault(); }1 unmodified lineif (e.key === "Escape") hide();});}// the note as a step line (it changes only at its change points)function notePath(f, tok, xmax) {let d = "";tok.forEach(([s, v], j) => {if (s > xmax) return;d += j === 0 ? `M${f.x(s).toFixed(1)},${f.y(v / 1000).toFixed(1)}` : `H${f.x(s).toFixed(1)}V${f.y(v / 1000).toFixed(1)}`;});return d + `H${f.x(xmax).toFixed(1)}`;}function table(container, head, rows) {container.replaceChildren();const t = ht("table", null, null, container);9 unmodified lines// ---------- chart 1: the note over the run ----------function tokenChart(card, task, arm, i, opts) {const T = DATA.tasks[task], A = T.arms[arm], S = A.streams[i];const R = opts.ref && arm !== "normal" ? T.arms.normal.streams[i] : null; // the same run with the normal noteconst ds = DATA.ds, xmax = opts.xmax || DATA.n_steps, kmax = Math.floor((xmax - 1) / ds);const plot = card.querySelector(".plot");const W0 = plot.clientWidth;5 unmodified linesconst pts = (arr, k1) => arr.slice(0, k1 + 1).map((v, k) => `${f.x(k * ds).toFixed(1)},${f.y(v / 1000).toFixed(1)}`).join(" ");sv("polyline", { points: pts(S.raw, kmax), class: "ln orange" }, f.svg);if (opts.mean) sv("polyline", { points: pts(A.tok_mean, kmax), class: "ln gray" }, f.svg);if (R) sv("path", { d: notePath(f, R.tok, xmax), class: "ln ref" }, f.svg);sv("path", { d: notePath(f, S.tok, xmax), class: "ln blue" }, f.svg);crosshair(card, f, kmax + 1, (px) => Math.round(((px - f.m.l) / (f.W - f.m.l - f.m.r)) * xmax / ds),(k) => {const step = k * ds;const rows = [{ key: "line", color: "var(--blue)", value: milli(tokAt(S.tok, step)), label: "this run's note" },{ key: "line", color: "var(--orange)", value: milli(S.raw[k]), label: "critic's guess" }];if (opts.mean) rows.push({ key: "line", color: "var(--gray)", value: milli(A.tok_mean[k]), label: "average note, 20 runs" });if (R) rows.push({ key: "line", dash: true, color: "var(--blue)", value: milli(tokAt(R.tok, step)), label: "same run, normal note" });return { x: f.x(step), title: `move ${int(step)}`, rows };}, opts.link ? { stepOf: (k) => k * ds, indexOf: (s) => Math.round(s / ds) } : null);return f;}// ---------- chart 2: episode scores over the run ----------function episodeChart(card, task, arm, i) {const T = DATA.tasks[task], A = T.arms[arm], S = A.streams[i], W = DATA.window, n = DATA.n_steps, ds = DATA.ds;const R = arm !== "normal" ? T.arms.normal.streams[i] : null; // the same run with the normal noteconst plot = card.querySelector(".plot");const f = frame(plot, { height: 230, x0: 0, x1: n, y0: 0, y1: 1.05, yticks: [0, 0.5, 1],xticks: stepTicks(n, plot.clientWidth), xlabel: "move of the run (at the end of each episode)", ylabel: "score",8 unmodified linessv("circle", { cx: f.x(e).toFixed(1), cy: f.y(v / 1000).toFixed(1), r, class: dense ? "dot dense" : "dot" }, f.svg);}sv("path", { d, class: "ln gray" }, f.svg);if (R) {let dr = "";R.win.forEach((v, w) => {dr += `${w === 0 ? "M" : "L"}${f.x(w * W).toFixed(1)},${f.y(v / 1000).toFixed(1)}H${f.x((w + 1) * W).toFixed(1)}`;});sv("path", { d: dr, class: "ln ref" }, f.svg);}const ring = sv("circle", { r: r + 3, class: "hl", visibility: "hidden" }, f.svg);const ends = S.ep.map((p) => p[0]);function nearest(step) {1 unmodified linefor (let j = 0; j < ends.length; j++) if (Math.abs(ends[j] - step) < Math.abs(ends[best] - step)) best = j;return best;}// the crosshair sits at the move (the same position as in the note chart); the ring marks the nearest episode endconst draw = (k) => {const step = Math.min(n - 1, k * ds), w = Math.floor(step / W), j = nearest(step);const [e, v] = S.ep[j];ring.setAttribute("cx", f.x(e)); ring.setAttribute("cy", f.y(v / 1000)); ring.setAttribute("visibility", "visible");const inWin = S.ep.filter((p) => Math.floor(p[0] / W) === w).length;const rows = [{ key: "dot", color: "var(--blue)", value: milli(v), label: `nearest episode, ended at move ${int(e)}` },{ key: "dot", color: "var(--blue)", value: milli(S.win[w]), label: `this run, moves ${int(w * W)}–${int((w + 1) * W - 1)} (${inWin} episodes)` },{ key: "line", color: "var(--gray)", value: milli(A.win_ret[w]), label: "same moves, average of 20 runs" }];if (R) rows.push({ key: "line", dash: true, color: "var(--blue)", value: milli(R.win[w]), label: "same run and moves, normal note" });return { x: f.x(step), y: f.y(v / 1000), title: `move ${int(step)}`, rows };};draw.clear = () => ring.setAttribute("visibility", "hidden");const npos = Math.floor((n - 1) / ds) + 1;crosshair(card, f, npos, (px) => Math.round(((px - f.m.l) / (f.W - f.m.l - f.m.r)) * n / ds), draw,{ stepOf: (k) => k * ds, indexOf: (s) => Math.round(s / ds) });}// ---------- chart 3: paper vs ours ----------function barsChart(card) {const plot = card.querySelector(".plot");const rowsPerTask = ["normal", "zero", "frozen", "frozen_final"], bh = 12, gap = 2, rowH = 2 * bh + gap + 14, head = 26;const H = 2 * (head + rowsPerTask.length * rowH) + 44;const f = frame(plot, { height: H, x0: 0, x1: 1, y0: 0, y1: 1, xticks: [0, 0.25, 0.5, 0.75, 1], xgrid: true,ml: 70, mr: 46, mt: 4, mb: 38, xlabel: "average score (mean of 20 runs)",5 unmodified linessv("text", { x: 0, y: y0 + 16, class: "rlabel", "font-weight": "600" }, f.svg).textContent = LABEL[task];y0 += head;for (const arm of rowsPerTask) {// frozen_final is our extra test: no paper bar, a note in its placeconst A = T.arms[arm], paper = T.paper[arm] ? T.paper[arm].split(" ± ") : null, ours = parseFloat(A.aer_mean);sv("text", { x: f.m.l - 8, y: y0 + bh + 5, "text-anchor": "end", class: "rlabel" }, f.svg).textContent = arm;const bar = (yy, v, cls) => {const w = Math.max(1, f.x(v) - f.x(0)), rr = Math.min(4, w / 2);sv("path", { d: `M${f.x(0)},${yy}H${f.x(0) + w - rr}a${rr},${rr} 0 0 1 ${rr},${rr}V${yy + bh - rr}a${rr},${rr} 0 0 1 ${-rr},${rr}H${f.x(0)}Z`, class: cls }, f.svg);};if (paper) {bar(y0, parseFloat(paper[0]), "bar-paper");sv("text", { x: f.x(parseFloat(paper[0])) + 5, y: y0 + bh - 2, class: "vlabel" }, f.svg).textContent = paper[0];} else {sv("text", { x: f.x(0) + 2, y: y0 + bh - 2, class: "alabel" }, f.svg).textContent = "not in the paper (our extra test)";}bar(y0 + bh + gap, ours, "bar-ours");sv("text", { x: f.x(ours) + 5, y: y0 + 2 * bh + gap - 2, class: "vlabel" }, f.svg).textContent = A.aer_mean;const hit = sv("rect", { x: 0, y: y0 - 4, width: f.W, height: 2 * bh + gap + 8, fill: "transparent", tabindex: "0" }, f.svg);const show = () => {const pb = f.svg.getBoundingClientRect(), cb = card.getBoundingClientRect();showTip(card, tip, pb.left - cb.left + f.x(Math.max(ours, paper ? parseFloat(paper[0]) : 0)), pb.top - cb.top + parseFloat(hit.getAttribute("y")),`${LABEL[task]}, ${arm}`, [paper ? { key: "rect", color: "var(--paper)", value: T.paper[arm], label: "paper (mean ± SD)" }: { key: null, value: "–", label: "not in the paper (our extra test)" },{ key: "rect", color: "var(--blue)", value: `${A.aer_mean} ± ${A.aer_sd}`, label: "ours (mean ± SD)" }]);};hit.addEventListener("pointerenter", show); hit.addEventListener("focus", show);4 unmodified linesconst rows = [];for (const task of ["sc", "bup"]) for (const arm of rowsPerTask) {const T = DATA.tasks[task], A = T.arms[arm];rows.push([`${LABEL[task]}, ${arm}`, T.paper[arm] || "not in the paper", `${A.aer_mean} ± ${A.aer_sd}`]);}table(document.getElementById("t-bars"), ["Task, note", "Paper (mean ± SD)", "Ours (mean ± SD)"], rows);}99 unmodified linesdocument.getElementById("c-ep-sub").textContent =`${LABEL[state.task]} · ${ARM_TEXT[state.arm]} · run ${i + 1}: ${int(A.episodes[i])} finished episodes in ${int(DATA.n_steps)} moves`;tiles();for (const id of ["c-token-ref", "c-ep-ref"]) document.getElementById(id).hidden = state.arm === "normal";LINKED = [];tokenChart(document.getElementById("c-token"), state.task, state.arm, i, { mean: true, ref: true, link: true });episodeChart(document.getElementById("c-ep"), state.task, state.arm, i);tablesInteractive();}
52 unmodified lines53545556575821 unmodified lines8081828384858 unmodified lines94959697989923 unmodified lines12312412512612712812922 unmodified lines15215315415515615715815916016165 unmodified lines2272282292302312323 unmodified lines2362372382392402414 unmodified lines24624724824925025110 unmodified lines26226326426526626726852 unmodified linesfigure { margin: 0; }.pics img { width: 100%; height: auto; image-rendering: pixelated; border-radius: 8px; border: 1px solid var(--border); background: #000; }figcaption { font-size: 0.85em; color: var(--ink2); margin-top: 6px; line-height: 1.45; }/* the history strip */.strip { display: flex; gap: 6px; overflow-x: auto; padding: 4px 0 8px; }.cell { flex: 0 0 auto; min-width: 92px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 6px 8px; font-size: 0.8em; line-height: 1.5; }21 unmodified lines.key-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; }.key-rect { display: inline-block; width: 12px; height: 10px; border-radius: 2px; }.key-band { display: inline-block; width: 18px; height: 10px; background: var(--band); border: 1px solid var(--axis); }.plot { width: 100%; position: relative; }.plot svg { display: block; overflow: visible; touch-action: pan-y; }.plot svg:focus { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 4px; }8 unmodified linessvg .ln.blue { stroke: var(--blue); }svg .ln.gray { stroke: var(--gray); }svg .ln.orange { stroke: var(--orange); stroke-width: 1.5; }svg .dot { fill: var(--blue); stroke: var(--surface); stroke-width: 1.5; }svg .dot.dense { stroke: none; }svg .bar-ours { fill: var(--blue); }23 unmodified lines.tile .value { font-size: 1.45em; }}@media (forced-colors: active) {svg .ln.blue, svg .ln.gray, svg .ln.orange { stroke: CanvasText; }svg .dot, svg .bar-ours { fill: CanvasText; }}</style>22 unmodified lines<p>The agent lives in a small grid world. It is the red triangle, and it only sees the lighter squares in front of it.Each <b>episode</b> is one attempt at a task:</p><div class="pics"><figure><img src="img/start_SimpleCrossingS9N3.png" width="288" height="288" alt="A 9 by 9 grid: walls split the room, with one gap in each wall; the red triangle agent is top left and the green goal square is bottom right."><figcaption><b>SimpleCrossing</b> (the maze of run 1). Walls with gaps split the room. Reach the green square.</figcaption></figure><figure><img src="img/start_BlockedUnlockPickup.png" width="352" height="192" alt="Two rooms joined by a locked green door; a blue ball blocks the door, a green key lies in the left room and a purple box in the right room."><figcaption><b>BlockedUnlockPickup</b> (run 1). Move the ball out of the way, take the key, unlock the door, pick up the box.</figcaption></figure></div><p>An episode ends when the agent succeeds or runs out of moves. Its <b>score</b> is close to 1 for a fast solution, lowerfor a slow one, and 0 if time runs out. A <b>run</b> is a long series of episodes in one maze: the layout stays the same65 unmodified lines</div></div><div class="tiles" id="tiles" aria-live="polite"></div><div class="chart-card" id="c-token"><h3>The note the model reads</h3>3 unmodified lines<span><i class="key-line" style="border-color:var(--orange)"></i>critic's guess (every 10th step)</span><span><i class="key-line" style="border-color:var(--gray)"></i>average note of the 20 runs</span><span><i class="key-band"></i>range of notes in the training data</span></div><div class="plot"></div><details class="table"><summary>Show as a table</summary><div class="tablewrap" id="t-token"></div></details>4 unmodified lines<div class="legend" aria-hidden="true"><span><i class="key-dot" style="background:var(--blue)"></i>this run: one dot per episode, at the step it ended</span><span><i class="key-line" style="border-color:var(--gray)"></i>all 20 runs: average score of the episodes that ended in each stretch of 1,000 moves</span></div><div class="plot"></div><details class="table"><summary>Show as a table</summary><div class="tablewrap" id="t-ep"></div></details>10 unmodified lines0.054 and 0.264. These are close to the paper's numbers:</p><div class="chart-card" id="c-bars"><h3>Average score: the paper and our reproduction</h3><p class="sub">Mean over 20 runs of 8,000 moves</p><div class="legend" aria-hidden="true"><span><i class="key-rect" style="background:var(--paper)"></i>paper (Table 11)</span><span><i class="key-rect" style="background:var(--blue)"></i>our reproduction</span>52 unmodified lines535455565758596061626364656621 unmodified lines88899091929394958 unmodified lines10410510610710810911023 unmodified lines13413513613713813914022 unmodified lines16316416516616716816917017117217317417517617717817918018118218318418518618718818965 unmodified lines2552562572582592602612622633 unmodified lines2672682692702712722734 unmodified lines27827928028128228328410 unmodified lines29529629729829930030152 unmodified linesfigure { margin: 0; }.pics img { width: 100%; height: auto; image-rendering: pixelated; border-radius: 8px; border: 1px solid var(--border); background: #000; }figcaption { font-size: 0.85em; color: var(--ink2); margin-top: 6px; line-height: 1.45; }/* labels drawn over the start pictures (coordinates in image pixels) */.pic { position: relative; line-height: 0; border-radius: 8px; overflow: hidden; border: 1px solid var(--border); background: #000; }.pics .pic img { display: block; border: 0; border-radius: 0; }.pic svg.marks { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }.marks .view { fill: none; stroke: #ffffff; stroke-width: 2; stroke-dasharray: 6 4; }.marks text { font: 600 12px system-ui, -apple-system, "Segoe UI", sans-serif; fill: #ffffff; stroke: #000000; stroke-width: 3; paint-order: stroke; stroke-linejoin: round; }.marks .badge circle { fill: #ffffff; stroke: #000000; stroke-width: 1.5; }.marks .badge text { fill: #000000; stroke: none; text-anchor: middle; }/* the history strip */.strip { display: flex; gap: 6px; overflow-x: auto; padding: 4px 0 8px; }.cell { flex: 0 0 auto; min-width: 92px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 6px 8px; font-size: 0.8em; line-height: 1.5; }21 unmodified lines.key-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; }.key-rect { display: inline-block; width: 12px; height: 10px; border-radius: 2px; }.key-band { display: inline-block; width: 18px; height: 10px; background: var(--band); border: 1px solid var(--axis); }.key-line.ref { border-top-style: dashed; opacity: 0.6; }.legend span[hidden] { display: none; }.plot { width: 100%; position: relative; }.plot svg { display: block; overflow: visible; touch-action: pan-y; }.plot svg:focus { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 4px; }8 unmodified linessvg .ln.blue { stroke: var(--blue); }svg .ln.gray { stroke: var(--gray); }svg .ln.orange { stroke: var(--orange); stroke-width: 1.5; }svg .ln.ref { stroke: var(--blue); stroke-width: 1.5; stroke-dasharray: 5 4; opacity: 0.55; }svg .dot { fill: var(--blue); stroke: var(--surface); stroke-width: 1.5; }svg .dot.dense { stroke: none; }svg .bar-ours { fill: var(--blue); }23 unmodified lines.tile .value { font-size: 1.45em; }}@media (forced-colors: active) {svg .ln.blue, svg .ln.gray, svg .ln.orange, svg .ln.ref { stroke: CanvasText; }svg .dot, svg .bar-ours { fill: CanvasText; }}</style>22 unmodified lines<p>The agent lives in a small grid world. It is the red triangle, and it only sees the lighter squares in front of it.Each <b>episode</b> is one attempt at a task:</p><div class="pics"><figure><div class="pic"><img src="img/start_SimpleCrossingS9N3.png" width="288" height="288" alt="A 9 by 9 grid: walls split the room, with one gap in each wall. The red triangle agent is top left, facing right; a dashed outline marks the lit squares it sees, the corridor ahead of it. The green goal square is bottom right."><svg class="marks" viewBox="0 0 288 288" aria-hidden="true"><polygon class="view" points="34,2 254,2 254,158 226,158 226,94 34,94"/><text x="40" y="20">what it sees</text><text x="40" y="85">agent</text><text x="218" y="245" text-anchor="end">goal</text></svg></div><figcaption><b>SimpleCrossing</b> (the maze of run 1). Walls with gaps split the room; the dashed outline is what theagent sees from where it starts. Reach the green square.</figcaption></figure><figure><div class="pic"><img src="img/start_BlockedUnlockPickup.png" width="352" height="192" alt="Two rooms joined by a locked green door. The red triangle agent is in the left room, facing up; a dashed outline marks the lit squares it sees. Numbered in the order the agent needs them: 1, the blue ball that blocks the door; 2, the green key in the left room; 3, the door; 4, the purple box in the right room."><svg class="marks" viewBox="0 0 352 192" aria-hidden="true"><rect class="view" x="2" y="2" width="188" height="124"/><text x="8" y="20">what it sees</text><text x="112" y="88" text-anchor="middle">agent</text><g class="badge"><circle cx="144" cy="117" r="9"/><text x="144" y="121">1</text></g><g class="badge"><circle cx="48" cy="117" r="9"/><text x="48" y="121">2</text></g><g class="badge"><circle cx="176" cy="117" r="9"/><text x="176" y="121">3</text></g><g class="badge"><circle cx="272" cy="17" r="9"/><text x="272" y="21">4</text></g></svg></div><figcaption><b>BlockedUnlockPickup</b> (run 1). In order: <b>1</b> move the ball out of the way, <b>2</b> take the key,<b>3</b> unlock the door, <b>4</b> pick up the box. The dashed outline is what the agent sees.</figcaption></figure></div><p>An episode ends when the agent succeeds or runs out of moves. Its <b>score</b> is close to 1 for a fast solution, lowerfor a slow one, and 0 if time runs out. A <b>run</b> is a long series of episodes in one maze: the layout stays the same65 unmodified lines</div></div><div class="tiles" id="tiles" aria-live="polite"></div><p class="note">The two charts below share the move axis: point at either one, or focus it and use the arrow keys, andthe same move is marked in both. For zero, frozen and frozen_final, a faint dashed line shows the same run with thenormal note.</p><div class="chart-card" id="c-token"><h3>The note the model reads</h3>3 unmodified lines<span><i class="key-line" style="border-color:var(--orange)"></i>critic's guess (every 10th step)</span><span><i class="key-line" style="border-color:var(--gray)"></i>average note of the 20 runs</span><span><i class="key-band"></i>range of notes in the training data</span><span id="c-token-ref" hidden><i class="key-line ref" style="border-color:var(--blue)"></i>the same run with the normal note</span></div><div class="plot"></div><details class="table"><summary>Show as a table</summary><div class="tablewrap" id="t-token"></div></details>4 unmodified lines<div class="legend" aria-hidden="true"><span><i class="key-dot" style="background:var(--blue)"></i>this run: one dot per episode, at the step it ended</span><span><i class="key-line" style="border-color:var(--gray)"></i>all 20 runs: average score of the episodes that ended in each stretch of 1,000 moves</span><span id="c-ep-ref" hidden><i class="key-line ref" style="border-color:var(--blue)"></i>the same run with the normal note: average score per stretch</span></div><div class="plot"></div><details class="table"><summary>Show as a table</summary><div class="tablewrap" id="t-ep"></div></details>10 unmodified lines0.054 and 0.264. These are close to the paper's numbers:</p><div class="chart-card" id="c-bars"><h3>Average score: the paper and our reproduction</h3><p class="sub">Mean over 20 runs of 8,000 moves; frozen_final is our extra test, not in the paper</p><div class="legend" aria-hidden="true"><span><i class="key-rect" style="background:var(--paper)"></i>paper (Table 11)</span><span><i class="key-rect" style="background:var(--blue)"></i>our reproduction</span>
app.js+69-31
index.html+39-6