manopt-rs
A high-performance Rust library for manifold optimization built on top of the Burn deep learning framework. This library provides Riemannian optimization algorithms and manifold structures for constrained optimization problems.
Features
- Riemannian Optimization Algorithms: Modern optimizers adapted for manifold constraints
- Riemannian Adam (RiemannianAdam)
- Riemannian Gradient Descent (ManifoldRGD)
- Multiple Manifolds: Built-in support for common manifold structures
- Euclidean spaces
- WIP
- Backend Flexibility: Works with any Burn backend (NDArray, Torch, WGPU, etc.)
- Type Safety: Leverages Rust's type system for safe tensor operations
- High Performance: Built on Burn's efficient tensor operations
Installation
Add this to your Cargo.toml
:
[]
= "0.1.0"
# Example with Burn backend
= { = "0.17", = ["tch", "autodiff", "ndarray"] }
Quick Start
use *;
use SimpleOptimizer;
Examples
Basic Optimization
Run a simple quadratic optimization example:
This demonstrates minimizing a quadratic function using Riemannian Adam.
Riemannian Adam Demo
Test the Riemannian Adam optimizer:
Architecture
Manifolds
The library is built around the Manifold
trait, which defines the geometric structure:
Optimizers
Riemannian optimizers that respect manifold constraints:
- RiemannianAdam: Adam optimizer adapted for Riemannian manifolds
- ManifoldRGD: Riemannian gradient descent
๐ฌ Supported Manifolds
- โ Euclidean: Standard unconstrained optimization
- ๐ง Stiefel: Matrices with orthonormal columns (in development)
- ๐ Planned: Grassmann, Symmetric Positive Definite, Sphere
๐งช Running Tests
Contributing
Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
Development Setup
-
Clone the repository:
-
Install dependencies:
-
Run tests:
๐ Related Projects
- Manopt: MATLAB toolbox for optimization on manifolds
- Pymanopt: Python toolbox for optimization on manifolds
- Burn: Deep learning framework in Rust
License
This project is licensed under the MIT License - see the LICENSE file for details.