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

Uploaded Source

Built Distributions

gomea-1.0.5-cp313-cp313-win_amd64.whl (460.2 kB view details)

Uploaded CPython 3.13 Windows x86-64

gomea-1.0.5-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.5-cp313-cp313-macosx_11_0_arm64.whl (712.9 kB view details)

Uploaded CPython 3.13 macOS 11.0+ ARM64

gomea-1.0.5-cp312-cp312-win_amd64.whl (461.7 kB view details)

Uploaded CPython 3.12 Windows x86-64

gomea-1.0.5-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.5-cp312-cp312-macosx_11_0_arm64.whl (716.0 kB view details)

Uploaded CPython 3.12 macOS 11.0+ ARM64

gomea-1.0.5-cp311-cp311-win_amd64.whl (461.2 kB view details)

Uploaded CPython 3.11 Windows x86-64

gomea-1.0.5-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.5-cp311-cp311-macosx_11_0_arm64.whl (716.0 kB view details)

Uploaded CPython 3.11 macOS 11.0+ ARM64

gomea-1.0.5-cp310-cp310-win_amd64.whl (460.0 kB view details)

Uploaded CPython 3.10 Windows x86-64

gomea-1.0.5-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.5-cp310-cp310-macosx_11_0_arm64.whl (715.4 kB view details)

Uploaded CPython 3.10 macOS 11.0+ ARM64

gomea-1.0.5-cp39-cp39-win_amd64.whl (462.9 kB view details)

Uploaded CPython 3.9 Windows x86-64

gomea-1.0.5-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.5-cp39-cp39-macosx_11_0_arm64.whl (718.1 kB view details)

Uploaded CPython 3.9 macOS 11.0+ ARM64

File details

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

File metadata

  • Download URL: gomea-1.0.5.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.5.tar.gz
Algorithm Hash digest
SHA256 91fc4f6d35425e2431bdffb9832e6412b41683f7dba6b3ad850d7af6d6e2581d
MD5 2e918b7ac5a026a7f85582e6580c7b56
BLAKE2b-256 33fc8573f056d6e4cbc2a9580d9337157fcea49f8f29a9e45744233b6afc0137

See more details on using hashes here.

File details

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

File metadata

  • Download URL: gomea-1.0.5-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 460.2 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.5-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 7f50c3231a7485024140197f537d8bcd0e66169479d168655d92bc6e91aece4c
MD5 6accd706e3ac18008fe37db7f3237a57
BLAKE2b-256 4ef2763f9d5fb996144fb17d65f583ed0872ccba2367ef0efbb16608479dd4c4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gomea-1.0.5-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 20f6d0be80c17422c51cf826827eef050d1305a38b91890aef3916f04eb6d86e
MD5 ca93d1fa6a2728a7b1a50d4474e398ed
BLAKE2b-256 3137d9fd5fa5f2ac0ba67dd2b85a1690dc9a422d4060064e616426b6db98260e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gomea-1.0.5-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 fa321527e3039d7d01f7a4c0ac07de22e667ac108d3a2a531b875e054752280f
MD5 b186246f8727afd4ad2952af34f9e6ec
BLAKE2b-256 87c4a5c6d99aee81dda0e420544a9ba4bee89c3caeb436bd40ea307780869453

See more details on using hashes here.

File details

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

File metadata

  • Download URL: gomea-1.0.5-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 461.7 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.5-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 95b9766d23d0ff492c8bc6d3d84c3dca99bf2e08b128ed8548dd36a00746eec8
MD5 3be63f61a4a8db174264ce8f5fb6e757
BLAKE2b-256 eac324f85a06ed83a01032140a2b642e2e91a10470be49a54bb7a1f49882a5a4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gomea-1.0.5-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 bb5ec84c2345d56c9571ed3234f34677fcccfb5aa0d9df0889af04c522214c8f
MD5 d13c282eeb354410ee2eab0ebe3a10f7
BLAKE2b-256 4b116b75628a31f2f76dd3325000148d20759e446a2957ad81722d14bd68461c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gomea-1.0.5-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 4618cf9b77c227585a92cbb7adfda70768c3fb3fd4a81965e076948546110d40
MD5 0891b65b80fb2e8627c57f476f0d4f61
BLAKE2b-256 79b1045682383d1c604939a4ae07939c9f901ddb49c41047631b6c44c233a2f6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: gomea-1.0.5-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 461.2 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.5-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 08f9f1a4cbe8b4b23e08b69444f9ce8ac7a0b42853814d9c207f7fe46da3c814
MD5 50242825c4a24079ac089d11e447a406
BLAKE2b-256 604bbb5ef10e569591f3007b71a1d57398d65be706f6aa01c3b65cccd27b4272

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gomea-1.0.5-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 026c6ce1321cc0cf8d6edbe9fb34298588749f2490acdef2e9a5dfacde76525a
MD5 c5332bfaadfb9fb3ec377c781fef8523
BLAKE2b-256 8d1f8b81521b4b2a180ea984483266ad5ec0ae66c8c199aa712836e35aa4f8eb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gomea-1.0.5-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 d0e4dfe79c588e7405f3258ce6cd2fb9e93607873b1b37447257e564342dcff0
MD5 eab01e5aec3b4059f9503e2f801f6fe5
BLAKE2b-256 c1dda8fa68fda056490131eddb5ae21d19d557c7cc87e72a4de8dd84e6e13790

See more details on using hashes here.

File details

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

File metadata

  • Download URL: gomea-1.0.5-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 460.0 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.5-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 03e7f68459b8cab00a1f71af1f75744deb269df7ef5eaf2db9519fc7c808823b
MD5 dfb503afe495628553a1ded8d5dd4667
BLAKE2b-256 1faf1fd4e4c71bb3a25cbc716f13b9342c237f8b7724b683f133252cae243eaa

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gomea-1.0.5-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 4afb78aef30e206be6d7ab0a4b676ef8b57bed61eccc88e1091af0f6f67bb293
MD5 0775dcfcc94e63e65db39c0f51334c2a
BLAKE2b-256 c84c6a5897a63e7a0fff2b021ecdaa8ab08f4a8c216345abe906e8b7136632cb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gomea-1.0.5-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 2d738ca32c67399fc02bf4ee2592d7c68208e533c46b80c1cc79c04a08c7dc38
MD5 f4990b2bd77190a85103629c02986d2b
BLAKE2b-256 b9a537c4d0415c96917ef39a25a002d46d12f35cd2ea1a5bd9915001708d9da6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: gomea-1.0.5-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 462.9 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.5-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 43c7464374eab53776de629f849aca4f7f6ff1cb92377f5f9b456fea38e12b12
MD5 7234893ef6aa432da8f0ece639f3f762
BLAKE2b-256 fbc9611c320e818ce508753444145a993e6d600275fd2786f4b759ca8c046f80

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gomea-1.0.5-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 4aecafdc87bcb32c727ba0511fcc5ac0f16e712a58a78fe2c099b381dd2ac5d0
MD5 6c0e427218c1fd636f7c7bd8da4f08ea
BLAKE2b-256 b264fc717a4cb9bc2418b3c04614640fe9a8a1bf956844d6bb311d1099ce1845

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gomea-1.0.5-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 0aca24d9f19bea8714c1c2d192f9b0a063f6b9a120302eeb66c7acc9d2382ad6
MD5 04109270113099cb39e6c6934650fe56
BLAKE2b-256 97d215a6d78d938f4c6912f782cb0ba2b56d376e24cf872c5b2f13af8540aab5

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