Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor C++ code into modular files and switch to setuptools build system #9

Merged
merged 4 commits into from
Mar 16, 2025

Conversation

apoorvalal
Copy link
Owner

Split the monolithic _pyensmallen.cpp file into modular components:

  • utils.hpp: Common utilities and wrapper classes
  • newton_type.hpp: L-BFGS implementation
  • constrained.hpp: Frank-Wolfe algorithm for constrained optimization
  • first_order.hpp: Adam and its variants

Also updated the build system to use setuptools instead of meson for better compatibility.

h/t claude code

…ystem

Split the monolithic _pyensmallen.cpp file into modular components:
- utils.hpp: Common utilities and wrapper classes
- newton_type.hpp: L-BFGS implementation
- constrained.hpp: Frank-Wolfe algorithm for constrained optimization
- first_order.hpp: Adam and its variants

Also updated the build system to use setuptools instead of meson for better compatibility.
Created benchmark_performance.py which:
- Generalizes the likelihood_comparison notebook into a reusable script
- Tests performance across different dataset sizes (n,k)
- Compares pyensmallen against other popular optimization libraries
- Generates visualizations and summary tables
- Includes command-line options for customization

This will help demonstrate pyensmallen's performance advantages.
@apoorvalal apoorvalal merged commit ec914ce into master Mar 16, 2025
4 checks passed
@apoorvalal apoorvalal deleted the modular-cpp-structure branch March 23, 2025 22:36
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