Skip to main content

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}
}

Metadata

Release files for pysors 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pysors 1.0.0
File Size Uploaded Provenance Actions
pysors-1.0.0.tar.gz 18.6 kB Without provenance Details for pysors-1.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pysors 1.0.0
File Interpreter ABI Platform Actions
pysors-1.0.0-py3-none-any.whl Python 3 none any Details for pysors-1.0.0-py3-none-any.whl

Total release size: 41.0 kB

Release files / pysors-1.0.0.tar.gz

Download URL pysors-1.0.0.tar.gz
Size 18.6 kB
Tags Source
SHA-256 checksum
How to use checksums
3eb6e61238b3023650bc0f351c0a844b5b40bd27bfb9c76e241dcea0b1bf866f
BLAKE2b-256 checksum
How to use checksums
763c11b9511603fc7e72262c4022add50e9684fc6da6f2f502fa9788fe2f6c80
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.9.20

Release files / pysors-1.0.0-py3-none-any.whl

Download URL pysors-1.0.0-py3-none-any.whl
Size 22.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
42002ef2992dc23b1194a3d77e63669f3eed725adbc9bd50046e9b980042accc
BLAKE2b-256 checksum
How to use checksums
96539749a27aba4bba522feff5833d70e31843520b7442761f2159261c56826c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.9.20

Security for pysors 1.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page