Skip to main content

mindz

Learn AI by watching it think: machine learning, neural networks, tokenization, attention and language models, one operation at a time.

mindz is an educational desktop app. Every lesson runs a real algorithm with real arithmetic, records every step and lets you play, pause, step and scrub through it like a video. Every number on screen is a number the algorithm actually computed; every point, line, neuron, token and matrix can be clicked for an explanation in plain language, in detail or as a formula.

It belongs with qubitz (quantum computing) and neurz (RNN, LSTM, GRU and CNN up close).

What you can watch

Seventeen lessons in six chapters. Each runs a real algorithm and records every step.

Chapter Lesson What is animated
Machine learning Linear regression the line, the errors and their squares, the loss, the gradient on the loss surface, every gradient-descent step; a learning rate that is too large diverges
Logistic regression one neuron: its line and the weight vector w, every point placed on the sigmoid by its z, cross-entropy, the line settling into the gap
Overfitting polynomials of degree 1 to 12 against training and validation data, the U-shaped validation error, ridge regularisation λ
k nearest neighbours distances from a new point, the k nearest inside a circle, the vote, the whole decision map, leave-one-out accuracy
Decision tree the Gini scan over every threshold, split after split, the regions and the tree drawn as it grows
K-means random centres, assignment and update rounds, the regions of the centres, J falling until nothing changes
Deep learning Neural network one sample forward and backward, then hundreds of epochs bending the boundary; the straight line of every hidden neuron
Convolution a 3×3 filter sliding over a picture, the feature map filling cell by cell, ReLU and 2×2 max pooling
Language (NLP) Tokenization (BPE) characters, pair counts, merge after merge, the vocabulary and the token ids
Word vectors context windows, co-occurrence counts, PPMI, SVD down to a word map, nearest words by cosine
Transformer · LLM Self-attention readable embeddings with positions, Q, K, V, scores, softmax and the weighted sum row by row, causal mask
Transformer block three heads side by side, concat and W_O, residual, layer norm, feed-forward, residual, layer norm
Attention learns a head that starts random and learns W_Q and W_K by gradient descent; the query–key table grows its diagonal
Next word logits, temperature, softmax, top-k, top-p, the dice on the cumulative bar, or greedy argmax
Beam search the search tree expanding and pruning, beam against greedy with their log probabilities
Reinforcement learning Q-learning an agent on a grid: ε-greedy moves, the update rule with its numbers, values spreading back from the goal, the policy
Generative models Diffusion noise added step by step, then removed from fresh noise with DDIM and the ideal denoiser, for 2-D points or tiny pictures

Linear regression

  • Playback: play / pause, step forward and back, jump to start or end, loop, speed 0.25×–8×, a timeline grouped by step that you can click or drag.
  • Click to learn: every element opens a short bubble; the right panel explains it at three levels (Simple · Detailed · Math) with links to related concepts; hovering shows the exact numbers.
  • Lessons: a guided lesson per topic, each step jumping to the moment it talks about, with a question at the end.
  • Change everything: learning rates, steps, noise, k, datasets, depth, hidden neurons, filters and pictures, your own text and sentences, temperature, top-k, top-p, beam width, exploration ε, seeds. The run is recomputed at once.
  • Ten languages: Türkçe, English, Azərbaycanca, Deutsch, Français, Español, Русский, العربية, فارسی, 中文 (right-to-left for Arabic and Persian). Everything is translated in every language: the interface, the narration of every step, all 119 concepts at three levels, the lessons and their questions. The word lessons (tokenization, word vectors, attention, Transformer block, next word, beam search) run on their own example sentences and a small corpus in each language.
  • Your own data: click points onto the canvas (shift or right click for the second class), drag them, delete them; edit them as a table; load CSV, TSV or JSON; draw the 10×10 picture for convolution or load a photo; give the tokenizer your text and the word vectors your corpus. Regression, logistic regression, overfitting, k-NN, the decision tree, k-means, the neural network and diffusion all learn from what you give them.
  • Sliders: every number is a slider and the run is recomputed while you drag.
  • Export: a PDF report of the lesson (cover with the settings, one page per step with the vector diagram, what happens, the formula and the concept, the question with its answer), PNG and SVG pictures, GIF and MP4 animations of the whole run, your data as CSV or JSON.
  • Sessions: save the lessons' settings and your data in a .mindz file and open it again; recent sessions in the File menu.
  • Settings: language, theme, fonts with a preview, text and diagram size, playback, export sizes, start-up behaviour, updates (a daily check and one-click update) and the list of shortcuts.
  • 9 themes, your own interface and number fonts and text sizes.

Attention learns

Transformer block

Decision tree

Q-learning

Diffusion

Next word

Download (portable, nothing to install)

Every release on the Releases page carries ready-to-run builds:

System File How to start
Windows 10/11 mindz-<version>-windows-x64.exe double-click (SmartScreen: More info → Run anyway)
Linux x86-64 mindz-<version>-linux-x86_64.AppImage chmod +x mindz-*.AppImage && ./mindz-*.AppImage
macOS (Apple silicon) mindz-<version>-macos-arm64.zip unzip, then right-click mindz.app → Open (the app is not notarised)

The native Rust window (one small file, no Python): mindz-rust-<version>-windows-x64.exe, mindz-rust-<version>-linux-x64.tar.gz, mindz-rust-<version>-macos-arm64.tar.gz.

Install

The desktop app (Python, PyPI):

pip install mindz
mindz        # or: mz

Python 3.10+ with PySide6 and NumPy; runs on Windows, Linux and macOS.

The Rust version (crates.io) is a native desktop window of its own, written with egui, and a command line. It has eight lessons so far (linear and logistic regression, overfitting, k-NN, the decision tree, k-means, the neural network, BPE tokenization), the same narration, concepts, lessons and questions as the Python app and its nine themes, in eight languages (Arabic and Persian need text shaping that egui does not do yet; they stay in the Python app and in the terminal):

cargo install mindz
mindz                                    # the window
mindz run knn --k 1 --dataset xor --lang de   # every step in the terminal
mindz explain gradient --level detail --lang fr

On Linux, building it needs the usual window libraries: libxkbcommon-dev libgl1-mesa-dev libwayland-dev (Debian/Ubuntu) or libxkbcommon mesa wayland (Arch).

Gradient descent and the BPE tokenizer also run with JavaScript, in the terminal or in your own code:

npm install -g mindz-js      # JavaScript (npm); the command is still mindz
mindz run linreg --lr 0.18
import { linreg, bpe } from "mindz-js";
const r = linreg({ lr: 0.08, steps: 40 });   // r.steps: [{ k, loss, w, b, dw, db }]
const t = bpe("low lower lowest", 4);         // t.merges, t.vocab, t.tokens, t.ids
let r = mindz::linreg(0.08, 40, 0.8, 3);           // r.steps, r.diverged
let t = mindz::bpe("low lower lowest", 4, "en");   // t.merges, t.vocab, t.tokens, t.ids

The packages are mindz on PyPI and crates.io and mindz-js on npm (npm refuses mindz as too similar to other names); every one installs a mindz command. Linear regression and BPE use the same small random generator in every version, so the JavaScript and Rust results match the Python app number for number (the test suites check this against tests/golden.json); the other Rust lessons draw their data from the same generator and run the same algorithms. mindz gui in the npm version opens the Python desktop app if it is installed.

Command line

mz topics                                  # the seventeen lessons
mz run linreg --lr 0.3                     # every step with its numbers (this one diverges)
mz run kmeans --k 4 --seed 9
mz run mlp --dataset spiral --hidden 8 --lr 3
mz run tokens --text "evler evlerde kitaplar kitaplarda" --lang tr
mz run attention --sentence "the small dog brought the big ball" --causal true
mz run sampling --temperature 1.5 --top-k 5 --top-p 0.9
mz run sampling --method greedy
mz run beam --start teacher --width 3
mz run tree --depth 4 --dataset xor
mz run qlearn --epsilon 0.2
mz run diffusion --shape images
mz concepts                                # every concept key
mz explain temperature --level math        # simple | detail | math
mz update                                  # upgrade with this Python's pip
mz -v

--lang tr, --lang de, --lang zh … (any of the ten codes) may stand anywhere on the line; without it the system language is used.

Keyboard

Key Action
Space play / pause
← / → step back / forward
Home / End start / end
+ / − faster / slower
L loop
1 … 9 the first nine topics
F1 / F2 / F3 Simple / Detailed / Math explanations
Ctrl+B / Ctrl+E left / right panel
Ctrl+L lesson
Ctrl+PgUp / Ctrl+PgDown previous / next lesson
Ctrl+D edit your points on the canvas
Ctrl+T your data as a table (or picture, or text)
Ctrl+I import data
Ctrl+N / Ctrl+O / Ctrl+S new / open / save session
Ctrl+P PDF report
Ctrl+Shift+E PNG of this step
Ctrl+R reset the lesson's settings
F11 full screen
Ctrl+, settings

How it works

src/mindz/core/topics.py runs each algorithm once and records every operation as a frame (phase, values, the formula with its own numbers, the concept it explains). The window only moves through these frames, so pausing, stepping back and scrubbing never recompute anything. The attention lesson uses a hand-made embedding whose six dimensions have a meaning (noun, living, verb, pronoun, adjective, function word) plus two for position, and hand-written W_Q, W_K, W_V, so the attention pattern can be explained; real Transformers learn all of these. The next-word and beam-search lessons use a bigram model counted from a small built-in text. The diffusion lesson uses the exact ("ideal") denoiser of its training set instead of a trained network, so it shows the mechanics of the reverse process honestly, including that a perfect denoiser can only give the training examples back.

Development

git clone https://github.com/bayramkotan/mindz && cd mindz
pip install -e .[dev]
pytest -q                 # Python
npm test                  # JavaScript
cargo test                # Rust
python tools/make_golden.py   # after changing the shared runs
python tools/export_i18n.py   # after changing texts: the Rust window reads rust/i18n.json
python packaging/build.py     # portable build for this system

License

MIT © 2026 Bayram Kotan. Bundled fonts: Inter and JetBrains Mono (SIL Open Font License).

Metadata

Release files for mindz 0.0.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mindz 0.0.4
File Size Uploaded Provenance Actions
mindz-0.0.4.tar.gz 1.6 MB Without provenance Details for mindz-0.0.4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for mindz 0.0.4
File Interpreter ABI Platform Actions
mindz-0.0.4-py3-none-any.whl Python 3 none any Details for mindz-0.0.4-py3-none-any.whl

Total release size: 3.2 MB

Release files / mindz-0.0.4.tar.gz

Download URL mindz-0.0.4.tar.gz
Size 1.6 MB
Tags Source
SHA-256 checksum
How to use checksums
06ef86bdbf6d1b01a12acffed8d7448e290a7c2926600fdbc22fc85e7dae29b6
BLAKE2b-256 checksum
How to use checksums
f9e3a94aa825d21da072b33453e6675b89fe97d676ba2f5b9ad5bf662d80e049
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.16

Release files / mindz-0.0.4-py3-none-any.whl

Download URL mindz-0.0.4-py3-none-any.whl
Size 1.6 MB
Tags Python 3
SHA-256 checksum
How to use checksums
b27c2848a72c5692fb93b0250da5090d3f5bfc7a4e05680cd6462ad3c1c02308
BLAKE2b-256 checksum
How to use checksums
8d47d7a432c8dff4801c5abdbbdc567988600f889259e8b81150d272f222b2f2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.16

Security for mindz 0.0.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page