Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dfm/optimize.js
A tool for robust numerical optimization running right in your browser
https://github.com/dfm/optimize.js
Last synced: about 2 months ago
JSON representation
A tool for robust numerical optimization running right in your browser
- Host: GitHub
- URL: https://github.com/dfm/optimize.js
- Owner: dfm
- Created: 2012-07-09T20:58:52.000Z (about 12 years ago)
- Default Branch: main
- Last Pushed: 2020-06-12T18:24:25.000Z (over 4 years ago)
- Last Synced: 2024-07-01T21:15:04.875Z (3 months ago)
- Language: JavaScript
- Homepage: http://danfm.ca/optimize.js
- Size: 87.9 KB
- Stars: 20
- Watchers: 6
- Forks: 7
- Open Issues: 1
-
Metadata Files:
- Readme: README.markdown
Awesome Lists containing this project
README
optimize.js
===========[This](http://en.wikipedia.org/wiki/Mathematical_optimization) kind of
optimization. Not [that](https://developers.google.com/closure/compiler/).This was ported from the `scipy.optimize` and we seem to be about an order
of magnitude faster than the Python version but that hasn't been too well
tested.Usage
-----To optimize some dumb function, just run
```javascript
my_function = function (x) {
return optimize.vector.dot(x, x);
};
xopt = optimize.fmin(my_function, [5.0, -3.4, 1.7, 16.3, 0.17]);
```And this should say something like:
```
Converged in 349 iterations.
Function value = 3.954810202072493e-7
```And `xopt` should end up being something like
```
[-0.0003993727670733724, -0.00027257793115893254, -0.0003811443958917447, 0.00012560283306980614, 0.00002523018782488204]
```You can also include some options as follows:
```javascript
xopt = optimize.fmin(my_function, [5.0, -3.4, 1.7, 16.3, 0.17], {ftol: 1e-7, maxiter: 1000});
```To Do
-----* Write tests.
* Implement some better algorithms.
* Make some demos.