Skip to main content

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 Points
  • BDS: Basic Direct Search
  • AHDS: Approximate Hessian Direct Search
  • RS: Two-step random search
  • RSPI_FD: Power Iteration Random Search
  • RSPI_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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pysors-1.0.0.tar.gz (18.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pysors-1.0.0-py3-none-any.whl (22.4 kB view details)

Uploaded Python 3

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

Hashes for pysors-1.0.0.tar.gz
Algorithm Hash digest
SHA256 3eb6e61238b3023650bc0f351c0a844b5b40bd27bfb9c76e241dcea0b1bf866f
MD5 f206ae0bd0c38712c952eaa70b79ee17
BLAKE2b-256 763c11b9511603fc7e72262c4022add50e9684fc6da6f2f502fa9788fe2f6c80

See more details on using hashes here.

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

Hashes for pysors-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 42002ef2992dc23b1194a3d77e63669f3eed725adbc9bd50046e9b980042accc
MD5 2f2cc736ecd28fab305fad4cd06a91cf
BLAKE2b-256 96539749a27aba4bba522feff5833d70e31843520b7442761f2159261c56826c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page