Fork of second-order-random-search with scipy.minimize-like interface.
Project description
pySORS
Fork of https://github.com/adamsolomou/second-order-random-search, which implements algorithms described in:
Aurelien Lucchi, Antonio Orvieto, Adamos Solomou. On the Second-order Convergence Properties of Random Search Methods. In Neural Information Processing Systems (NeurIPS), 2021.
This fork implements a scipy.minimize-like interface for those methods.
Usage
import pysors
import numpy as np
def rosenbrock(arr):
x,y = arr
a = 1
b = 100
return (a - x) ** 2 + b * (y - x ** 2) ** 2
x0 = np.array([-3., -4.])
res = pysors.minimize(rosenbrock, x0 = x0, method = 'bds', stopval=1e-8)
print(res) # - optimization result, holds `x`, `value` attributes
print(res.x) # - solution array.
This can also be used step-wise in the following way:
opt = pysors.BDS()
for i in range(1000):
x = opt.step(rosenbrock, x)
print(x) # last solution array
print(rosenbrock(x)) # objective value at x
List of methods
STP: Stochastic Three PointsBDS: Basic Direct SearchAHDS: Approximate Hessian Direct SearchRS: Two-step random searchRSPI_FD: Power Iteration Random SearchRSPI_SPSA: Power Iteration Random Search with SPSA hessian estimation
References
If you found this useful, please consider citing author's paper:
@inproceedings{
lucchi2021randomsearch,
title={On the Second-order Convergence Properties of Random Search Methods},
author={Aurelien Lucchi and Antonio Orvieto and Adamos Solomou},
booktitle={Advances in Neural Information Processing Systems (NeurIPS)},
year={2021}
}
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pysors-1.0.0.tar.gz.
File metadata
- Download URL: pysors-1.0.0.tar.gz
- Upload date:
- Size: 18.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.20
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3eb6e61238b3023650bc0f351c0a844b5b40bd27bfb9c76e241dcea0b1bf866f
|
|
| MD5 |
f206ae0bd0c38712c952eaa70b79ee17
|
|
| BLAKE2b-256 |
763c11b9511603fc7e72262c4022add50e9684fc6da6f2f502fa9788fe2f6c80
|
File details
Details for the file pysors-1.0.0-py3-none-any.whl.
File metadata
- Download URL: pysors-1.0.0-py3-none-any.whl
- Upload date:
- Size: 22.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.20
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
42002ef2992dc23b1194a3d77e63669f3eed725adbc9bd50046e9b980042accc
|
|
| MD5 |
2f2cc736ecd28fab305fad4cd06a91cf
|
|
| BLAKE2b-256 |
96539749a27aba4bba522feff5833d70e31843520b7442761f2159261c56826c
|