Skip to main content

Easily compare/benchmark optimizers on a custom or common objective.

Project description

OptiComp

Overview

OptiComp is a versatile library for comparing optimizers. It supports both built-in benchmark objectives and custom objectives. Users can compare various optimizers using provided wrappers or create their own. OptiComp streamlines finding the best optimizer for any task or an easy way to compare you optimizer against others.

Features

  • Unified API: Standardized optimizer API using common wrappers.
  • Standard Wrappers: Ready-to-use wrappers.
  • Custom Wrappers: Create your own wrappers any optimizer.
  • Standard Objectives: Ready-to-use objective to evaluate an optimizer on.
  • Custom Objectives: Create custom objectives to evaluate the optimizer on, allowing you to test optimizers on your project.
  • Optimizer Comparison: Compare different wrappers to find the most effective optimizer.
  • Best Optimizer Selection: Select the best wrapper for your objective with less computational overhead.
  • Direct Optimization: Run optimizations directly using the provided wrappers.

Installation

Install OptiComp via pip:

pip install opticomp

Usage

Benchmark Common Wrappers And Objectives:

Use the OptiComp build-in wrappers and objectives:

from opticomp import BenchmarkSuite, objective_zoo, wrapper_zoo

# Get common objective from objective_zoo
objective, search_space = objective_zoo.fetch_sphere_function()

# Create an instance of the benchmark suite
benchmark_suite = BenchmarkSuite(objective, search_space)

# Add wrappers directly from wrapper_zoo to the benchmark_suite
benchmark_suite.add_wrapper(wrapper_zoo.fetch_optuna_random())
benchmark_suite.add_wrapper(wrapper_zoo.fetch_optuna_tpe())
benchmark_suite.add_wrapper(wrapper_zoo.fetch_bayesian())

# Compare and optimize using the added wrappers
results = benchmark_suite.benchmark(direction="minimize", max_steps=100, target_score=200, verbose=True, progress_bar=True)

For more specific examples, such as creating custom objectives or wrappers, please visit the Wiki


Results

After running the library, you can expect the following information in the results:

  • Steps Taken: Number of iterations or steps taken during the benchmarking.
  • Elapsed Time: Total time taken for the algorithm to complete its task.
  • Best Score: The score, or evaluation result after completing the benchmark.
  • Best Params: Best parameters during benchmarking.
  • Score history: A list with the score for every step taken. This can be visualised as shown below.
  • CPU and RAM history: A list with the CPU and RAM usage during each step. This can be used to get the average or peaks.

Methods to visualise results

alt text

These results provide insights into the performance and outcomes of each optimizer, enabling easy comparison between them.
For more information, please visit the results section in the wiki.


Contributing

Contributions are welcome! Whether you're reporting a bug, suggesting a feature, or contributing code or wrappers, your help is appreciated. Please feel free to submit a pull request or open an issue to improve OptiComp. For more information, head to the contributions section in the wiki.


Documentation

For more detailed documentation and examples, please refer to the Wiki section of the GitHub repository.

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

opticomp-0.2.0.tar.gz (9.6 kB view details)

Uploaded Source

Built Distribution

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

OptiComp-0.2.0-py3-none-any.whl (15.3 kB view details)

Uploaded Python 3

File details

Details for the file opticomp-0.2.0.tar.gz.

File metadata

  • Download URL: opticomp-0.2.0.tar.gz
  • Upload date:
  • Size: 9.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.9.19

File hashes

Hashes for opticomp-0.2.0.tar.gz
Algorithm Hash digest
SHA256 8a5e516a1c9ba145dc8a03a6fa9f9f73ae4021f8481bd3d99387c6baf279d817
MD5 cfe4da6a8a55791d70d1fe30d37bc2cb
BLAKE2b-256 d17ee9c37e667ae5fe5e6de27d20d8a2deafe3b2338087e61d3e98a6fc535f92

See more details on using hashes here.

File details

Details for the file OptiComp-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: OptiComp-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 15.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.9.19

File hashes

Hashes for OptiComp-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 44cca78cf6799af68ee1fb8df412156a729b2a17f41e76619391cfbe94a55210
MD5 ffdd9b1a66d75bd519a928c2aa503b60
BLAKE2b-256 89231be1349d13b24c020e847e14fed09d33a7894a452b67f37e4a5b64e922fb

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