Skip to main content

Library for the use of various variants of the Gene-pool Optimal Mixing Evolutionary Algorithm (GOMEA).

Project description

Build and run demo

README

The Gene-pool Optimal Mixing Evolutionary Algorithm (GOMEA) is a state-of-the-art Model-Based Evolutionary Algorithm (MBEA) with an ongoing line of research into various domains of (evolutionary) optimization. The initial release of the GOMEA library (v1.0.0) is described in the publication:

The current release of the GOMEA library supports optimization in the following domains:

  • Discrete single-objective optimization
  • Real-valued single-objective optimization

Support for multi-objective optimization in both of these domains is planned for a future release.

Relevant most recent publications are the following:

INSTALL

The most straightforward installation option is through pip, as follows.

pip install gomea

To build from source, it is recommended to create a conda virtual environment with the dependencies listed in environment.yml, as follows:

conda env create --file=environment.yml
conda activate gomea

Then compile and install the code by executing the following in the root GOMEA folder.

make install

You can now start using the library by calling import gomea in your code, or by running any of the demo scripts present in the demos directory.

RUN

Running a simple benchmark problem, e.g., the Rosenbrock function, can be done as follows:

import gomea
frv = gomea.fitness.RosenbrockFunction(10,value_to_reach=1e-10)
lm = gomea.linkage.Univariate()
rvgom = gomea.RealValuedGOMEA(fitness=frv, linkage_model=lm, lower_init_range=-115, upper_init_range=-100)
result = rvgom.run()

Plotting a simple convergence plot can then be done using:

import matplotlib.pyplot as plt
plt.grid()
plt.yscale('log')
plt.xscale('log')
plt.xlabel('Number of evaluations')
plt.ylabel('Best objective value')
plt.plot(result['evaluations'],result['best_obj_val'])

Rather than using a predefined fitness function, it is also possible to define your own custom fitness function for Black-Box Optimization (BBO) or Gray-Box Optimization (GBO). The definition of a custom (real-valued) BBO function can be done as follows.

class CustomRosenbrockFunction(gomea.fitness.BBOFitnessFunctionRealValued):
    def objective_function( self, objective_index, variables ):
        f = 0
        for i in range(len(variables)-1):
            x = variables[i]
            y = variables[i+1]
            f += 100*(y-x*x)*(y-x*x) + (1.0-x)*(1.0-x)
        return f

dim = 10
f_rosenbrock = CustomRosenbrockFunction(dim,value_to_reach=1e-10)

The definition of a GBO function requires defining the input and output of each subfunction. Thorough definitions of this are given in the EvoSOFT workshop paper. An example of the Rosenbrock function defined in a GBO setting is as follows:

class CustomRosenbrockFunction(gomea.fitness.GBOFitnessFunctionRealValued):
    def number_of_subfunctions( self ):
        return self.number_of_variables-1
    
    def inputs_to_subfunction( self, subfunction_index ):
        return [subfunction_index, subfunction_index+1]

    def subfunction(self, subfunction_index, variables):
        x = variables[subfunction_index]
        y = variables[subfunction_index+1]
        return 100*(y-x*x)*(y-x*x) + (1.0-x)*(1.0-x)
        
dim = 10
f_rosenbrock = CustomRosenbrockFunction(dim,value_to_reach=1e-10)

Further examples are given in the demos directory.

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

gomea-1.0.6.tar.gz (1.1 MB view details)

Uploaded Source

Built Distributions

gomea-1.0.6-cp313-cp313-win_amd64.whl (469.4 kB view details)

Uploaded CPython 3.13 Windows x86-64

gomea-1.0.6-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.13 manylinux: glibc 2.17+ x86-64

gomea-1.0.6-cp313-cp313-macosx_11_0_arm64.whl (726.1 kB view details)

Uploaded CPython 3.13 macOS 11.0+ ARM64

gomea-1.0.6-cp312-cp312-win_amd64.whl (470.8 kB view details)

Uploaded CPython 3.12 Windows x86-64

gomea-1.0.6-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.12 manylinux: glibc 2.17+ x86-64

gomea-1.0.6-cp312-cp312-macosx_11_0_arm64.whl (729.4 kB view details)

Uploaded CPython 3.12 macOS 11.0+ ARM64

gomea-1.0.6-cp311-cp311-win_amd64.whl (469.6 kB view details)

Uploaded CPython 3.11 Windows x86-64

gomea-1.0.6-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

gomea-1.0.6-cp311-cp311-macosx_11_0_arm64.whl (729.2 kB view details)

Uploaded CPython 3.11 macOS 11.0+ ARM64

gomea-1.0.6-cp310-cp310-win_amd64.whl (468.5 kB view details)

Uploaded CPython 3.10 Windows x86-64

gomea-1.0.6-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

gomea-1.0.6-cp310-cp310-macosx_11_0_arm64.whl (728.3 kB view details)

Uploaded CPython 3.10 macOS 11.0+ ARM64

gomea-1.0.6-cp39-cp39-win_amd64.whl (471.2 kB view details)

Uploaded CPython 3.9 Windows x86-64

gomea-1.0.6-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

gomea-1.0.6-cp39-cp39-macosx_11_0_arm64.whl (731.8 kB view details)

Uploaded CPython 3.9 macOS 11.0+ ARM64

File details

Details for the file gomea-1.0.6.tar.gz.

File metadata

  • Download URL: gomea-1.0.6.tar.gz
  • Upload date:
  • Size: 1.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for gomea-1.0.6.tar.gz
Algorithm Hash digest
SHA256 1f9560acb528a53ef494e527c8ad32ca6bf313fb9cf807ed8e8c46b4e2b236da
MD5 1f6746b2681e2533dbfc95edc31fa1b1
BLAKE2b-256 0e2ec3a9e286bc587370ca8e30d84c1c8657691cf21dc649cfcaacc1a3049cec

See more details on using hashes here.

File details

Details for the file gomea-1.0.6-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: gomea-1.0.6-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 469.4 kB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for gomea-1.0.6-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 c62e4e13e97a9f8bf8b72e322f1b7032cedb11c7ba169d6d3fb1097c32f7383e
MD5 b6738e0df040aea5a836bed45759852d
BLAKE2b-256 60b89a9d37f988db40a5b3fe13f1ae6e36ac2cdcc35cea9461bac30248c5d0b6

See more details on using hashes here.

File details

Details for the file gomea-1.0.6-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for gomea-1.0.6-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 757ed8cb5f14791944d73de3f82cef46a5b022fbbfff79a08729a146ff7714f1
MD5 19f6b81db92d391d80da8d64d11c6d71
BLAKE2b-256 b03cad38c6df0ad752ae104ff6f54de532dd91c9a7c9f9439dc8988b04933c45

See more details on using hashes here.

File details

Details for the file gomea-1.0.6-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for gomea-1.0.6-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 99b3231e0eb1d3ab9e72fd2fd9598c833123034eed867086398b354aac4b2a45
MD5 8bb855e98c1de24097c39fdbdae36f23
BLAKE2b-256 ce1ef8ea67f55c87a3c1b8cf489f3cecbb3e73614d7547fb2dbec3e0ace45f63

See more details on using hashes here.

File details

Details for the file gomea-1.0.6-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: gomea-1.0.6-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 470.8 kB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for gomea-1.0.6-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 83b1681e2bfc13e4b816b1c3ad5f0c35e81614feea16a59f5196ea01c163c421
MD5 ddca0bce2a4ffc9fa1876a7398d5e3b0
BLAKE2b-256 e93963631bb87e34213cfde9bfeb0df8e390d9cdf9df2d60f165dc47f3ab954b

See more details on using hashes here.

File details

Details for the file gomea-1.0.6-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for gomea-1.0.6-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 90977f0e97029394503cd76f8db29fd3d8b0343df75b15810270966df978b771
MD5 7c79a19bbc5575910acfcd2316fa6c2a
BLAKE2b-256 2817af2be0bab3c5d82e04738c7844004bdf567a58ca18ec25153c49f8ca822e

See more details on using hashes here.

File details

Details for the file gomea-1.0.6-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for gomea-1.0.6-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c0eac557347d9365ee81e2474197133a82d6331e97ed0359fef09f034e21efa8
MD5 8c55a844d0fce2e0b3ad95d4a48c5956
BLAKE2b-256 c2ff865bcee4bc99242b877500122939da951476b692a5a0fb6364c75fd7f207

See more details on using hashes here.

File details

Details for the file gomea-1.0.6-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: gomea-1.0.6-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 469.6 kB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for gomea-1.0.6-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 b327dd4aead344ea9919b6a7854b0730bf637dd9cc9495ab29ae394ee623f509
MD5 70ff2ff0b604dae42081e94df0806cd2
BLAKE2b-256 4f6d685e638d3bea41579e070bd4f80254d8dcf374bcbb68a1e27d00189e2ea7

See more details on using hashes here.

File details

Details for the file gomea-1.0.6-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for gomea-1.0.6-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 4a6dc59f1122eb4e14dc5eeefa83fa22d45def6528171cdad56c83494248a801
MD5 7a792c496939ce90833943fdffce332e
BLAKE2b-256 925bede0f3ffe815a48ff6ce071c1b99292795b8c0e74152e31eabeb037c9ba5

See more details on using hashes here.

File details

Details for the file gomea-1.0.6-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for gomea-1.0.6-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 3394872794a0089082c81fab762660aa966e6bb92fc2aa86c65f17aefbcb0fa3
MD5 a0c3b92ae1e5c4635516b59d8b7178b7
BLAKE2b-256 26ed4afd43c6639aecd6d086fcf26dc3b6581154963a3302dcf382a01f219059

See more details on using hashes here.

File details

Details for the file gomea-1.0.6-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: gomea-1.0.6-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 468.5 kB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for gomea-1.0.6-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 f79d807344016250debe7656aeca1bbd082844efe3fba4e7abb586aaae0779b7
MD5 cf74f32a605fca7eeced9a053b00073d
BLAKE2b-256 6d781cecc593fb4578ed5722056cdf105de3cd0ef92a8c2d272433e6e258f6e4

See more details on using hashes here.

File details

Details for the file gomea-1.0.6-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for gomea-1.0.6-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 801538e7af44a1cbec6ba3a346e26e06eb21e49f76d4e818c7f715e9cf106532
MD5 e2e1c31433a2be735e47f228ef754abb
BLAKE2b-256 ca5390952693c36a88185a2dbceecd19857ed9b5a0efb56deb1b5833858902da

See more details on using hashes here.

File details

Details for the file gomea-1.0.6-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for gomea-1.0.6-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 68ec143fea1fa167dae9cfbf29c845d4c086b13137fc8f80749eb3aa9f6f6f86
MD5 eb355477db1bcea074639310daa7e1f3
BLAKE2b-256 37f08f60bbc04064188af1011e66e9bdfa9a05651d873df4c52056e061ee7e4f

See more details on using hashes here.

File details

Details for the file gomea-1.0.6-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: gomea-1.0.6-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 471.2 kB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for gomea-1.0.6-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 2a4928801bbd7d7419682b9ee97002eb371eb1764fa7d9d945d1ee49bd5b7fd5
MD5 ab04eb6fa71236e06857c7d400f9f9e4
BLAKE2b-256 453240fcd7b2b568e33caee6bc3cc36c3c978079ee1c3fbb914d560150e64856

See more details on using hashes here.

File details

Details for the file gomea-1.0.6-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for gomea-1.0.6-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 4311bc3a768bfbdc010e097f9bb223cfeec22ed887519ca3777408ef6b141347
MD5 9b95a52d4ce4cfd69ab027a8e03768b0
BLAKE2b-256 37397aff68f4ab29e9b1a31cfa1bb59b8fd307844668113753917584755ddafb

See more details on using hashes here.

File details

Details for the file gomea-1.0.6-cp39-cp39-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for gomea-1.0.6-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 36b81e0441b8281860a600182d5f58756477c9d4a1c8171a37439f9a37e7ba48
MD5 a625ebadb0c0d0e6415602ee7f55dfae
BLAKE2b-256 9bcae6b5ba72890eb82ca59c85e55e8bb7caae13d2b010f660ad7951c55fabd1

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