- macOS 10.15+Beta
- Xcode 11.0+Beta
- Metal Performance Shaders
The sample code describes how to write a neural network using
MPSNNGraph and how to train the network to recognize a digit in an image. The sample trains a network for 300 iterations on a batch size of 40 images. You’ll see how to set up training of weights and biases using data sources, including how to initialize and update weights. You’ll also see how to validate the network using a test dataset.
You can use any dataset of your choice to train this model. The following dataset works well for this purpose:
If you choose to use this dataset, the sample includes a script that downloads the dataset from that location and pass it as input to the model.
Configure the Sample Code Project
Before you run the sample code project in Xcode:
Make sure your Mac is running macOS 10.15 or later.
Make sure you are running Xcode 11 or later.