Skip to content

docs(examples): Add comprehensive convex optimization examples#61

Merged
noahgift merged 1 commit into
mainfrom
claude/research-optimization-techniques-01LWS5ZwqVEHQ13NbShwH7Ls
Nov 23, 2025
Merged

docs(examples): Add comprehensive convex optimization examples#61
noahgift merged 1 commit into
mainfrom
claude/research-optimization-techniques-01LWS5ZwqVEHQ13NbShwH7Ls

Conversation

@noahgift

Copy link
Copy Markdown
Contributor

Add 5 comprehensive examples demonstrating Phase 2 convex optimization methods:

  1. Lasso Regression with FISTA

    • Sparse recovery with L1 regularization
    • Demonstrates soft-thresholding proximal operator
    • Achieves excellent sparsity recovery
  2. Non-Negative Least Squares with FISTA

    • Constrained optimization with non-negativity
    • Shows projection onto non-negative orthant
    • Applications in spectral unmixing, image processing
  3. High-Dimensional Lasso with Coordinate Descent

    • 100 features, 30 samples (n >> m scenario)
    • Coordinate-wise soft-thresholding updates
    • Demonstrates efficiency for high-dimensional problems
  4. Box-Constrained Quadratic Programming

    • Coordinate descent with bound constraints
    • Convergence in just 5 iterations
    • Shows constraint satisfaction tracking
  5. FISTA vs Coordinate Descent Comparison

    • Side-by-side performance comparison
    • Both methods achieve identical solutions
    • CD: 4 iterations (146.9µs)
    • FISTA: 45 iterations (256.1µs)
    • Guidance on when to use each method

All examples include:

  • Clear problem formulation and mathematical background
  • Practical problem setup with realistic data
  • Convergence monitoring and validation
  • Solution quality analysis
  • Performance metrics

Total: ~650 lines of comprehensive documentation and working code demonstrating Phase 2 convex optimization capabilities.

Add 5 comprehensive examples demonstrating Phase 2 convex optimization methods:

1. Lasso Regression with FISTA
   - Sparse recovery with L1 regularization
   - Demonstrates soft-thresholding proximal operator
   - Achieves excellent sparsity recovery

2. Non-Negative Least Squares with FISTA
   - Constrained optimization with non-negativity
   - Shows projection onto non-negative orthant
   - Applications in spectral unmixing, image processing

3. High-Dimensional Lasso with Coordinate Descent
   - 100 features, 30 samples (n >> m scenario)
   - Coordinate-wise soft-thresholding updates
   - Demonstrates efficiency for high-dimensional problems

4. Box-Constrained Quadratic Programming
   - Coordinate descent with bound constraints
   - Convergence in just 5 iterations
   - Shows constraint satisfaction tracking

5. FISTA vs Coordinate Descent Comparison
   - Side-by-side performance comparison
   - Both methods achieve identical solutions
   - CD: 4 iterations (146.9µs)
   - FISTA: 45 iterations (256.1µs)
   - Guidance on when to use each method

All examples include:
- Clear problem formulation and mathematical background
- Practical problem setup with realistic data
- Convergence monitoring and validation
- Solution quality analysis
- Performance metrics

Total: ~650 lines of comprehensive documentation and working code
demonstrating Phase 2 convex optimization capabilities.
@noahgift noahgift merged commit 5428d45 into main Nov 23, 2025
4 of 10 checks passed
@noahgift noahgift deleted the claude/research-optimization-techniques-01LWS5ZwqVEHQ13NbShwH7Ls branch November 23, 2025 17:04
noahgift added a commit that referenced this pull request Apr 18, 2026
…contract (#110)

FALSIFY-CLI-002/005 failed on feat/pm-007-preflight-poka-yoke: `apr --help`
exposed 59 commands but registered_commands() had 57. Two commands were
missing from the Rust-side mirror:

- validate-manifest (AC-EX-004 tool, task #61) — added in earlier slice but
  never wired into the test vec.
- pretrain (task #105 MODEL-2 pretrain loop) — added to CLI but never added
  to the contract YAML or the test vec.

Fix:
- Add pretrain entry to contracts/apr-cli-commands-v1.yaml (category: training).
- Add validate-manifest + pretrain to registered_commands() in the test.
- cfg_attr allow(unused_mut) on the vec for non-`code`-feature builds.

Local: `cargo test -p apr-cli --test cli_commands` — 6/6 PASS.
`pv validate contracts/apr-cli-commands-v1.yaml` — 0 errors, 0 warnings.

Unblocks task #95 (open PR against main for SHIP-TWO-001 work).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
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.

2 participants