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.1.0.tar.gz (1.1 MB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

gomea-1.1.0-cp313-cp313-win_amd64.whl (479.6 kB view details)

Uploaded CPython 3.13Windows x86-64

gomea-1.1.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.2 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

gomea-1.1.0-cp313-cp313-macosx_11_0_arm64.whl (746.9 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

gomea-1.1.0-cp312-cp312-win_amd64.whl (480.8 kB view details)

Uploaded CPython 3.12Windows x86-64

gomea-1.1.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.2 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

gomea-1.1.0-cp312-cp312-macosx_11_0_arm64.whl (749.8 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

gomea-1.1.0-cp311-cp311-win_amd64.whl (486.5 kB view details)

Uploaded CPython 3.11Windows x86-64

gomea-1.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.2 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

gomea-1.1.0-cp311-cp311-macosx_11_0_arm64.whl (753.0 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

gomea-1.1.0-cp310-cp310-win_amd64.whl (486.1 kB view details)

Uploaded CPython 3.10Windows x86-64

gomea-1.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.2 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

gomea-1.1.0-cp310-cp310-macosx_11_0_arm64.whl (752.4 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

gomea-1.1.0-cp39-cp39-win_amd64.whl (488.9 kB view details)

Uploaded CPython 3.9Windows x86-64

gomea-1.1.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.2 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

gomea-1.1.0-cp39-cp39-macosx_11_0_arm64.whl (755.3 kB view details)

Uploaded CPython 3.9macOS 11.0+ ARM64

File details

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

File metadata

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

File hashes

Hashes for gomea-1.1.0.tar.gz
Algorithm Hash digest
SHA256 4b842a48d96ffdbf3b5fcc8987165fadcdc7fc7ac669707eb72cc0af2aa023b1
MD5 9ed5591ab204b4a91e952626461baa2e
BLAKE2b-256 2059eec21988849791c174c6acfb2f1c90582ee830bfbe9607c5893b6cdc5611

See more details on using hashes here.

File details

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

File metadata

  • Download URL: gomea-1.1.0-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 479.6 kB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for gomea-1.1.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 7063f83ee66b8beafd4d5da91fa050dd93fe7b95371b55fe61afe22d7ea0be2b
MD5 a125a8b50d170a5ee303a8b0beb903bf
BLAKE2b-256 dc16ae92e8f7a6f54ab064f22279f500c91d811d11fe9f3bf6f87ffffce74e49

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gomea-1.1.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 eb289f0b3520c41003d5ea8719fa1dd97822268048748b1fc12f7ae30772cf12
MD5 870754de56f23dc58856444d92deacb3
BLAKE2b-256 b3416d2be67b006e28fc6be3e31756eb5ba43acfecdf7ddaf23e523a2b0fb218

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gomea-1.1.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 42c2421040abf0d4483e0f86b0fb213e5310d29b5395f062a00883a45bb895cc
MD5 ac6639e6e07dc25dfe14a99bcfb3d765
BLAKE2b-256 e5861fd678d7a55fb8db9df83462581cce3d0ae4bbc3845badbd1494ff15de52

See more details on using hashes here.

File details

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

File metadata

  • Download URL: gomea-1.1.0-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 480.8 kB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for gomea-1.1.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 6a7340ac375a0fabbbc66c810a20590a12bd14ad5d8b50b58c14d9fdbe89406e
MD5 2a2aa1ca76682a8102cad161a7828b1a
BLAKE2b-256 687dbce6c4e3e49aaa9291c969350564b40f62db204d8327fe4095a6c1c1b49e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gomea-1.1.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 961b4a12db858999facfed5dc42a9538fe07858ec954a841053e1507abd922ba
MD5 181ac7bdd309173c78b55c2f569eb891
BLAKE2b-256 db02a271827b3589b7114eeff274ea24707e1dfbd7cba7c6030c3b2006dcb070

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gomea-1.1.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 8deff473c36b4b01ffdbae03de75af162ce9ebc2b3eed51347223d8d9bc555f5
MD5 f5b6f72c6fa65f226ca11386e6509596
BLAKE2b-256 19cbe7e3df4279bb63fe38361f5e16739da61cc6cc0061eda4b3f6fb73c0f9db

See more details on using hashes here.

File details

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

File metadata

  • Download URL: gomea-1.1.0-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 486.5 kB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for gomea-1.1.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 54b1281d6f748a3fca582e71908b9324d295d8ec9ea2f0f89794ae9218aceed5
MD5 3216d8e29575d61bfb501242d9cc59a0
BLAKE2b-256 f477a904889d6942b236a10e8d80482ef30910b034e3b5f3c62006aad4aa3a34

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gomea-1.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e499d75dc3cb0bb25287a91f88897853aafa44e74263aae451d94f94c2e4573d
MD5 110fa4a13d0143410a5b668ed7270361
BLAKE2b-256 7071e965af2f3d16716e141db30f625f1bab951a14cb9bda9af3dcb0975a65e5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gomea-1.1.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f9d35a7e860e5760eeb6260c9992d7268fe6e48b65c4f7db0d3ccd5c93ec7175
MD5 d03077132837ed9a4c57c599f239a31c
BLAKE2b-256 ef0b653bdb824a51b9df92de1be0c340d5c66f7f1c8ffda0ba41a2cb98810ae3

See more details on using hashes here.

File details

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

File metadata

  • Download URL: gomea-1.1.0-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 486.1 kB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for gomea-1.1.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 c6dd2ed25afee417f1a08f9e8b1cac12858c2a4fbc2be6b9c6ba324e85983c03
MD5 e752357894c9df7d6bd714536264aff9
BLAKE2b-256 6793820de5cf1eb75e133bb6068037443859d96795928ff9fd421e90badc27eb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gomea-1.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 0f0c1202f61ab6c091394b25c83ad208459976c6a1068647e24a0d25b8ff1342
MD5 6767c53eb71c61d49eeae1c4fdb08e99
BLAKE2b-256 9ed17e4e0835b60b60404c29df644f389240609f717e2f9702dbd804d7820d47

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gomea-1.1.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 168fda1bbccc457f756dc606370a15cbfd22dfacf6948e9775cabf56c647b4a2
MD5 5b711d7e70fb544e400e825c3bd9c339
BLAKE2b-256 eaf354d59fa92966f7aa7e8a8f86152397807e01cc66908481efd1d04d164f9b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: gomea-1.1.0-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 488.9 kB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for gomea-1.1.0-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 08ab02712f6bf239b25b0ff2290e7c5fae360c3dc0767a91534a286709825669
MD5 cdd31313f717b0a0b7e6a221dd78821e
BLAKE2b-256 478288ff24692f6e2f65fd184d0c4d4afbedc63d3308e153650ac10a68ef27d6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gomea-1.1.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 05007fc6198e9a41a6123263e6cd6bd7bc213e316243a8d903c25c1a3f4d9760
MD5 f52ad24f43f1f040ed9d0dec64a7d721
BLAKE2b-256 8cfa732a1ffb63b043379c8c3e77314acdbce046aabf13d32a94fc4f90e118fb

See more details on using hashes here.

File details

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

File metadata

  • Download URL: gomea-1.1.0-cp39-cp39-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 755.3 kB
  • Tags: CPython 3.9, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for gomea-1.1.0-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e7a89c56b7a4ff1aed5e742a5c400e7df04e0273a32e4e55bce24b5883d3d11a
MD5 0adacd6da7d187c58c017dbbf11f15d4
BLAKE2b-256 d6420d1bb045dd728381d743d584ac1c558f599e8e6ebc3ec3ab6f07e9d3c60d

See more details on using hashes here.

Supported by

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