mnistdraw

command
v0.6.21 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 4, 2026 License: MIT Imports: 21 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Command mnistdraw is an interactive version of Apple's "Training a Neural Network using MPS Graph" sample: draw a digit with the mouse and watch the network classify it as you draw.

It is the UI half of the sample, which the headless mnisttrain example does not cover. The same MPSGraph network is trained on MNIST at startup, then each stroke is normalized the way MNIST was and fed back through the graph for a live prediction.

The window has three parts:

  • a canvas to draw on, left
  • one bar per digit showing the softmax probability, right
  • Train, Clear, and a status line, bottom

Training runs on a background goroutine so the window stays responsive, and the graph uses a dynamic batch dimension so the very same weights serve both the 40-image training steps and the single-image canvas predictions.

Usage:

mnistdraw [-data dir] [-iterations n] [-batch n] [-lr rate]

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL