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

Uploaded Source

Built Distributions

gomea-1.0.7-cp313-cp313-win_amd64.whl (468.4 kB view details)

Uploaded CPython 3.13 Windows x86-64

gomea-1.0.7-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.7-cp313-cp313-macosx_11_0_arm64.whl (727.0 kB view details)

Uploaded CPython 3.13 macOS 11.0+ ARM64

gomea-1.0.7-cp312-cp312-win_amd64.whl (470.1 kB view details)

Uploaded CPython 3.12 Windows x86-64

gomea-1.0.7-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.7-cp312-cp312-macosx_11_0_arm64.whl (730.4 kB view details)

Uploaded CPython 3.12 macOS 11.0+ ARM64

gomea-1.0.7-cp311-cp311-win_amd64.whl (468.7 kB view details)

Uploaded CPython 3.11 Windows x86-64

gomea-1.0.7-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.7-cp311-cp311-macosx_11_0_arm64.whl (730.1 kB view details)

Uploaded CPython 3.11 macOS 11.0+ ARM64

gomea-1.0.7-cp310-cp310-win_amd64.whl (467.4 kB view details)

Uploaded CPython 3.10 Windows x86-64

gomea-1.0.7-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.7-cp310-cp310-macosx_11_0_arm64.whl (729.3 kB view details)

Uploaded CPython 3.10 macOS 11.0+ ARM64

gomea-1.0.7-cp39-cp39-win_amd64.whl (470.2 kB view details)

Uploaded CPython 3.9 Windows x86-64

gomea-1.0.7-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.7-cp39-cp39-macosx_11_0_arm64.whl (732.6 kB view details)

Uploaded CPython 3.9 macOS 11.0+ ARM64

File details

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

File metadata

  • Download URL: gomea-1.0.7.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.7.tar.gz
Algorithm Hash digest
SHA256 d94cd6a90d34425ab8a5c4e9a6711ea6213ce47d8e0fbe507c5da99ec7e8ffa1
MD5 539361efb90386321c59e8cc3df60de9
BLAKE2b-256 0792582cb4c4729aa56ac7f13a6c5969b430628dee799f4d7da5a24c4e038a81

See more details on using hashes here.

File details

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

File metadata

  • Download URL: gomea-1.0.7-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 468.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.7-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 ad3a5d3025e197eca34773ce0c512257f89376e05fcecf1fe0d04acd33166a1f
MD5 9b52494b75360f1e09037777e0a520d8
BLAKE2b-256 554f466277cba2527707925df3daea7976585e0ac2fe9e28de955f17db5c9a95

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gomea-1.0.7-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 cc742a39b598022a44c98ec369c995545266b31379ab66df7b4e582fa77d032d
MD5 6fecc561469457ebcffa56a75c009116
BLAKE2b-256 ea95cd97c30f301f19068fe84265092c2e6b3efff9ef2c1c44170271599cbfe8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gomea-1.0.7-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e6bc77847d40e790698a1fd5c6fa712a58237e0d35345f30358c23cdd2916379
MD5 6ebd22211e51cbe22ac7eb810fba9792
BLAKE2b-256 39340077af997cdcb85aba43d91c91dffb44acccd966ab6d3af89862ceb93ec7

See more details on using hashes here.

File details

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

File metadata

  • Download URL: gomea-1.0.7-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 470.1 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.7-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 af5902d1da7d076fcfa62c9486bee0ededd9e59ebbb6dddc04e776d5a12a0702
MD5 7748712cb9c3a31835eade7be9484411
BLAKE2b-256 5de7686c2a865a7e5f849cfc1bea9322a2c936148b1b8862c8ef03627a93cf78

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gomea-1.0.7-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 8f4eb34e02d7bfa6a8b0addeb8765df028302758a98c98c68438cb35ff36fc3a
MD5 9a00546510569096af0bf07da8371ee8
BLAKE2b-256 6540285ad90b9a0fb634346834d100c93c874785bd57dac5060ccac8c9cef467

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gomea-1.0.7-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 515bc1782c322241a559bf41d628497bacb6e9b7c1c7accf0bc25ae0b68b06fb
MD5 ee6e3569222f0db3ecfc22411ce8e757
BLAKE2b-256 862fa6b2a4e2648026a04a2a6f1b8f7db43d1c327b4b68ad9031304082d9b829

See more details on using hashes here.

File details

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

File metadata

  • Download URL: gomea-1.0.7-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 468.7 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.7-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 7248e895a8aa7f09159b258e4f654f6662548a35697dfd65b323828016f36daa
MD5 1d0d2f500a0008e0f9b4f731e8ce518a
BLAKE2b-256 568f65d47868417c8da106f436228a4a02d7d02501c87e26a2e79145a9585ebc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gomea-1.0.7-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 7f7f2ea2e4a3a589d7745a68fcaf1510547947a91615d35f47f043382c68fad6
MD5 70aefe1f6e71fbfda531c0f0cab67f85
BLAKE2b-256 16102bffb0b178212b12978931209ef5d88a0607a90ca62c56bd2e77224f2262

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gomea-1.0.7-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 edb6dc5cb9a6ea354a142edce8605430e41f05a586382b22617492eb6280f876
MD5 914dfa5ebe65a30b7f9355eb1e574082
BLAKE2b-256 a0b8372369daac656fe4e5e7350f06d2b7fe3dee79722a4ee16777f9f1c81e26

See more details on using hashes here.

File details

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

File metadata

  • Download URL: gomea-1.0.7-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 467.4 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.7-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 027a0fd98e0b39b2fa705f3524f106731ceee02e76b7c2dbcec279f11cdc90bb
MD5 e15d73c344fc32bf175e547ec24c8795
BLAKE2b-256 16560b86f7918363ba6e0840b6759216944bd4156d2cafe3707bf9c7b440044c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gomea-1.0.7-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 511bc7d13829048fa4cf4e65dd01f6436acd436bae2cc35d699070c10ad8d0f6
MD5 e9b51aafc1488d52014d3232a1783cfe
BLAKE2b-256 64f6db7643cb14a6a0179c9b09947c1d1890d3bffd4403bab05a1fa7d1b2c8d9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gomea-1.0.7-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 a2ba771fe315ee9fb785de98a1066f043b554651c5d0946b239ab26776ce65f2
MD5 dbe6f215df9fc1cf19e1a1d9fa346c88
BLAKE2b-256 c6ed1cd71ed18f17387ea7767699c24e4201412824cc6f7190d40ade3a6e191a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: gomea-1.0.7-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 470.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.7-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 8a0620ac98a0bcfe87d54547bce26718d41ecea023f42078af39cc7dcc1ee76f
MD5 a09748244d3986a4d5aa8e09a3c05620
BLAKE2b-256 fa4bef3f35050cda5b75286eebf0ecc6f7779f8ed8ee2cf1987414b87333d456

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gomea-1.0.7-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 64ce6c95bc13cb7f57bdbb67bb6a42f662c5a0e636c787b4c9d1e40e174249d1
MD5 adb9cc46faa235c745458fae9fc4e6b7
BLAKE2b-256 06ec6aceb046d7f5e8ba44cabb24d7591bf04ad2f8679176a5e7c084bc9d8d45

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gomea-1.0.7-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 5dd41b9b0b60daca1f8c0f04bd8c29420552f78b999327a3abea48931e9a6c72
MD5 a3ee86e82c30908cf6ea1ea76a6903c1
BLAKE2b-256 439709872cff298c20dc142e8dac4570380f25936b8034a8e9a7076f0e9c74cf

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