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
18 changes: 9 additions & 9 deletions apps/website/i18n/ai-numbers.ru.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion apps/website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@
"check:widgets": "node scripts/widgets-from-spec.mjs --check",
"test:widgets-spec": "node --test scripts/widgets-from-spec.test.mjs",
"check:course": "node scripts/course-from-spec.mjs --check",
"test:course": "node --test scripts/course-from-spec.test.mjs scripts/lesson-specs.test.mjs",
"test:course": "node --test scripts/course-from-spec.test.mjs scripts/lesson-specs.test.mjs scripts/t27c-mutation-casts.test.mjs",
"gen:course-pages": "node scripts/course-pages.mjs",
"check:course-pages": "node scripts/course-pages.mjs --check && node --test scripts/course-pages.test.mjs",
"check:widget-pages": "node scripts/widget-pages-from-spec.mjs --check",
Expand Down
Binary file modified apps/website/public/learn/a-bend-at-zero/card.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 6 additions & 6 deletions apps/website/public/learn/a-bend-at-zero/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- GENERATED by scripts/course-pages.mjs from specs/course/ai-numbers.t27; do not edit. -->
<title>A bend at zero: AI numbers course, lesson 16 of 27</title>
<meta name="description" content="Why a ReLU needs a test with a negative input before anyone can say it bends. Recording pending: it waits on tri test and tri mutate plant from…">
<meta name="description" content="Why a ReLU needs a test with a negative input before anyone can say it bends. A neuron passes its sum through an activation, and in gft_relu.t27 that is…">
<link rel="canonical" href="https://t27.ai/learn/a-bend-at-zero/">
<link rel="alternate" hreflang="en" href="https://t27.ai/learn/a-bend-at-zero/">
<link rel="alternate" hreflang="ru" href="https://t27.ai/ru/learn/a-bend-at-zero/">
Expand All @@ -16,15 +16,15 @@
<meta property="og:url" content="https://t27.ai/learn/a-bend-at-zero/">
<meta property="og:title" content="A bend at zero">
<meta property="og:description" content="Why a ReLU needs a test with a negative input before anyone can say it bends.">
<meta property="og:image" content="https://t27.ai/learn/a-bend-at-zero/card.png?v=0bdff88fe3bb">
<meta property="og:image" content="https://t27.ai/learn/a-bend-at-zero/card.png?v=223574fdb7da">
<meta property="og:image:width" content="1200">
<meta property="og:image:height" content="630">
<meta property="og:image:alt" content="Course, Lesson 16 of 27: A bend at zero. Why a ReLU needs a test with a negative input before anyone can say it bends.">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:site" content="@t27_dev">
<meta name="twitter:title" content="A bend at zero">
<meta name="twitter:description" content="Why a ReLU needs a test with a negative input before anyone can say it bends.">
<meta name="twitter:image" content="https://t27.ai/learn/a-bend-at-zero/card.png?v=0bdff88fe3bb">
<meta name="twitter:image" content="https://t27.ai/learn/a-bend-at-zero/card.png?v=223574fdb7da">
<meta name="twitter:image:alt" content="Course, Lesson 16 of 27: A bend at zero. Why a ReLU needs a test with a negative input before anyone can say it bends.">
<link rel="icon" href="/favicon.svg" type="image/svg+xml">
<script type="application/ld+json">{"@context":"https://schema.org","@type":"LearningResource","name":"A bend at zero","description":"Why a ReLU needs a test with a negative input before anyone can say it bends.","url":"https://t27.ai/learn/a-bend-at-zero/","inLanguage":"en","learningResourceType":"lesson","position":16,"isAccessibleForFree":true,"isPartOf":{"@type":"Course","name":"AI numbers with t27: from number formats to a ternary network","description":"Course 2, 27 lessons, one widget and one t27 spec each: a number format of our own, the OCP MX block formats AI chips use, ternary weights and the Ternary Network Float, then signed arithmetic, the parts of a neuron, a training step, BitNet ternary neurons and the ternary MAC as logic. Every new lesson plants one bug and shows the test that catches it.","url":"https://t27.ai/learn/ai-numbers/","inLanguage":"en","isAccessibleForFree":true,"educationalLevel":"Beginner","provider":{"@type":"Organization","name":"TRINITY S³AI","url":"https://t27.ai/"}}}</script>
Expand Down Expand Up @@ -60,11 +60,11 @@
<nav class="crumbs"><a href="/learn/ai-numbers/">All lessons</a><span>Module 6 · Parts of a neuron</span><span>Lesson 16 of 27</span></nav>
<h1>A bend at zero</h1>
<section><h2>You will learn</h2><p class="goal">Why a ReLU needs a test with a negative input before anyone can say it bends.</p></section>
<p>Recording pending: it waits on tri test and tri mutate plant from gHashTag/t27#7400, the two commands the recording runs, and until then the widget below is a placeholder that shows no run. A neuron passes its sum through an activation, and in gft_relu.t27 that is relu(x) = max(0, x). on_comb returns 0 for zero and for any input with the sign bit set, and x itself otherwise. The header says ReLU has an exact 0/1 gradient and that a 2-layer ReLU net solves XOR, which a linear GF-T model cannot. The browser skips all 4 tests because its runner does not know assert_eq yet; the native t27c runs all 4, all pass, none vacuous. The recording lets negative inputs through, which turns relu into the identity, a straight line. Exactly one test fails, negz; no other test has a negative input. Every byte in the recording was printed by the command; only the typing is staged.</p>
<p>A neuron passes its sum through an activation, and in gft_relu.t27 that is relu(x) = max(0, x). on_comb returns 0 for zero and for any input with the sign bit set, and x itself otherwise. The header says ReLU has an exact 0/1 gradient and that a 2-layer ReLU net solves XOR, which a linear GF-T model cannot. The browser skips all 4 tests because its runner does not know assert_eq yet; the native t27c runs all 4, all pass, none vacuous. The recording runs t27c test-report, then a one-line sed that lets negative inputs through, which turns relu into the identity, a straight line, and t27c test-report again. Exactly one test fails, negz; no other test has a negative input. git checkout puts the line back, and sha256sum prints the same hash as before the edit. Every byte in the recording was printed by the command; only the typing is staged.</p>
<section><h2>Try it</h2><p>In the recording, find the changed line and the value negz expects; then in the spec frame find the comment on that line and check whether it still describes the code after the change.</p></section>
<p><a class="cta" href="/#/ai-numbers/a-bend-at-zero">Open the interactive lesson →</a></p>
<figure><a href="/term/t27c-gft-relu/"><img src="/term/t27c-gft-relu/card.png" width="600" height="315" alt="gft_relu.t27: recording pending" loading="lazy"><figcaption>gft_relu.t27: recording pending ↗</figcaption></a></figure>
<p class="about" lang="en">Recording pending: waits on tri test and tri mutate plant from gHashTag/t27#7400. Until then this page is a placeholder and shows no run.</p>
<figure><a href="/term/t27c-gft-relu/"><img src="/term/t27c-gft-relu/card.png" width="600" height="315" alt="t27c on gft_relu.t27 -- a bend at zero, native" loading="lazy"><figcaption>t27c on gft_relu.t27 -- a bend at zero, native ↗</figcaption></a></figure>
<p class="about" lang="en">t27c 0.5.1 and zig 0.16.0 in a Claude Code cloud container (Linux x86_64), spec at t27 72f793357: all 4 tests pass natively, none vacuous; letting negative inputs through makes exactly one test fail, negz; git restores the spec.</p>
<section><h2>specs/ternary/gft_relu.t27</h2><pre lang="en"><code>module GftRelu;
// #1764 + GF-T: a GF-T ReLU activation -- relu(x) = max(0, x). For a signed GF-T16
// input, returns x if x &gt; 0 else 0 (raw 0). Unlike the sign/trit quantizer, ReLU
Expand Down
Binary file modified apps/website/public/learn/a-loss-in-bits/card.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 6 additions & 6 deletions apps/website/public/learn/a-loss-in-bits/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- GENERATED by scripts/course-pages.mjs from specs/course/ai-numbers.t27; do not edit. -->
<title>A loss in bits: AI numbers course, lesson 19 of 27</title>
<meta name="description" content="How the loss -log2(p) prices a guess in bits, and why a perfect guess must cost exactly 0. Recording pending: it waits on tri test and tri mutate plant…">
<meta name="description" content="How the loss -log2(p) prices a guess in bits, and why a perfect guess must cost exactly 0. Training starts with a number for how wrong a guess was.…">
<link rel="canonical" href="https://t27.ai/learn/a-loss-in-bits/">
<link rel="alternate" hreflang="en" href="https://t27.ai/learn/a-loss-in-bits/">
<link rel="alternate" hreflang="ru" href="https://t27.ai/ru/learn/a-loss-in-bits/">
Expand All @@ -16,15 +16,15 @@
<meta property="og:url" content="https://t27.ai/learn/a-loss-in-bits/">
<meta property="og:title" content="A loss in bits">
<meta property="og:description" content="How the loss -log2(p) prices a guess in bits, and why a perfect guess must cost exactly 0.">
<meta property="og:image" content="https://t27.ai/learn/a-loss-in-bits/card.png?v=c86df22d3617">
<meta property="og:image" content="https://t27.ai/learn/a-loss-in-bits/card.png?v=f559b3bfb020">
<meta property="og:image:width" content="1200">
<meta property="og:image:height" content="630">
<meta property="og:image:alt" content="Course, Lesson 19 of 27: A loss in bits. How the loss -log2(p) prices a guess in bits, and why a perfect guess must cost exactly 0.">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:site" content="@t27_dev">
<meta name="twitter:title" content="A loss in bits">
<meta name="twitter:description" content="How the loss -log2(p) prices a guess in bits, and why a perfect guess must cost exactly 0.">
<meta name="twitter:image" content="https://t27.ai/learn/a-loss-in-bits/card.png?v=c86df22d3617">
<meta name="twitter:image" content="https://t27.ai/learn/a-loss-in-bits/card.png?v=f559b3bfb020">
<meta name="twitter:image:alt" content="Course, Lesson 19 of 27: A loss in bits. How the loss -log2(p) prices a guess in bits, and why a perfect guess must cost exactly 0.">
<link rel="icon" href="/favicon.svg" type="image/svg+xml">
<script type="application/ld+json">{"@context":"https://schema.org","@type":"LearningResource","name":"A loss in bits","description":"How the loss -log2(p) prices a guess in bits, and why a perfect guess must cost exactly 0.","url":"https://t27.ai/learn/a-loss-in-bits/","inLanguage":"en","learningResourceType":"lesson","position":19,"isAccessibleForFree":true,"isPartOf":{"@type":"Course","name":"AI numbers with t27: from number formats to a ternary network","description":"Course 2, 27 lessons, one widget and one t27 spec each: a number format of our own, the OCP MX block formats AI chips use, ternary weights and the Ternary Network Float, then signed arithmetic, the parts of a neuron, a training step, BitNet ternary neurons and the ternary MAC as logic. Every new lesson plants one bug and shows the test that catches it.","url":"https://t27.ai/learn/ai-numbers/","inLanguage":"en","isAccessibleForFree":true,"educationalLevel":"Beginner","provider":{"@type":"Organization","name":"TRINITY S³AI","url":"https://t27.ai/"}}}</script>
Expand Down Expand Up @@ -60,11 +60,11 @@
<nav class="crumbs"><a href="/learn/ai-numbers/">All lessons</a><span>Module 7 · Learning from a mistake</span><span>Lesson 19 of 27</span></nav>
<h1>A loss in bits</h1>
<section><h2>You will learn</h2><p class="goal">How the loss -log2(p) prices a guess in bits, and why a perfect guess must cost exactly 0.</p></section>
<p>Recording pending: it waits on tri test and tri mutate plant from gHashTag/t27#7400, the two commands the recording runs, and until then the widget below is a placeholder that shows no run. Training starts with a number for how wrong a guess was. gft_nll.t27 takes p, the probability the model gave the true class, and returns -log2(p): p = 1.0 costs 0, p = 0.5 costs 1 bit, and p = 0.25 costs 2. on_comb is neg(log2v(p)), and neg flips the sign bit, except that it returns 0 for 0. One header line still says the output is log2(x); the code returns its negative. The browser skips all 3 tests because its runner does not know assert_eq yet; the native t27c runs all 3, all pass, none vacuous. The recording makes neg return 65536 for 0, a zero with the sign bit set, and exactly one test fails, perfect. Every byte in the recording was printed by the command; only the typing is staged.</p>
<p>Training starts with a number for how wrong a guess was. gft_nll.t27 takes p, the probability the model gave the true class, and returns -log2(p): p = 1.0 costs 0, p = 0.5 costs 1 bit, and p = 0.25 costs 2. on_comb is neg(log2v(p)), and neg flips the sign bit, except that it returns 0 for 0. One header line still says the output is log2(x); the code returns its negative. The browser skips all 3 tests because its runner does not know assert_eq yet; the native t27c runs all 3, all pass, none vacuous. The recording runs t27c test-report, then a one-line sed that makes neg return 65536 for 0, a zero with the sign bit set, and t27c test-report again: exactly one test fails, perfect. git checkout puts the line back, and sha256sum prints the same hash as before the edit. Every byte in the recording was printed by the command; only the typing is staged.</p>
<section><h2>Try it</h2><p>In the recording, find the changed line and the test that fails; then in the spec frame find the header line that says the output is log2(x) and compare it with on_comb.</p></section>
<p><a class="cta" href="/#/ai-numbers/a-loss-in-bits">Open the interactive lesson →</a></p>
<figure><a href="/term/t27c-gft-nll/"><img src="/term/t27c-gft-nll/card.png" width="600" height="315" alt="gft_nll.t27: recording pending" loading="lazy"><figcaption>gft_nll.t27: recording pending ↗</figcaption></a></figure>
<p class="about" lang="en">Recording pending: waits on tri test and tri mutate plant from gHashTag/t27#7400. Until then this page is a placeholder and shows no run.</p>
<figure><a href="/term/t27c-gft-nll/"><img src="/term/t27c-gft-nll/card.png" width="600" height="315" alt="t27c on gft_nll.t27 -- a loss in bits, native" loading="lazy"><figcaption>t27c on gft_nll.t27 -- a loss in bits, native ↗</figcaption></a></figure>
<p class="about" lang="en">t27c 0.5.1 and zig 0.16.0 in a Claude Code cloud container (Linux x86_64), spec at t27 72f793357: all 3 tests pass natively, none vacuous; a zero with the sign bit set from neg makes exactly one test fail, perfect; git restores the spec.</p>
<section><h2>specs/ternary/gft_nll.t27</h2><pre lang="en"><code>module GftNll;
// #1764 + GF-T: GF-T negative-log-likelihood (cross-entropy loss for a one-hot
// label) -- given the softmax probability p of the true class, returns the loss
Expand Down
Binary file modified apps/website/public/learn/a-sign-is-one-bit/card.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading