Skip to main content

The portable universal library in global optimization.

Project description

porgo

When I was researching a function without given all local minima, like the underlined function:

$$ f(x)=\sum_{i=1}^{n/2}(-13+x_{2i-1}+((5-x_{2i})x_{2i}-2)x_{2i})^2+(-29+x_{2i-1}+((x_{2i}+1)x_{2i}-14)x_{2i})^2. $$

I used optimtool.unconstrain to search local minima, got an efficient experience about searching the nearest minimum point. Add a mechanism to jump out of the local area would increase the runtime of the whole script, so porgo is a new progam to accelerate to search global minima.

refer to test.py and the global minima of 4-dimensional $f(x)$ is (5, 4, 5, 4).

glos

glos is the main runtime to serve as a global search class, users can run train_gen module with given cycles at any times until the function searching process converged.

init:

  • objective_function: Callable, a high-dimensional function with convex, non-convex, and many local minima.
  • bounds: List[List[float]] | List[Tuple[float]], changes this value makes a significant influence of best and best_fit.
  • mutation: float=0.5, increase this value makes the search radius larger.
  • recombination: float=0.9, increase this value allows larger number of mutation.

rand_pop:

  • population_size: int=50, randomly init the population (or called initial points) with shape at (population, dimension).
  • verbose: bool=False, whether to output initial population when manually replace the random generated rule.

train_gen:

  • cycles: int=1000, try to run several times (until converged) when give a smaller cycle number if search bounds is in large space.

result:

  • verbose: bool=False, whether to output console information after search populations were updated (check self.best and self.best_fit).

reference

Storn, R and Price, K, Differential Evolution - a Simple and Efficient Heuristic for Global Optimization over Continuous Spaces, Journal of Global Optimization, 1997, 11, 341 - 359.

LICENSE

MIT LICENSE

Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

porgo-1.0.1-py3-none-any.whl (5.5 kB view details)

Uploaded Python 3

File details

Details for the file porgo-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: porgo-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 5.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/6.0.0 pkginfo/1.8.2 requests/2.28.2 requests-toolbelt/0.9.1 tqdm/4.64.1 CPython/3.8.12

File hashes

Hashes for porgo-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 29cae8e61c533dfb50f49fb6c444d525da6b33ededa9f44e6a74cf3756ec8f87
MD5 d86f4bdf1d116de5695b3645b54ffc7f
BLAKE2b-256 0025e623877617144fb0eb3d301a0a11b932f8cae4618f82fd95623efc67c475

See more details on using hashes here.

Supported by

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