Source code for my blog post "Getting started with TensorFlow on iOS"
This is the code that accompanies my blog post Getting started with TensorFlow on iOS.
It uses TensorFlow to train a basic binary classifier on the Gender Recognition by Voice and Speech Analysis dataset.
This project includes the following:
To train the model, do the following:
/tmp/voiceevery 10,000 training steps. Training happens in an infinite loop and goes on forever, so press Ctrl+C when you're happy with the training set accuracy and the loss no longer becomes any lower.
To run the model on the iOS TensorFlow app, do the following:
The model is already included in the app as inference.pb. If you train the model with different settings, you need to run the
optimize_for_inferencetools to create a new inference.pb.
To run the model on the iOS Metal app, do the following:
W.binfor the weights and
b.binfor the bias.
b.bininto the VoiceMetal Xcode project and build the app.
You need to run the Metal app on a device, it won't work in the simulator.