Who it is forA Go developer who wants to learn neural networks and has no Python setup or GPU available.
The problemMost tutorials assume Python and heavy frameworks, which makes it hard to see how training works in plain code.
The outcomeA working XOR classifier trained by Tensai, plus a readable Go program to modify for other small problems.
What you need first
- Go toolchain (Go 1.26 or 1.27 is needed only for the GOEXPERIMENT=simd build)
- git to clone the repository
- Disk space for model checkpoints when using the image, audio, or embedding commands
Steps
- Install Go 1.26 or newer. (inferred, check the README)
- Run
git clone https://github.com/mattn/tensai(inferred, check the README) - Run
cd tensai/_example/xor(inferred, check the README) - Run
go run .(inferred, check the README) - Check the printed results, if any, against the XOR targets of 0, 1, 1, 0.
Prompt for your agent
Clone the mattn/tensai repository and run the program in _example/xor with go run. Report the trained predictions for the four XOR inputs. Verify that the outputs are close to 0, 1, 1, 0.
Caveat. The README lists the XOR example but the exact run command and printed output are not shown, so the steps above are inferred from the repository layout.
Use this in your AI agent
Ask your agent
Using the Deduped MCP, get the setup steps for mattn/tensai and "Train a small neural network in pure Go"
Add Deduped to Claude Code once
claude mcp add --transport http deduped https://dedupedai.com/mcp
Every Monday: the 5 hottest repos and exactly how to use them. Free, one email a week, unsubscribe anytime.
Get them freeShare: X LinkedIn Hacker News Email Copy link
Third-party repos we don't own. AI-written use cases can be wrong. Disclaimer