Skip to main content

The Versatile Optimiser (VerOpt)

Project description

VerOpt - the versatile optimiser

VerOpt is a Python package that aims to make Bayesian Optimisation easy to approach, inspect and adjust. It was developed for the Versatile Ocean Simulator (VEROS) with the aim of providing a user-friendly optimisation tool to tune ocean simulations to real world data.

VerOpt can be used with any optimisation problem but has been developed for expensive optimisation problems with a small amount of evaluations (~100) and will probably be most relevant in such a context.

For more information about the package and the methods implemented in it, take a look at my thesis report.

Installation

To install veropt with the default dependencies and the package utilised by the GUI (PySide2), do the following:

pip install veropt[gui]

If you're installing veropt on a cluster and don't need the GUI you can simply do,

pip install veropt

Usage

Below is a simple example of running an optimisation problem with veropt.

from veropt import BayesOptimiser
from veropt.obj_funcs.test_functions import *
from veropt.gui import veropt_gui

n_init_points = 24
n_bayes_points = 64
n_evals_per_step = 4

obj_func = PredefinedTestFunction("Hartmann")


optimiser = BayesOptimiser(n_init_points, n_bayes_points, obj_func, n_evals_per_step=n_evals_per_step)

veropt_gui.run(optimiser)

This example utilises one of the predefined test objective functions found in veropt.obj_funcs.test_functions.

To use veropt with your own optimisation problem, you will need to create a class that uses the "ObjFunction" class from veropt/optimiser.py as a superclass. Your class must either include a method of running your objective function (YourClass.function()) or a method for both saving parameter values and loading new objective function values (YourClass.saver() and YourClass.loader()).

If you're using veropt with a veros simulation, take a look at veropt/obj_funcs/ocean_sims and the veros simulation examples under examples/ocean_examples.

The GUI and the Visualisation Tools

Screenshot 2025-03-03 at 17 13 53

After running the command,

veropt_gui.run(optimiser)

You should see a window like the one above. From here, you can show the progress of the optimisation, visualise the predictions of the GP model, change essential parameters of the model or acquisition function and much more.

If you press "Plot predictions" in the GUI, you will encounter a plot like the one below.

image

It shows a slice of the function domain, along the axis of a chosen optimisation parameter. You will be able to inspect the model, the acquisition function, as well as the suggested points for the next round of objective function evaluations. If any of this isn't as desired, you simply close the figure and go back to the GUI to modify the optimisation by changing the relevant parameters.

License

This project uses the GPLv3 license.

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

veropt-0.6.1.tar.gz (67.0 kB view details)

Uploaded Source

Built Distribution

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

veropt-0.6.1-py3-none-any.whl (69.8 kB view details)

Uploaded Python 3

File details

Details for the file veropt-0.6.1.tar.gz.

File metadata

  • Download URL: veropt-0.6.1.tar.gz
  • Upload date:
  • Size: 67.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for veropt-0.6.1.tar.gz
Algorithm Hash digest
SHA256 498112a5235aa3df2b7eb405412ccb08f5b851a398887f60c0c71dc472a60b61
MD5 77932ddce6d93b3dfb9db494b3438533
BLAKE2b-256 5dbadab10d23f5038efb9a234c35faa43330ee2f17b3bd74068a02f79bf45e5b

See more details on using hashes here.

Provenance

The following attestation bundles were made for veropt-0.6.1.tar.gz:

Publisher: python-publish.yml on aster-stoustrup/veropt

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file veropt-0.6.1-py3-none-any.whl.

File metadata

  • Download URL: veropt-0.6.1-py3-none-any.whl
  • Upload date:
  • Size: 69.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for veropt-0.6.1-py3-none-any.whl
Algorithm Hash digest
SHA256 21d2770f21c176220b9b67f90e5a36c70c561d6f843b18168cfc752e5aace261
MD5 b03c1acabf20782a7554f65f66eda8be
BLAKE2b-256 180ba7bbea373bdddd16fcd2a2dc535f9a77227b901df07fe3b6adb2888e808e

See more details on using hashes here.

Provenance

The following attestation bundles were made for veropt-0.6.1-py3-none-any.whl:

Publisher: python-publish.yml on aster-stoustrup/veropt

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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