Skip to main content

Bayesian Hessian Approximation for Stochastic Optimization

The BayHess package uses noisy curvature pairs (noisy gradient differences computed at different points) to compute Hessian approximations. These Hessian approximations can be used to accelerate the convergence in stochastic optimization in a quasi-Newton fashion. To find a Hessian approximation, a posterior distribution of the Hessian is built. The prior distribution is based on the Frobenius norm with determinant constraints to impose extreme eigenvalues constraints and the likelihood distribution is built from the secant equations given the observed curvature pairs. To find the maximizer of the log posterior, the BayHess package uses the Newton-CG method with a homotopy approach to deal with the logarithmic barrier determinant constraints.

For a detailed description of the method, convergence analysis and numerical results, check our manuscript named “Approximating Hessian matrices using Bayesian inference: a new approach for quasi-Newton methods in stochastic optimization”. This package can be used with the MICE estimator.

A BayHess object is created by giving the dimensionality of the problem, and lower and upper bounds of the eigenvalues of the Hessian; i.e., strong convexity and smoothness parameters.

>>> bay = BayHess(n_dim=10, strong_conv=1e-3, smooth=1e4)

Curvature information is passed using the ‘update_curv_pairs’ method

>>> bay.update_curv_pairs(sk, yk)

And, finally, computing the Hessian approximation is done by

>>> hess = bay.find_hess()

Install BayHess from PyPI as

>>> pip install bayhess

A repository with numerical examples can be found at

https://github.com/agcarlon/bayhess_numerics

The documentation of the BayHess package is available at

https://bayhess.readthedocs.io/

Release files for bayhess 0.1.8

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

Source distribution (sdist)

Source distribution for bayhess 0.1.8
File Size Uploaded
bayhess-0.1.8.tar.gz 24.8 kB Details

Built distribution (wheel)

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

Total release size: 49.4 kB

Release files / bayhess-0.1.8.tar.gz

Download URL bayhess-0.1.8.tar.gz
Size 24.8 kB
Tags Source
SHA-256 checksum
How to use checksums
9e71c29b375214cdcd7bf58b32ad215984463e8bc8acfa6fdd09594e3bd367bd
BLAKE2b-256 checksum
How to use checksums
12023696111e47d71dd24376589879c5ba6314a7b2e0dc10f9879d30abb16465
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.10

Release files / bayhess-0.1.8-py3-none-any.whl

Download URL bayhess-0.1.8-py3-none-any.whl
Size 24.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5a9001c2ed295871b35f78260fa3e0b5e422d93118f73b0fcd9b84fd3ab402bd
BLAKE2b-256 checksum
How to use checksums
0e455ecb9b6e4de261a9314ef190fe27c610a5aefa85edae4fa68a25c7507d76
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.10

Release history Release notifications | RSS feed

This release

0.1.8 This release

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

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