[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-11555":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":14,"stars7d":14,"stars30d":17,"stars90d":16,"forks30d":16,"starsTrendScore":18,"compositeScore":19,"rankGlobal":10,"rankLanguage":10,"license":10,"archived":20,"fork":20,"defaultBranch":21,"hasWiki":22,"hasPages":22,"topics":23,"createdAt":10,"pushedAt":10,"updatedAt":24,"readmeContent":25,"aiSummary":26,"trendingCount":16,"starSnapshotCount":16,"syncStatus":14,"lastSyncTime":27,"discoverSource":28},11555,"category_theory_transformer_rs","hghalebi\u002Fcategory_theory_transformer_rs","hghalebi","Tiny ML, Rust types, and category theory, executable structure, not AI magic.","https:\u002F\u002Fhghalebi.github.io\u002Fcategory_theory_transformer_rs\u002F",null,"Rust",107,9,2,12,0,56,6,50.6,false,"main",true,[],"2026-06-12 04:00:55","\u003Cp align=\"center\">\n  \u003Cimg src=\"logo.png\" alt=\"Category Theory for Tiny ML in Rust logo\" width=\"900\">\n\u003C\u002Fp>\n\n# Category Theory for Tiny ML in Rust\n\n> Tiny ML, Rust types, and category theory: executable structure, not AI magic.\n\nPython made AI accessible.\nRust can make parts of AI understandable.\n\nThis is a first-principles, compile-checked tutorial for engineers who want to\nunderstand the structure underneath machine-learning systems.\n\n**Status:** public working draft. The current book and Rust examples are useful\nand publishable now, but this is not the completed textbook yet. Completion\nwill continue through reader reports, source-backed rewrites, and later\nvalidated editions.\n\n```bash\ncargo run --bin category_ml\n```\n\nRead the public draft, run the examples, and star the repo if you want more\nexecutable AI education in Rust.\n\n- Public book: \u003Chttps:\u002F\u002Fhghalebi.github.io\u002Fcategory_theory_transformer_rs\u002F>\n- First-session guide: [START_HERE.md](START_HERE.md)\n- Public challenges: [challenges\u002FREADME.md](challenges\u002FREADME.md)\n- Typed AI Rustlings: [challenges\u002Ftyped-ai-rustlings\u002FREADME.md](challenges\u002Ftyped-ai-rustlings\u002FREADME.md)\n- Paper-To-Rust: [challenges\u002Fpaper-to-rust\u002FREADME.md](challenges\u002Fpaper-to-rust\u002FREADME.md)\n- Reviewers needed: [REVIEWERS.md](REVIEWERS.md)\n- Review worksheet: [docs\u002Freview-worksheet.md](docs\u002Freview-worksheet.md)\n- Review guide: [docs\u002Freview-path.md](docs\u002Freview-path.md)\n- Public review sprint: [docs\u002Freview-sprint.md](docs\u002Freview-sprint.md)\n- Example review reports: [docs\u002Freview-examples.md](docs\u002Freview-examples.md)\n- Project FAQ: [docs\u002Ffaq.md](docs\u002Ffaq.md)\n- Term glossary: [docs\u002Fglossary.md](docs\u002Fglossary.md)\n- Citation, reuse, and support terms: [LICENSE.md](LICENSE.md)\n- Quick reader report: \u003Chttps:\u002F\u002Fgithub.com\u002Fhghalebi\u002Fcategory_theory_transformer_rs\u002Fissues\u002Fnew?template=quick-reader-report.yml>\n- Chapter clarity feedback: \u003Chttps:\u002F\u002Fgithub.com\u002Fhghalebi\u002Fcategory_theory_transformer_rs\u002Fissues\u002Fnew?template=chapter-clarity.yml>\n\n## Choose your path\n\n| If you have... | Start here | Goal |\n| --- | --- | --- |\n| 5 minutes | `cargo run --example 01_token_sequence` | See text become typed training structure |\n| 30 minutes | [START_HERE.md](START_HERE.md), then examples 01-03 | Learn the core path through the repo |\n| You are new to one piece | [docs\u002Fbeginner-path.md](docs\u002Fbeginner-path.md) | Get unstuck across Rust, ML, and category words |\n| You know Rust | [docs\u002Frust-path.md](docs\u002Frust-path.md) | Trace how types, traits, and tests protect ML meaning |\n| You know ML frameworks | [docs\u002Fml-path.md](docs\u002Fml-path.md) | Map framework habits to tiny explicit Rust objects |\n| You want a shareable challenge | [challenges\u002FREADME.md](challenges\u002FREADME.md) | Fix compiler errors or compile one paper idea |\n| You want to help review | [REVIEWERS.md](REVIEWERS.md) | Pick a perspective and file one evidence-shaped report |\n| You want to review | [docs\u002Freview-path.md](docs\u002Freview-path.md) | File one precise clarity report |\n| A group wants to review | [docs\u002Freview-sprint.md](docs\u002Freview-sprint.md) | Collect five concrete reports from five reader perspectives |\n| A chapter question | [Open the clarity form](https:\u002F\u002Fgithub.com\u002Fhghalebi\u002Fcategory_theory_transformer_rs\u002Fissues\u002Fnew?template=chapter-clarity.yml) | Point to the first unclear section |\n| A contribution idea | [CONTRIBUTING.md](CONTRIBUTING.md) | Choose a concrete issue or improvement |\n| A teaching review | [docs\u002Feducator-path.md](docs\u002Feducator-path.md) | Check whether every stage has a clear next action |\n\n## Review in 20 minutes\n\nThe most useful public review is one precise report: what you ran or read, the\nlast idea that made sense, the first point that became unclear, and the\nsmallest edit that would help.\n\nCurrent high-value target: run `cargo run --example 06_attention_scores`, then\nreport whether the first Q\u002FK\u002FV diagnostic makes this distinction clear before\nthe weights appear:\n\n```text\nquery rows own score rows; key\u002Fvalue rows own score columns\n```\n\n| Perspective | Public review path | First action |\n| --- | --- | --- |\n| Rust engineer | [Rust engineer first-run path](https:\u002F\u002Fgithub.com\u002Fhghalebi\u002Fcategory_theory_transformer_rs\u002Fissues\u002F8) | Run examples 01 and 02, then inspect the typed boundaries |\n| ML engineer or learner | [ML engineer training and attention path](https:\u002F\u002Fgithub.com\u002Fhghalebi\u002Fcategory_theory_transformer_rs\u002Fissues\u002F9) | Run the tiny training and training-state examples |\n| Category-theory reader | [Category-theory precision path](https:\u002F\u002Fgithub.com\u002Fhghalebi\u002Fcategory_theory_transformer_rs\u002Fissues\u002F10) | Use the Source-Target Audit Card to classify morphism and attention boundaries |\n| Technical educator | [Technical educator learning path](https:\u002F\u002Fgithub.com\u002Fhghalebi\u002Fcategory_theory_transformer_rs\u002Fissues\u002F11) | Check whether each entry point gives the learner a next action |\n| Beginner-adjacent learner | [Beginner-adjacent first confusion path](https:\u002F\u002Fgithub.com\u002Fhghalebi\u002Fcategory_theory_transformer_rs\u002Fissues\u002F12) | Run the first example or read the public start path |\n\nOpen the matching report link after you run or read the path. The link fills\nthe route, not the evidence; the evidence signal should come from what you\npersonally read, ran, or attempted.\n\n| Perspective | Report link |\n| --- | --- |\n| Rust engineer | [Open Rust engineer report](https:\u002F\u002Fgithub.com\u002Fhghalebi\u002Fcategory_theory_transformer_rs\u002Fissues\u002Fnew?template=chapter-clarity.yml&title=%5Bgood+first+feedback%5D+Rust+engineer+brief&location=docs%2Frust-path.md&command=cargo+run+--example+01_domain_objects%0Acargo+run+--example+02_morphism_composition%0Acargo+test+domain%3A%3Atests+--lib%0Acargo+test+category%3A%3Atests+--lib) |\n| ML engineer or learner | [Open ML engineer report](https:\u002F\u002Fgithub.com\u002Fhghalebi\u002Fcategory_theory_transformer_rs\u002Fissues\u002Fnew?template=chapter-clarity.yml&title=%5Bgood+first+feedback%5D+ML+engineer+brief&location=docs%2Fml-path.md&command=cargo+run+--example+01_token_sequence%0Acargo+run+--bin+category_ml%0Acargo+run+--example+03_training_endomorphism%0Acargo+run+--example+07_transformer_training_state) |\n| Category-theory reader | [Open category-theory reader report](https:\u002F\u002Fgithub.com\u002Fhghalebi\u002Fcategory_theory_transformer_rs\u002Fissues\u002Fnew?template=chapter-clarity.yml&title=%5Bgood+first+feedback%5D+category-theory+reader+brief&location=book%2Fsrc%2Froadmap.md+-%3E+Category+Shape+Diagnostic+-%3E+Reader+Evidence+Handoff&command=cargo+run+--example+06_attention_scores) |\n| Technical educator | [Open technical educator report](https:\u002F\u002Fgithub.com\u002Fhghalebi\u002Fcategory_theory_transformer_rs\u002Fissues\u002Fnew?template=chapter-clarity.yml&title=%5Bgood+first+feedback%5D+technical+educator+brief&location=README.md%2C+START_HERE.md%2C+docs%2Feducator-path.md%2C+book%2Fsrc%2Fwelcome.md%2C+book%2Fsrc%2F00-map.md%2C+or+book%2Fsrc%2Fexercises.md&command=public+book+review+path+or+local+file+review) |\n| Beginner-adjacent learner | [Open beginner-adjacent learner report](https:\u002F\u002Fgithub.com\u002Fhghalebi\u002Fcategory_theory_transformer_rs\u002Fissues\u002Fnew?template=chapter-clarity.yml&title=%5Bgood+first+feedback%5D+beginner-adjacent+reader+brief&location=Welcome%2C+Course+Map%2C+Domain+Objects%2C+or+Morphism+and+Composition&command=cargo+run+--example+01_token_sequence+or+public+book+path) |\n\nUse the [quick reader report form](https:\u002F\u002Fgithub.com\u002Fhghalebi\u002Fcategory_theory_transformer_rs\u002Fissues\u002Fnew?template=quick-reader-report.yml)\nwhen you have one concrete signal and little time. Use the\n[chapter clarity form](https:\u002F\u002Fgithub.com\u002Fhghalebi\u002Fcategory_theory_transformer_rs\u002Fissues\u002Fnew?template=chapter-clarity.yml)\nwhen you want to give the fuller expected-versus-actual context. Broad praise\nis welcome, but the book improves fastest from one concrete confusion point.\n\nFor a group pass, use the [public review sprint](docs\u002Freview-sprint.md) to\ncollect one report from each reader perspective.\nIf you are unsure what a useful report looks like, compare your report with\n[docs\u002Freview-examples.md](docs\u002Freview-examples.md).\n\n```mermaid\nflowchart LR\n    A[Text] --> B[TokenSequence]\n    B --> C[TrainingPairs]\n    C --> D[ModelState]\n    D --> E[Prediction]\n    E --> F[Loss]\n    F --> G[Updated ModelState]\n\n    classDef obj fill:#eef6ff,stroke:#2563eb,color:#111827;\n    class A,B,C,D,E,F,G obj;\n```\n\nThe project teaches this pipeline as typed transformations in Rust. The code\nuses concrete types such as `TokenId`, `TokenSequence`, `TrainingSet`,\n`Parameters`, `Distribution`, and `Loss` so the structure is visible and\ncompile-checked.\n\n## Who this is for\n\nThis project is for:\n\n- Rust developers curious about machine learning\n- ML engineers who want stronger mental models\n- mathematically curious software engineers\n- technical founders who want to understand AI systems below the framework layer\n- readers who enjoy small, explicit, executable abstractions\n\nYou do **not** need to be a category theorist.\n\nYou should be comfortable with basic programming ideas and curious enough to\nfollow small Rust examples.\n\n## Why this exists\n\nMost machine-learning education starts with frameworks.\n\nThat is useful, but it often hides the structure.\n\nA tiny ML system already contains deep ideas:\n\n```text\nTokenId -> Vector -> Logits -> Distribution -> Loss\n```\n\nPrediction is a transformation.\nEvaluation is a transformation.\nTraining is a transformation over parameters.\n\nCategory theory gives names to some of these shapes.\nRust makes the shapes explicit.\n\nThis project connects:\n\n```text\nEnglish intuition -> tiny math idea -> Rust type -> runnable example\n```\n\nThe goal is not mathematical decoration.\nThe goal is to make tiny ML systems easier to reason about.\n\n## Start in 60 seconds\n\nClone the repository:\n\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002Fhghalebi\u002Fcategory_theory_transformer_rs.git\ncd category_theory_transformer_rs\n```\n\nRun the main walkthrough:\n\n```bash\ncargo run --bin category_ml\n```\n\nRun the five-minute first example:\n\n```bash\ncargo run --example 01_token_sequence\n```\n\nExpected shape:\n\n```text\nRaw input:\n\"rust makes ai structure visible\"\n\nTokenSequence:\n[TokenId(12), TokenId(44), TokenId(7), TokenId(19), TokenId(91)]\n\nTrainingPairs:\n(TokenId(12) -> TokenId(44))\n(TokenId(44) -> TokenId(7))\n(TokenId(7) -> TokenId(19))\n(TokenId(19) -> TokenId(91))\n\nTyped transformation:\nText -> TokenSequence -> TrainingPairs\n\nNo framework magic.\nJust explicit structure.\n```\n\n## Read the book\n\nThe public draft is available here:\n\n```text\nhttps:\u002F\u002Fhghalebi.github.io\u002Fcategory_theory_transformer_rs\u002F\n```\n\nSuggested starting path:\n\n```text\nWelcome\n-> Course Map\n-> Domain Objects\n-> Morphism and Composition\n-> Tiny ML Pipeline\n```\n\nTo build the public book locally:\n\n```bash\nmdbook build\n```\n\nThe local build output is written to `book\u002Fhtml\u002F`.\n\n## Public challenges\n\nThe challenge tracks turn the public draft into shareable practice:\n\n- [Typed AI Rustlings](challenges\u002Ftyped-ai-rustlings\u002FREADME.md): learn AI by\n  fixing compiler errors.\n- [Paper-To-Rust](challenges\u002Fpaper-to-rust\u002FREADME.md): stop summarizing papers.\n  Compile one idea.\n\nFirst challenge command:\n\n```bash\ncargo run --example challenge_adam\n```\n\n## The small promise\n\nAfter the first path, you should be able to explain:\n\n1. why `TokenId` is safer than a raw `usize`\n2. why a morphism is a typed transformation\n3. why composition means outputs and inputs connect safely\n4. why training can be seen as `Parameters -> Parameters`\n\nThe full course then gives names to those ideas and connects them to runnable\nRust code.\n\n## What you will learn\n\nBy following the project, you will learn how to see tiny ML systems as\ncomposable structures:\n\n| Concept | Plain-English idea | Rust intuition |\n| --- | --- | --- |\n| Domain object | A meaningful type of thing | `TokenId`, `Vector`, `Logits` |\n| Morphism | A typed transformation | `Morphism\u003CInput, Output>` |\n| Composition | Connecting transformations safely | output type matches input type |\n| Pipeline | A chain of transformations | data flowing through typed stages |\n| Training | Updating parameters | state transition |\n| Endomorphism | A transformation from a thing to itself | `Parameters -> Parameters` |\n| Functor | Structure-preserving mapping | `VecFunctor`, `OptionFunctor` |\n| Monoid | Composable accumulation | `PipelineTrace` |\n| Chain rule | Local derivatives composed backward | `MulOp` forward and backward pass |\n\nThis is not meant to replace full ML frameworks.\nIt is meant to make their hidden structure easier to see.\n\n## Learning path\n\n### 1. Foundations\n\nStart here if category-theory language is new to you:\n\n```text\n1. Course Map\n2. Domain Objects\n3. Morphism and Composition\n4. The Tiny ML Pipeline\n```\n\nYou will learn the basic language of objects, arrows, and composition through\ntiny Rust examples.\n\n### 2. Training\n\n```text\n5. Training as an Endomorphism\n```\n\nYou will see training as a structured update:\n\n```text\nParameters -> Parameters\n```\n\nInstead of treating training as magic, the book models it as a controlled state\ntransition.\n\n### 3. Structure\n\n```text\n6. Functors, Naturality, Monoids, and Chain Rule\n7. Seven Sketches Through Rust\n```\n\nThis section connects category-theory vocabulary to engineering patterns.\n\nThe goal is not to memorize names.\nThe goal is to recognize structure when it appears in code.\n\n### 4. Practice\n\n```text\n8. Exercises\n9. Glossary\n10. References\n11. Transformer Roadmap\n12. Repository Source Snapshots\n```\n\nUse this section to test your understanding, review terminology, and connect\nthe tiny examples to larger AI systems.\n\n## A tiny example\n\nA machine-learning pipeline can be seen as a sequence of typed transformations:\n\n```text\nTokenId -> Vector -> Logits -> Distribution\n```\n\nIn Rust, the teaching goal is to make illegal connections harder to express.\n\nThe runnable composition example lives in\n[examples\u002F02_morphism_composition.rs](examples\u002F02_morphism_composition.rs):\n\n```rust\nuse category_theory_transformer_rs::{\n    Compose, CtResult, Embedding, LinearToLogits, Logits, ModelDimension, Morphism,\n    Parameters, Softmax, TokenId, Vector, VocabSize,\n};\n\nfn main() -> CtResult\u003C()> {\n    let params = Parameters::init(VocabSize::new(5)?, ModelDimension::new(4)?);\n    let token = TokenId::new(1);\n    let embedding = Embedding::from_parameters(&params);\n    let linear = LinearToLogits::from_parameters(&params);\n\n    let token_to_logits = Compose::\u003C_, _, Vector>::new(\n        embedding.clone(),\n        linear.clone(),\n    );\n    let token_to_distribution = Compose::\u003C_, _, Logits>::new(token_to_logits, Softmax);\n\n    let vector = embedding.apply(token)?;\n    let logits = linear.apply(vector)?;\n    let distribution = Softmax.apply(logits)?;\n    let composed_distribution = token_to_distribution.apply(token)?;\n\n    println!(\"stage output: {:?}\", distribution.as_slice());\n    println!(\"composed output: {:?}\", composed_distribution.as_slice());\n\n    Ok(())\n}\n```\n\nRun it:\n\n```bash\ncargo run --example 02_morphism_composition\n```\n\nThis is intentionally tiny.\nThe point is not performance yet.\nThe point is structure:\n\n```text\nTokenId -> Vector -> Logits -> Distribution\n```\n\nThe command also prints the middle objects, so the composed arrow does not hide\nthe `Vector` and `Logits` stages that make it legal.\n\nOnce the structure is visible, we can ask better questions about correctness,\ncomposition, training, and eventually performance.\n\n## Project map\n\n```text\n.\n├── book\u002F                  # public book source\n├── community\u002F             # workshop and reading-club material\n├── docs\u002F                  # learning paths, glossary, and FAQ\n├── examples\u002F              # runnable learning examples\n├── exercises\u002F             # beginner, intermediate, and advanced practice\n├── lessons\u002F               # compact lesson notes\n├── src\u002F                   # compile-checked Rust teaching modules\n├── START_HERE.md          # first-session path\n├── ROADMAP.md             # project milestones\n├── CONTRIBUTING.md        # concrete contribution paths\n├── SPONSORS.md            # sponsor rationale\n├── GOVERNANCE.md          # project decision rules\n├── CHANGELOG.md           # visible momentum\n└── README.md              # project entry point\n```\n\nThe repository is designed to be read in two ways:\n\n```text\nBook-first:\nRead the chapter, then run the matching code.\n\nCode-first:\nRun the example, then read the explanation.\n```\n\nBoth paths are valid.\n\nThe best path is probably:\n\n```text\nRead a tiny idea -> run a tiny program -> change one line -> observe what breaks\n```\n\nThe compiler is part of the teacher.\n\n## Rust module map\n\n- `src\u002Fdomain.rs`: typed nouns used by the whole tutorial\n- `src\u002Fcategory.rs`: morphisms, identity, composition, and endomorphisms\n- `src\u002Fml.rs`: token windowing, embedding, linear projection, softmax, cross entropy\n- `src\u002Ftraining.rs`: training as a repeated parameter endomorphism\n- `src\u002Fstructure.rs`: functors, natural transformations, and monoids\n- `src\u002Fcalculus.rs`: local derivative and chain-rule example\n- `src\u002Fattention.rs`: typed attention and transformer-state sketches\n- `src\u002Fsketches.rs`: Rust models for seven applied-category-theory sketches\n- `src\u002Fdemo.rs`: the complete terminal walkthrough\n\n## Runnable examples\n\n| Command | Concept | Learner win |\n| --- | --- | --- |\n| `cargo run --example 01_token_sequence` | Text to training pairs | See raw text become typed structure |\n| `cargo run --example 01_domain_objects` | Domain objects | See ML nouns as Rust types |\n| `cargo run --example 02_morphism_composition` | Morphisms and composition | See typed transformations compose |\n| `cargo run --example 03_training_endomorphism` | Training | See training as `Parameters -> Parameters` |\n| `cargo run --example 04_structure_and_calculus` | Structure and calculus | See functors, monoids, and chain-rule sketches |\n| `cargo run --example 05_seven_sketches` | Applied sketches | See category ideas beyond tiny ML |\n| `cargo run --example 06_attention_scores` | Attention roadmap | See query-key scores, masks, weights, and value mixing |\n| `cargo run --example 07_transformer_training_state` | Transformer training state | See readout, feed-forward, attention, and block updates |\n\nThese examples are small by design.\nEach one is meant to isolate a concept before the book combines it with the\nnext idea.\n\n## Learn live\n\nIf you prefer a guided walkthrough, join the public workshop:\n\n```text\nhttps:\u002F\u002Fluma.com\u002Fevent\u002Fevt-Pb1kYMQvzs8JrQq\n```\n\n## Current status\n\nThis is a working public draft.\n\nIt is published now so readers can use the current book, run the examples, and\nsend concrete feedback while the final textbook pass continues.\n\nIt is not complete yet. Some chapters are stable enough to read and cite with\nthe required citation, while other sections are still being revised from\nsource review, exercises, and direct reader reports.\n\nSome chapters are stable.\nSome chapters are still evolving.\nSome sections still need direct reader validation.\n\nThe goal is to build the clearest possible path from tiny ML concepts to typed\nRust implementations, with public feedback from readers.\n\nIf something feels too compressed, unclear, or too bullet-point-like, please\nopen an issue. That feedback is useful.\n\nStatus labels:\n\n| Label | Meaning |\n| --- | --- |\n| Stable | The explanation and code are unlikely to change heavily |\n| Draft | The section is readable but still evolving |\n| Sketch | The idea is present but needs clearer writing or examples |\n| Planned | The section is part of the roadmap |\n\nChapter maturity:\n\n| Chapter | Status | Best feedback |\n| --- | --- | --- |\n| Welcome | Stable draft | First-run promise and reader contract |\n| Course Map | Stable draft | Path clarity and module-to-pipeline mapping |\n| Domain Objects | Stable draft | Clarity and Rust idiom |\n| Morphism and Composition | Draft | More examples and composition diagrams |\n| The Tiny ML Pipeline | Draft | Diagram review and ML intuition |\n| Training as an Endomorphism | Draft | Training-loop intuition |\n| Functors, Naturality, Monoids, and Chain Rule | Draft | Law tracing and terminology precision |\n| Seven Sketches Through Rust | Draft | Transfer clarity across sketches |\n| Exercises | Draft | Evidence quality and transfer difficulty |\n| Challenges | Draft | Source-to-code transfer and challenge evidence quality |\n| Transformer Roadmap | Draft | Category precision and attention-shape clarity |\n\n## How to contribute\n\nThe most valuable contributions are not only code.\n\nGood contributions include:\n\n- pointing out unclear explanations\n- opening issues where a chapter becomes hard to follow\n- suggesting smaller examples\n- improving diagrams\n- adding exercises\n- simplifying Rust code\n- fixing terminology\n- testing the book as a learner\n\nUseful clarity feedback has this shape:\n\n```text\nChapter or file:\nFriction lens:\nCommand or page tried:\nEvidence signal:\nFirst unclear sentence, output line, or exercise prompt:\nLast clear idea:\nWhat you expected:\nWhat happened instead:\nWhat would have helped:\n```\n\nFor structured chapter clarity feedback, use the\n[chapter clarity form](https:\u002F\u002Fgithub.com\u002Fhghalebi\u002Fcategory_theory_transformer_rs\u002Fissues\u002Fnew?template=chapter-clarity.yml).\nA useful issue names a chapter, a command, an evidence signal, and a revision target.\nFor code or documentation changes, start with [CONTRIBUTING.md](CONTRIBUTING.md).\n\n## Good first issues\n\nLook for issues labeled:\n\n```text\ngood first feedback\nneeds Rust example\nneeds diagram\nchapter expansion\nML intuition\ncategory theory precision\nRust idiom review\nexercise idea\nglossary needed\ndocumentation\n```\n\nIf you are new to the project, the best contribution is usually clarity\nfeedback.\n\nThis project should be understandable before it becomes impressive.\n\n## Community and feedback\n\nThis project is connected to a broader learning effort around foundational AI\nsystems, Rust, and first-principles technical education.\n\nUseful ways to engage:\n\n- star the repository\n- read the public draft\n- open an issue with feedback\n- suggest a tiny Rust example\n- share the project with a Rust or ML engineer\n- join a reading session or workshop when announced\n\nPublic routes:\n\n- [Reviewers needed](REVIEWERS.md): pick one perspective and file one\n  evidence-shaped report.\n- [Public review sprint](docs\u002Freview-sprint.md): split a group pass across\n  Rust, ML, category-theory, educator, and beginner-adjacent paths.\n- [Reading club](community\u002Freading-club.md): run one chapter session and turn\n  one confusion point into a report.\n- [Workshops](community\u002Fworkshops.md): join the public workshop path and file\n  one follow-up report.\n- [Contributor ladder](community\u002Fcontributor-ladder.md): start with reader\n  feedback, then move toward docs, examples, review, and maintainer-level work.\n\nThe project is especially interested in feedback from:\n\n```text\nRust engineers\nML engineers\ncompiler\u002Ftype-system people\ntechnical educators\nmathematically curious software builders\n```\n\n## Design philosophy\n\n### 1. Small before large\n\nTiny examples reveal structure better than giant frameworks.\n\n### 2. Runnable before impressive\n\nIf an idea cannot survive a small program, it may not be understood yet.\n\n### 3. Types as explanations\n\nRust types are not just implementation details.\nThey can teach domain structure.\n\n### 4. Category theory as naming, not decoration\n\nThe goal is to name useful patterns, not to intimidate the reader.\n\n### 5. Pedagogy before cleverness\n\nA clever abstraction that makes the reader feel lost has failed.\n\nA small example that makes the reader say \"I see it now\" is doing the work.\n\n## Local validation\n\nBefore trusting changes, run:\n\n```bash\ncargo fmt --check\ncargo clippy --all-targets --all-features -- -D warnings\ncargo test --all-targets --all-features\nmdbook build\nmdbook test\n```\n\nThe public CI runs the same core checks plus the runnable examples and terminal\ndemo.\n\n## Citation\n\nUse this as the default project citation. If you quote, reference, teach from,\nadapt, or build on this work where reuse is allowed, cite it with both the\npublic book URL and the source repository URL:\n\n```text\nGhalebi, H., & Jafarranmani, F.\nCategory Theory for Tiny ML in Rust.\nOpen-access working draft.\nBook: https:\u002F\u002Fhghalebi.github.io\u002Fcategory_theory_transformer_rs\u002F\nSource: https:\u002F\u002Fgithub.com\u002Fhghalebi\u002Fcategory_theory_transformer_rs\n```\n\nMachine-readable citation metadata is available in [CITATION.cff](CITATION.cff).\nCitation is required where reuse is allowed, but citation alone is not\npermission for commercial or organizational group reuse.\n\nUse this citation in permitted reuse contexts such as papers, posts, slides,\ncourse notes, workshop pages, repositories, and public references.\n\nKeep both URLs in public references. The book page is the open-access reading\nsurface; the source repository is the executable Rust source for the examples.\n\nReproducing, adapting, distributing, or teaching substantial material from the\nbook or repository for a company, team, class, cohort, workshop, course, or\nother group with more than one person requires written permission when the use\nis commercial or organizational.\n\n## License, Reuse, And Support\n\nShort version:\n\n- The public book will always remain open access at\n  \u003Chttps:\u002F\u002Fhghalebi.github.io\u002Fcategory_theory_transformer_rs\u002F>.\n- The source repository is available at\n  \u003Chttps:\u002F\u002Fgithub.com\u002Fhghalebi\u002Fcategory_theory_transformer_rs>.\n- Cite both the public book URL and the source repository URL where reuse is\n  allowed. The required citation appears in the `Citation` section above and in\n  [LICENSE.md](LICENSE.md).\n- Personal and individual study are allowed with clear citation.\n- One reader may study, cite, link, clone, and run the project for personal\n  learning.\n- Commercial or organizational group reuse involving more than one person\n  requires written permission before reproducing, adapting, distributing, or\n  teaching material from the book or repository beyond short quotation, linking,\n  review, and individual-study allowances. This includes company workshops,\n  internal team workshops, classes, cohorts, courses, and training programs.\n- Company workshops, internal team workshops, paid workshops, commercial\n  training programs, course packs, adapted slide decks, handouts, labs, and\n  workshop packets require written permission when they reuse substantial\n  material from this project.\n- When Kindle or hard copy editions are available, buying the Kindle version or\n  a hard copy supports continued public work. Paid editions are support\n  editions, not access gates.\n\nThe public book will always remain open access at\n\u003Chttps:\u002F\u002Fhghalebi.github.io\u002Fcategory_theory_transformer_rs\u002F>.\n\nThe source repository is available at\n\u003Chttps:\u002F\u002Fgithub.com\u002Fhghalebi\u002Fcategory_theory_transformer_rs>.\n\nThese are custom citation-and-permission terms. Open access means the public\nbook remains free to read online; it does not mean unrestricted commercial\nredistribution, commercial training use, company workshop use, or\norganizational group reuse.\n\nThe source code is published so readers can inspect, run, test, and contribute\nto the examples. Substantial reproduced code, prose, exercises, diagrams, or\nadapted teaching material used in a commercial or organizational group setting\nfollows the same written-permission rule.\n\nShort quotations, links, review, personal study, and noncommercial educational\ndiscussion are allowed with clear citation.\n\nCommercial or organizational reuse involving more than one person requires\nwritten permission when it reproduces, adapts, distributes, or teaches\nmaterial from the book or repository beyond short quotation, linking, review,\nand individual-study allowances. This includes company workshops,\ncompany-sponsored workshops, internal team workshops, company reading groups\nbased on copied or adapted material, paid courses, internal course packs,\ntranslations for distribution, adapted slide decks, handouts, labs, workshop\npackets, and other adapted material.\n\nIf the material is reused by or for a company, team, class, workshop, cohort,\ncourse, or training program with more than one person, request written\npermission first.\n\nCompany workshops, internal team workshops, paid workshops, and workshop\npackets count as commercial or organizational group reuse when they reproduce,\nadapt, distribute, or teach substantial material from the book or repository.\n\nCitation is required where reuse is allowed. Citation does not replace written\npermission for commercial or organizational group reuse.\n\nSee [LICENSE.md](LICENSE.md) for the full citation, reuse, permission, and\nsupport terms.\n\nPermission requests should start through the source repository:\n\u003Chttps:\u002F\u002Fgithub.com\u002Fhghalebi\u002Fcategory_theory_transformer_rs>.\n\nOpening an issue or sending a request does not itself grant permission. Only an\nexplicit written approval from a project owner or maintainer grants permission\nfor the requested commercial or organizational group use.\n\nWhen Kindle or hard copy editions are available, buying the Kindle version or a\nhard copy is a way to support continued public work. Paid editions are support\neditions, not access gates. Paid editions will not remove free public access to\nthe online book.\n","该项目旨在通过Rust语言和范畴论来解析小型机器学习系统的底层结构，强调可执行的代码逻辑而非AI黑盒。其核心功能包括利用Rust的强大类型系统来构建清晰且安全的小型ML模型，并通过范畴论提供数学上的严谨性。项目特别适合于对机器学习背后原理感兴趣的工程师或研究者，尤其是那些希望深入了解如何使用静态类型语言如Rust实现简单但高效的机器学习算法的人群。此外，它还为读者提供了从基础到进阶的学习路径，以及一系列实践挑战，鼓励社区参与并贡献反馈以完善内容。","2026-06-11 03:32:04","CREATED_QUERY"]