examples.wobbly_function package

Submodules

examples.wobbly_function.analyse_function_output module

Concatenate last rows of .csv files under output/ into one file:

csv_output.csv.

examples.wobbly_function.example_wobbly_bayesian module

This module demonstrates the process for a blackbox bayesian optimization using the Yotse framework.

examples.wobbly_function.example_wobbly_bayesian.main() None[source]

Executes a blackbox optimization experiment for a ‘wobbly function’ of unknown form (at least we pretend to not know for the purpose of this example).

This function first adds the bayesian optimization information, sets it to active and finally runs the optimization.

Note: in the current setting we are by default giving the initial datapoints of the experiment to the optimization. So the first step will execute multiple instances of the optimization while subsequent steps will execute a single point suggested by the optimization algorithm.

examples.wobbly_function.example_wobbly_main module

This module sets up and executes an optimization experiment using the Yotse framework, specifically designed to optimize a ‘wobbly function’.

It leverages genetic algorithms for the optimization process, handles file management, and cleans up after execution, showcasing a very basic use-case.

examples.wobbly_function.example_wobbly_main.ackley_function_2d(x: ndarray, *args: Any) float[source]

Returns function value of the 2d ackley function.

examples.wobbly_function.example_wobbly_main.main() None[source]

Main execution function that initializes the experiment and executes multiple different optimization steps consecutively.

First we perform a blackbox optimization using Genetic Algorithm that we then follow up by a whitebox optimization using Scipy Optimization. This is meant to demonstrate how to explore an unknown optimization problem and once an extrema has been found, exploit this using knowledge about the shape of the function around this point.

examples.wobbly_function.example_wobbly_main.remove_files_after_run() None[source]

Removes output directories and QCG temporary files after the optimization run.

examples.wobbly_function.example_wobbly_main.scipy_callback(intermediate_result: OptimizeResult) None[source]

SciPy callback for printing intermediate result.

examples.wobbly_function.example_wobbly_main.wobbly_pre() Experiment[source]

Configures and returns an experiment setup for optimizing a wobbly function.

Returns:

The configured Experiment object for the wobbly function optimization.

Return type:

Experiment

examples.wobbly_function.example_wobbly_resume module

This module demonstrates the process to stop an ongoing experiment and resume it using the Yotse framework.

It initializes the optimization process, runs for a few generations, and then showcases how to resume the process from where it left off.

examples.wobbly_function.example_wobbly_resume.main() None[source]

Executes the stopping and resuming of an optimization experiment for a ‘wobbly function’.

This function first runs a part of the optimization process, simulates a stop, and then resumes the optimization from the last saved state, finally cleaning up any residual files after completion.

examples.wobbly_function.example_wobbly_whitebox module

This module demonstrates the process for a whitebox optimization using the Yotse framework.

examples.wobbly_function.example_wobbly_whitebox.ackley_function_2d(x: ndarray, *args: Any) float[source]

Returns function value of the 2d ackley function.

examples.wobbly_function.example_wobbly_whitebox.main() None[source]

Executes a whitebox optimization experiment for a ‘wobbly function’ of known form (the 2d ackley function).

This function first adds the whitebox optimization information, sets it to active and finally runs the optimization.

examples.wobbly_function.wobbly_function module

Usage:

python3 function.py -filebasename <folder-to-store-output>/<somefilebasename> -x 3 -y 5.5

examples.wobbly_function.wobbly_function.ackley_function_2d(x: float, y: float) Any[source]

Returns function value of the 2d ackley function.

examples.wobbly_function.wobbly_function.function(x: float, y: float) Any[source]

Returns wobbly function value f(x,y) = (x^2 + y^2) + sin(x^2 + y^2).

Module contents