mnisttrain

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: 16 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 mnisttrain trains a small MNIST digit classifier with MPSGraph.

It is a Go port of Apple's "Training a Neural Network using MPS Graph" sample. The network is

conv 5x5x1x32 + relu -> max pool 2x2
conv 5x5x32x64 + relu -> max pool 2x2
fully connected 3136x1024 + relu
fully connected 1024x10

trained with softmax cross entropy and plain stochastic gradient descent. The weights are graph variables, and each step assigns the descended value back into the variable, so training happens entirely inside the graph.

The MNIST files are read from -data, and downloaded there if missing.

Usage:

mnisttrain [-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