A Sudoku Solver that leverages TensorFlow and iOS BNNS for deep learning.
A Sudoku Solver that leverages TensorFlow and BNNS of iOS 10 SDK for deep learning.
The steps below illustrate how to prepare your own training data for TensorFlow and use the training results for prediction in BNNS of iOS 10 SDK.
I use the Chars74K image dataset for training. My trained models are in the folder Assets.xcassets with the filename model-h#[b|w]-*.dataset
. To train your own models, follow the steps below.
[train|test]-[images|labels]-idx[1|3]-ubyte.gz
in the scripts folder.mnist-predict-from-model.py
to get the models.let magic = ImageMagic()
let ai = MnistNet()
guard let data = magic.mnistData(image: UIImage)
else {
return
}
let predicted: Int = ai.predict(input: data)
// Process your predicted label
Refer to the function importSudoku()
in ViewController.swift for a full example.
I reused soruce code and configurations from: