Skip to content

Add C++ linear SVM training example with automatic differentiation - #4537

Open
StarxSky wants to merge 4 commits into
ml-explore:mainfrom
StarxSky:main
Open

StarxSky wants to merge 4 commits into
ml-explore:mainfrom
StarxSky:main

Conversation

@StarxSky

Copy link
Copy Markdown
  • ☑️ I understand it is strictly prohibited to use AI to write PR description

Summary

This pull request adds a C++ example demonstrating how to
implement and train a linear Support Vector Machine (SVM)
using MLX's automatic differentiation capabilities.

It implements a binary classifier using hinge loss
with L2 regularization and gradient-based optimization.
So, this code can be used to learn how to build machine learning algorithms using mlx.

The code has passed the CLI check.

Testing

I have tested the example locally using :

  • Operating System: macOS Tahoe 26.0.1
  • Architecture: arm64 M1 Processor
  • Compiler: [Apple clang version 17.0.0 (clang-1700.6.3.2)]
  • MLX version: [MLX 0.32.3]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant