Examples of using ML in a Dala app.
Demonstrates basic ML operations using the auto-configured backend (EMLX on iOS, BinaryBackend elsewhere).
Summary
Functions
Simple tensor operations with auto-configured backend.
Runs a full ML pipeline: preprocess → inspect → report. Useful for debugging model input/output shapes.
Image classification preprocessing pipeline.
Verifies the ML stack is working and returns status info.
YOLO-like object detection preprocessing.
Functions
@spec basic_operations() :: map()
Simple tensor operations with auto-configured backend.
@spec debug_pipeline(Nx.Tensor.t(), atom()) :: map()
Runs a full ML pipeline: preprocess → inspect → report. Useful for debugging model input/output shapes.
@spec image_classify(Nx.Tensor.t()) :: {:ok, Nx.Tensor.t()} | {:error, term()}
Image classification preprocessing pipeline.
Takes an image tensor and applies standard ImageNet preprocessing. Returns a normalized batch tensor ready for model input.
Verifies the ML stack is working and returns status info.
@spec yolo_detect(Nx.Tensor.t()) :: {:ok, Nx.Tensor.t()} | {:error, term()}
YOLO-like object detection preprocessing.
Takes an image tensor and applies YOLO preprocessing.