Metadata-Version: 2.4
Name: hgdl
Version: 2.2.2
Summary: HGDL Optimization
Project-URL: Homepage, https://github.com/lbl-camera/hgdl
Project-URL: Documentation, https://hgdl.readthedocs.io/
Project-URL: Repository, https://github.com/lbl-camera/hgdl.git
Project-URL: Bug Tracker, https://github.com/lbl-camera/hgdl/issues
Project-URL: Changelog, https://github.com/lbl-camera/hgdl/commits/master/
Author-email: Marcus Michael Noack <MarcusNoack@lbl.gov>, "Ronald J. Pandolfi" <ronpandolfi@lbl.gov>
Maintainer-email: Marcus Michael Noack <MarcusNoack@lbl.gov>, "Ronald J. Pandolfi" <ronpandolfi@lbl.gov>
License: *** License Agreement ***
        HGDL Copyright (c) 2020, The Regents of the University of California,
        through Lawrence Berkeley National Laboratory (subject to receipt of
        any required approvals from the U.S. Dept. of Energy). All rights reserved.
        
        Redistribution and use in source and binary forms, with or without
        modification, are permitted provided that the following conditions are met:
        
        (1) Redistributions of source code must retain the above copyright notice,
        this list of conditions and the following disclaimer.
        
        (2) Redistributions in binary form must reproduce the above copyright
        notice, this list of conditions and the following disclaimer in the
        documentation and/or other materials provided with the distribution.
        
        (3) Neither the name of the University of California, Lawrence Berkeley
        National Laboratory, U.S. Dept. of Energy nor the names of its contributors
        may be used to endorse or promote products derived from this software
        without specific prior written permission.
        
        
        THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
        AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
        IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
        ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
        LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
        CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
        SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
        INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
        CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
        ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
        POSSIBILITY OF SUCH DAMAGE.
        
        You are under no obligation whatsoever to provide any bug fixes, patches,
        or upgrades to the features, functionality or performance of the source
        code ("Enhancements") to anyone; however, if you choose to make your
        Enhancements available either publicly, or directly to Lawrence Berkeley
        National Laboratory, without imposing a separate written license agreement
        for such Enhancements, then you hereby grant the following license: a
        non-exclusive, royalty-free perpetual license to install, use, modify,
        prepare derivative works, incorporate into other computer software,
        distribute, and sublicense such enhancements or derivative works thereof,
        in binary and source code form.
License-File: AUTHORS.rst
License-File: LICENSE
Keywords: adaptive,autonomous,gui,qt,self driving
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: BSD License
Classifier: Natural Language :: English
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.10
Requires-Dist: dask~=2024.1.0
Requires-Dist: distributed~=2024.1.0
Requires-Dist: loguru
Requires-Dist: numpy~=2.1.1
Requires-Dist: scipy~=1.13.0
Requires-Dist: wheel
Provides-Extra: docs
Requires-Dist: autodocs; extra == 'docs'
Requires-Dist: jupytext; extra == 'docs'
Requires-Dist: myst-nb; extra == 'docs'
Requires-Dist: myst-parser; extra == 'docs'
Requires-Dist: sphinx; extra == 'docs'
Requires-Dist: sphinx-panels; extra == 'docs'
Requires-Dist: sphinx-rtd-theme; extra == 'docs'
Provides-Extra: plotting
Requires-Dist: bokeh; extra == 'plotting'
Requires-Dist: matplotlib; extra == 'plotting'
Requires-Dist: plotly; extra == 'plotting'
Provides-Extra: tests
Requires-Dist: codecov; extra == 'tests'
Requires-Dist: pytest; extra == 'tests'
Requires-Dist: pytest-cov; extra == 'tests'
Description-Content-Type: text/markdown

# HGDL

[![PyPI](https://img.shields.io/pypi/v/HGDL)](https://pypi.org/project/hgdl/)
[![Documentation Status](https://readthedocs.org/projects/hgdl/badge/?version=latest)](https://hgdl.readthedocs.io/en/latest/?badge=latest)
[![HGDL CI](https://github.com/lbl-camera/HGDL/actions/workflows/HGDL-CI.yml/badge.svg)](https://github.com/lbl-camera/fvGP/actions/workflows/HGDL-CI.yml)
[![Codecov](https://img.shields.io/codecov/c/github/lbl-camera/HGDL)](https://app.codecov.io/gh/lbl-camera/HGDL)
[![PyPI - License](https://img.shields.io/pypi/l/HGDL)](https://pypi.org/project/hgdl/)
[<img src="https://img.shields.io/badge/slack-@gpCAM-purple.svg?logo=slack">](https://gpCAM.slack.com/)
[![DOI](https://zenodo.org/badge/434769975.svg)](https://zenodo.org/badge/latestdoi/434769975)


HGDL is an API for HPC distributed constrained function optimization.
At the core, the algorithm uses local and global optimization
and bump-function-based deflation to provide a growing list of unique optima of a differentiable function.
This tackles the common problem of non-uniquness of optimization problems, especially in machine learning.

## Usage

The following demonstrates a simple usage of the HGDL API.

```python
import numpy as np
from hgdl.hgdl import HGDL as hgdl
from hgdl.support_functions import *
import dask.distributed as distributed

bounds = np.array([[-500,500],[-500,500]])
#dask_client = distributed.Client("10.0.0.184:8786")
a = hgdl(schwefel, schwefel_gradient, bounds,
        global_optimizer = "genetic",
        local_optimizer = "dNewton", #put in local optimzers from scipy.optimize.minimize
        number_of_optima = 30000,
        num_epochs = 100)

x0 = np.random.uniform(low = bounds[:, 0], high = bounds[:,1],size = (20,2))
a.optimize(x0 = x0)

###the thread is now released, but the work continues in the background

a.get_latest() ##prints the current result whenever queried

a.kill_client() ##stops the execution and returns the result
```


## Credits

Main Developers: Marcus Noack ([MarcusNoack@lbl.gov](mailto:MarcusNoack@lbl.gov)) and David Perryman.
Several people from across the DOE national labs have given insights
that led to the code in its current form.
See [AUTHORS](AUTHORS.rst) for more details on that.
HGDL is based on the [HGDN](https://www.sciencedirect.com/science/article/pii/S037704271730225X) algorithm by Noack and Funke.

