Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
forked from to266/optimize

Rust crate for numerical optimization

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT
Notifications You must be signed in to change notification settings

sebasv/optimize

Open more actions menu
 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

optimize

Crates.io Documentation Build Status

This crate provides (non-linear) numerical optimization methods.

It is heavily based on scipy.optimize.

The crate is actively developed and expanded to include more methods.

A simple example follows:

// Define a function that we aim to minimize
let function = |x: ArrayView1<f64>| (1.0 - x[0]).powi(2) + 100.0 * (x[1] - x[0].powi(2)).powi(2);

// Create a minimizer using the builder pattern. If some of the parameters are not given, default values are used.
let minimizer = NelderMeadBuilder::default()
    .xtol(1e-6f64)
    .ftol(1e-6f64)
    .maxiter(50000)
    .build()
    .unwrap();

// Set the starting guess
let args = Array::from_vec(vec![3.0, -8.3]);

// Run the optimization
let ans = minimizer.minimize(&function, args.view());

// Print the optimized values
println!("Final optimized arguments: {}", ans);

About

Rust crate for numerical optimization

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Rust 100.0%
Morty Proxy This is a proxified and sanitized view of the page, visit original site.