← All courses

EDGE FDE

Intermediate

PyTorch to Core AI in Xcode (Fashion-MNIST)

On a Mac, train a small clothing model on Fashion-MNIST. Use MPS if you have it, or CPU if you do not. Convert it to .aimodel, then show the top label in a SwiftUI app with Core AI.

This course is for you if you can write Python and Swift, and you are new to Core AI.

Lessons

  1. The clothing classifier pipeline
  2. Train ClothingCNN on Fashion-MNIST
  3. Convert ClothingCNN with coreai-torch
  4. Add the clothing model to Xcode
  5. Build a SwiftUI clothing classifier
  6. Profile the clothing inference path
  7. Evaluate the clothing classifier
  8. Fashion-MNIST end-to-end checklist

Key concepts

Takeaways

Agent briefs

FAQ

Can I train on a Mac then run in an iOS app?

Yes. Train in PyTorch on MPS/CPU, convert with coreai-torch to a .aimodel, then load in Xcode on iOS/macOS 27+.

What is coreai-torch?

Apple's converter that turns a trained PyTorch model into a Core AI .aimodel for on-device inference.

Is Fashion-MNIST production-ready?

No — it is the teaching classifier used to prove the train→convert→ship loop before you swap in your own data.

Do I need MLX for this path?

No. This course uses PyTorch + coreai-torch. MLX is a separate train/experiment stack (see Core AI vs Core ML vs MLX).

Where does LiteRT fit?

LiteRT is the Android sibling path — see PyTorch to Android with LiteRT.

Related courses

PyTorch to Android with LiteRT · From the metal to the model · Model architectures in plain English · Diffusion LoRA to Core AI on device · MLX Swift in production · Core AI Fast First Token and the Right Compute Unit