This example demonstrates how to train the custom-defined models (based on examples from PyTorch and Keras ) against the CIFAR-10 image classification dataset.
Two custom models are defined, and one is applied to an instance of the CIFAR-10 dataset. A custom training loop is defined, and the training and test losses and accuracies for each epoch are shown during training.
To begin, you'll need the latest version of Swift for
TensorFlow
installed. Make sure you've added the correct version of swift
to your path.
To train the model, run:
cd swift-models
swift run -c release Custom-CIFAR10