1. Parameter Study Using the Grid Iterator#
Introduction to QUEENS#
QUEENS is a versatile software framework offering a wide range of cutting-edge algorithms for deterministic and probabilistic analyses, including parameter studies, sensitivity analysis, surrogate modeling, uncertainty quantification, and Bayesian inverse analysis. Built with a modular architecture, QUEENS enables efficient parallel queries of large-scale computational models, robust handling of data and resources, seamless switching between analysis types, and smooth scalability from laptops to high-performance computing clusters. To learn more, visit the QUEENS website, explore the source code on GitHub, or check out the documentation.
Overview#
Over the course of the four tutorials you will learn * how to use QUEENS: the general structure of a QUEENS script, a short Python script used to define and run experiments with QUEENS * how to conduct various analysis types with QUEENS, including parameter studies, optimization, and uncertainty quantification * how to run analyses with different models from analytical test functions to advanced numerical solvers like the 4C multiphysics framework
Tutorial: analysis of the Rosenbrock function#
In this tutorial, you will learn how to translate your planned multi-query analysis into a QUEENS experiment in the form of a Python script. The structure of these scripts is always similar, where the common feature of a multi-query analysis is that you want to evaluate a single computational model at many different input locations. Thus, the main ingredients you need to define for your experiment are: * the model * the analysis method (defines the input points where to evaluate the model) * the compute resource to evaluate the model
Content#
The example analyses we want to conduct in this tutorial is the following: 1. visualise the Rosenbrock function. 2. find the minimum of the Rosenbrock function.
Task: Run the following code cell.#
You don’t need to understand the code but you should run it once in order to setup the logging feature of QUEENS correctly for Jupyter notebooks.
[1]:
# Suppress excessive logging output
import logging
import os
import numpy as np
import plotly.graph_objects as go
from plotly.subplots import make_subplots
# logging.basicConfig(level=logging.INFO, format='%(message)s')
os.environ["DASK_DISTRIBUTED__LOGGING__DISTRIBUTED"] = "CRITICAL"
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
logging.getLogger("distributed").setLevel(level=logging.CRITICAL)
def visualize_grid_and_surface(X1, X2, Z, min_point=None):
"""Visualize grid and surface with optional minimum point.
Parameters
_________
X1, X2 : 2D arrays
Meshgrid arrays for x and y.
Z : 2D array
Function values f(X1, X2).
min_point : tuple (x, y, z) or None
If provided, highlights this point with a big red cross
in both plots.
"""
fig = make_subplots(
rows=1,
cols=2,
specs=[[{"type": "scene"}, {"type": "scene"}]],
subplot_titles=("3D Scatter colored by z", "Surface + grid points (z=0 plane)"),
)
# ___ Left: 3D scatter (share colorscale, no colorbar) ___
fig.add_trace(
go.Scatter3d(
x=X1.flatten(),
y=X2.flatten(),
z=Z.flatten(),
mode="markers",
marker=dict(
size=3,
color=Z.flatten(),
colorscale="Viridis",
showscale=False, # no duplicate colorbar
),
showlegend=False,
),
row=1,
col=1,
)
# ___ Right: Surface (with single colorbar) ___
fig.add_trace(
go.Surface(
x=X1,
y=X2,
z=Z,
colorscale="Viridis",
colorbar=dict(
title="f(x1,x2)",
x=1.05, # push colorbar outside plot area
len=0.75, # shorten to avoid overlapping legend
),
),
row=1,
col=2,
)
# ___ Right: black grid points on x-y plane (z=0) ___
fig.add_trace(
go.Scatter3d(
x=X1.flatten(),
y=X2.flatten(),
z=np.zeros_like(Z).flatten(),
mode="markers",
marker=dict(size=2, color="black"),
showlegend=False,
),
row=1,
col=2,
)
# ___ Highlight user-provided minimum point ___
if min_point is not None:
min_x, min_y, min_z = min_point
for col in [1, 2]:
fig.add_trace(
go.Scatter3d(
x=[min_x],
y=[min_y],
z=[min_z],
mode="markers",
marker=dict(size=5, color="red"),
name="Minimum",
),
row=1,
col=col,
)
# Layout / axes
fig.update_layout(
title="3D Scatter vs. Surface with Grid Projection",
height=500,
legend=dict(
x=0.95, y=0.9, bgcolor="rgba(255,255,255,0.6)" # move legend away from colorbar
),
scene=dict(xaxis_title="x1", yaxis_title="x2", zaxis_title="f(x1,x2)", aspectmode="cube"),
scene2=dict(xaxis_title="x1", yaxis_title="x2", zaxis_title="f(x1,x2)", aspectmode="cube"),
)
fig.show()
Model Setup#
We begin by setting up our model. Here, we want to implement the (two-dimensional) Rosenbrock function.
The Rosenbrock function is a classic test problem in optimization, defined as
$ f(x_1, x_2) = (a - x_1)^2 + b , (x_2 - x_12)2 , $
where typically its parameters are $ a = 1, :nbsphinx-math:`quad `b = 100 . $
As we will see this function is non-convex and features a narrow, curved valley, making it a challenging benchmark for optimization algorithms.
Task: Implement the Rosenbrock function as a Python function that takes two arguments \(x_1\) and \(x_2\).#
[2]:
def rosenbrock(x1, x2):
a = 1
b = 100
f = (a - x1) **2 + b* (x2 - x1 **2)**2
return f
Visualising is a multi-query analysis task#
To visualise the Rosenbrock function as a 3D surface, we need to evaluate it on a grid (or mesh) of points. This is a multi-query scenario because creating a surface plot requires computing the function value at many different input locations across the domain. With such an analytical model, this is straightforward—and you may already be familiar with doing this. Nevertheless, let’s break it down step by step to see clearly how the process works.
Generate mesh points with NumPy#
To generate a regular mesh in NumPy, you can use numpy.linspace to create evenly spaced points along each axis and then pass these arrays to numpy.meshgrid, which combines them into two 2D arrays representing all coordinate pairs. This allows you to build a full rectangular grid of points, which can be used to evaluate functions across the domain.
Task: Create evenly spaced points#
Create \(10\) points per parameter on the following intervall \(x_1 \in [-2.0, 2.0]\) and $ x_2 :nbsphinx-math:`in [-3.0, 3.0]`$.
For example,
np.linspace(-2, 2, 5)gives five points between −2 and 2.
[3]:
import numpy as np
# Create grid
x1 = np.linspace(-2.0, 2.0, 10)
x2 = np.linspace(-3.0, 3.0, 10)
X1, X2 = np.meshgrid(x1, x2)
Evaluate the Model#
So far, we have: 1. Defined our model (the Rosenbrock function). 2. Built a grid of input points \((x_1, x_2)\) using numpy.linspace and numpy.meshgrid.
The next step is to evaluate the model at every point of the grid. This means: for each coordinate pair \((x_1, x_2)\), we want to compute the function value \(f(x_1, x_2)\).
For our function, we can directly exploit the vectorization feature of NumPy and run the following code. In short: this line evaluates the Rosenbrock function at all grid points in one shot, turning our mesh of input coordinates into a mesh of output values.
[4]:
# Evaluate function on grid
Z = rosenbrock(X1, X2)
Visualise the Rosenbrock function#
The following code block introduces a function to visualise the grid points as well as the function values of the Rosenbrock function. We introduce the function in a separate file visualize_grid_and_surface.py to keep this notebook lean. We will reuse the visualisation function several times, but you don’t need to go through the lines in detail.
Running the next cell, you will see: * On the left, a scatter plot of all grid points in 3D space, colored by their function values. * On the right, the characteristic banana-shaped valley of the Rosenbrock function shown as a smooth surface, with the grid points projected onto the base plane for reference.
[5]:
visualize_grid_and_surface(X1, X2, Z)
Congratulations, you have finished your first multi-query analysis!#
The direct NumPy approach works perfectly for simple analytical functions, but it quickly becomes impractical for complex computational models—such as those involving Finite-Element solvers—where each evaluation is computationally expensive. In these cases, vectorized evaluation is no longer possible. Instead, we view the task as an embarrassingly parallel problem: each input point can be evaluated independently of the others.
This is exactly where QUEENS comes into play. It provides the parallelization and workflow management needed to move from simple Python functions to large-scale simulations. Under the hood, QUEENS applies the same core principle you just saw with NumPy—evaluating the model at many input points—but in a way that is scalable, robust, and designed for demanding computational models.
Visualise the Rosenbrock function with QUEENS#
We will now redo the multi-query task of visualising the Rosenbrock function using QUEENS. This helps you learn the structure of a QUEENS experiment on a very simple setup. The structure will remain the same later on, e.g., when we find the minimum of the Rosenbrock function with QUEENS. For a simple analytic model, this may feel like overhead, but it pays off as soon as you switch to another analysis method with the same model (a key feature of QUEENS) or when the model becomes more complex and computationally demanding.
Note that the approach shown here works with any Python function that encodes your model of interest. If you already have functions from your research or application, it’s straightforward to make them work with QUEENS: write a thin wrapper that exposes exactly the input parameters you want to vary. For example, you might keep a general Rosenbrock implementation with parameters a and b, and provide a small wrapper that fixes a and b while varying only x1 and x2. This
pattern generalizes to more sophisticated models, enabling you to reuse the same QUEENS experiment structure across different analyses.
Global settings for a QUEENS experiment: name and output directory#
Every QUEENS experiment starts by defining the name of the experiment (which automatically created files and directories will be named after) and output directory (where the QUEENS output file will be placed).
Task: define a variable experiment_name to label your QUEENS run.#
This name will be used automatically for generated output files and folders, so choosing something sensible makes it much easier to identify your results later.
Important general note: if another experiment with the same name already exists, existing data will potentially be overwritten. To avoid this, you can change the experiment name.
Your experiment name should follow a few simple rules (similar to naming files or directories in Linux): * Use a short, descriptive string that helps you remember what the experiment did. * Avoid spaces — use underscores _ instead. * Do not begin with a number. * Do not use special characters. * Keep it concise but meaningful.
Examples#
Good names#
grid_iterator_rosenbrock
rosenbrock_grid
optimize_rosenbrock
grid_test_x1x2
sensitivity_analysis_demo
Bad names#
1st_experiment → starts with a number
grid iterator rosenbrock → contains spaces
this_is_a_very_long_and_confusing_name_for_experiment → too long
test!rosenbrock → contains special characters
Output directory#
You don’t need to change the output_dir variable here — by default, we will write results into the current directory of this notebook.
If you do decide to set a different path, make sure the directory already exists, as QUEENS requires the output directory to be created beforehand.
Global Settings#
In the code block, we also create a GlobalSettings object, which gathers the general information about the QUEENS experiment. This ensures that the correct values (such as experiment name, output directory, and debug settings) are consistently used throughout the workflow. Later on, GlobalSettings will also act as a Python context manager, making sure that everything is properly set up and cleaned up when running the experiment.
[6]:
from queens.global_settings import GlobalSettings
# Define name of QUEENS experiment and directory for output
experiment_name = "grid_iterator_rosenbrock"
output_dir = "./"
# Global settings
global_settings = GlobalSettings(
experiment_name=experiment_name, output_dir=output_dir, debug=False
)
QUEENS Model Setup#
We can reuse our implementation of the Rosenbrock function from above. However, QUEENS needs additional information about the input parameters \(x_1, x_2\). In particular, QUEENS must know:
The name of the parameter (e.g.,
x1,x2)The type of the parameter (deterministic variable, random variable, or random field)
Its dimensionality (scalar or vector-valued)
Its distribution (e.g., uniform, normal) and associated properties (bounds, mean, variance, etc.)
…
Only with this information can QUEENS properly treat the parameters, generate samples, and propagate them through the Rosenbrock function.
Model Parameters#
Again, we restrict the two parameters to certain regions:
\(x_1 \in [-2.0, 2.0]\)
\(x_2 \in [-3.0, 3.0]\)
Such restrictions can be expressed in QUEENS by using the Uniform parameter type, which has a lower and an upper bound.
Task: Create a Uniform object for the input $ x_2 :nbsphinx-math:`in [-3.0, 3.0]`$#
Hint: the first parameter is already defined, you only need to add the second one.
Finally, all parameter definitions are collected into a Parameters object. This container keeps track of all variable namesx and their properties. Most importantly, it allows creating samples from the input space according to its properties.
Task: Add the second input \(x_2\) as a keyword argument to the Parameters object.#
The first parameter x1 has already been defined for you. Now we add x2 to the Parameters object.
Important: Make sure to use the correct variable name as the keyword, in this case
x2(see definition of the Rosenbrock Python function). Specifically, if your function has the following signature:def f(x1, x2, my_parameter, ...): ...then you must define the parameters object like this:
Parameters(x1=..., x2=..., my_parameter=..., ...)
[7]:
from queens.distributions import Uniform
from queens.parameters import Parameters
# Model parameters
x1 = Uniform(lower_bound=-2.0, upper_bound=2.0)
x2 = Uniform(lower_bound=-3.0, upper_bound=3.0)
parameters = Parameters(x1=x1, x2=x2)
+---------------------------------------------------------------------------------------------------+
| Uniform |
|- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
| self : <queens.distributions.uniform.Uniform object at 0x7f42f4328510> |
| lower_bound : -2.0 |
| upper_bound : 2.0 |
+---------------------------------------------------------------------------------------------------+
+---------------------------------------------------------------------------------------------------+
| Uniform |
|- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
| self : <queens.distributions.uniform.Uniform object at 0x7f42c867e650> |
| lower_bound : -3.0 |
| upper_bound : 3.0 |
+---------------------------------------------------------------------------------------------------+
+---------------------------------------------------------------------------------------------------+
| Parameters |
|- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
| self : <queens.parameters.parameters.Parameters object at 0x7f42c3f0cf90> |
| x1 : <queens.distributions.uniform.Uniform object at 0x7f42f4328510> |
| x2 : <queens.distributions.uniform.Uniform object at 0x7f42c867e650> |
+---------------------------------------------------------------------------------------------------+
At this point, the parameters object contains both \(x_1\) and \(x_2\), each with their respective domains, and is ready to be used for building the QUEENS model.
In order to finalize the QUEENS model, we still require multiple things: 1. A scheduler. It requests the compute resource and manages the execution of your model on that compute.
For this tutorial, we choose a `Local` dask scheduler with a single worker. So your model is evaluated on the local machine. With the `num_jobs` parameter, you can choose the number of parallel model evaluations.
A
driver. This object coordinates the evaluation of the forward model itself.The
Functiondriver can be used to evaluate any Python function with QUEENS. Note that it takes both theparametersobject as well as the callable Python functionrosenbrockas inputs. In setting up theparametersandfunctionit is important the arguments have the same keywords. In our caseparameterswas created withx1andx2keyword arguments and therosenbrockfunctione expects exactly two argument with the same name. > Background: we are exploiting that we can always call a positional argument as keyword arguments in Python.And finally, a QUEENS
model, which takes both adriver(model evaluation routine) and ascheduler(compute resource).The
Simulationmodel is the standard type of model in QUEENS. The fact that it takes both aschedulerand adriverreflects that in QUEENS a model always combines both the instruction of how to evaluate (driver) as well as the compute resources to actually execute and manage the evaluation (scheduler).
Task: Run the following code cell to define a QUEENS model for the subsequent analyses.#
[8]:
from queens.drivers import Function
from queens.models.simulation import Simulation
from queens.schedulers import Local
#### Model setup ####
scheduler = Local(global_settings.experiment_name, num_jobs=1)
driver = Function(parameters=parameters, function=rosenbrock)
model = Simulation(scheduler, driver)
+---------------------------------------------------------------------------------------------------+
| Local |
|- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
| self : <queens.schedulers.local.Local object at 0x7f42cb9d0f50> |
| experiment_name : 'grid_iterator_rosenbrock' |
| num_jobs : 1 |
| num_procs : 1 |
| restart_workers : False |
| verbose : True |
| experiment_base_dir : None |
| overwrite_existing_experiment : False |
+---------------------------------------------------------------------------------------------------+
To view the Dask dashboard open this link in your browser: http://127.0.0.1:8787/status
+------------------------------------------------------------------------------------------------------+
| Function |
|- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
| self : <queens.drivers.function.Function object at 0x7f42c3a5b910> |
| parameters : <queens.parameters.parameters.Parameters object at 0x7f42c3f0cf90> |
| function : <function rosenbrock at 0x7f43102a6660> |
| external_python_module_function : None |
+------------------------------------------------------------------------------------------------------+
+---------------------------------------------------------------------------------------------------+
| Simulation |
|- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
| self : <queens.models.simulation.Simulation object at 0x7f42c1c997d0> |
| scheduler : <queens.schedulers.local.Local object at 0x7f42cb9d0f50> |
| driver : <queens.drivers.function.Function object at 0x7f42c3a5b910> |
+---------------------------------------------------------------------------------------------------+
Analysis method: Grid (visualizing Rosenbrock as a 3D surface)#
To visualize the Rosenbrock function, we will evaluate it on a grid of points inside the domain specified by our Parameters object. In QUEENS, an iterator is responsible for generating the input points for multi-query analyses. Here we will use the Grid iterator, which lays out points on a mesh over the ranges of the parameters. It can generate rectilinear grids on both linear and logarithmic scales.
Key idea: - The iterator chooses where to evaluate the model.
Defining the grid design for the Grid iterator#
Grid iterator in QUEENS requires a grid layout/resolution for each parameter: - ``num_grid_points``: how many grid points to generate in this dimension"lin" for linear, "log10" for logarithmic)FLOAT)For example:
{"x1": {"num_grid_points": 5, "axis_type": "lin", "data_type": "FLOAT"}}
means: generate 5 grid points, linearly spaced, for a float-valued parameter x1.
Task: Extend the grid design to include x2#
We want to evaluate x2 at 10 points on a linear scale, also as a FLOAT.
[9]:
grid_design = {
"x1": {"num_grid_points": 10, "axis_type": "lin", "data_type": "FLOAT"},
"x2": {"num_grid_points": 10, "axis_type": "lin", "data_type": "FLOAT"},
}
Define the iterator object#
Every iterator in QUEENS requires some common arguments regardless of its type:
``model``: the QUEENS model to work with (here, the Rosenbrock model)
``parameters``: the
Parametersobject defining the variable input parameters``global_settings``: general settings of the experiment, including the experiment name and output directory
``result_description``: whether to write result files and what details to include
[10]:
from queens.iterators.grid import Grid
# The method of the analysis is defined by the iterator type:
grid = Grid(
grid_design=grid_design,
model=model,
parameters=parameters,
global_settings=global_settings,
result_description={"write_results": True},
)
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Grid |
|- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
| self : <queens.iterators.grid.Grid object at 0x7f42a6185110> |
| model : <queens.models.simulation.Simulation object at 0x7f42c1c997d0> |
| parameters : <queens.parameters.parameters.Parameters object at 0x7f42c3f0cf90> |
| global_settings : <queens.global_settings.GlobalSettings object at 0x7f43087e56d0> |
| result_description : {'write_results': True} |
| grid_design : {'x1': {'num_grid_points': 10, 'axis_type': 'lin', 'data_type': 'FLOAT'}, 'x2': {'num_grid_points': 10, 'axis_type': 'lin', 'data_type': 'FLOAT'}} |
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
Running the experiment#
Grid iterator, we can finally run the experiment.Task: Run your QUEENS experiment#
Note: You might have to restart the Jupyter kernel to rerun the experiment!
[11]:
from queens.main import run_iterator
from queens.utils.io import load_result
with global_settings:
#### Analysis ####
run_iterator(grid, global_settings=global_settings)
.**.
I I
* *
:. .:
I I
::: .* *. :*:
I * *. .* * I
.: *:*:::: I I ::::*:* :.
:: :I: ::.* *.:: :I: ::
:. * *: .V. .V. :* * .:
:. I :: I*. *I :: I .*
*. :: .* :: :: :* :: *: :* .*
*. I * I :**: I * I .*
*.:. I* ** *I .:.*
*:I :*.* :: *: *.*: I.*
*I: :* .** *I. *: :**
*V *. .*. *II* .*. .* V*
** ..:*I***I*:::: ::::*I***I*:.. **
...... ......
:*IV$$$V*: VV: *VV VVVVVVVVVVVF *VVVVVVVVVVV. .VF. :VI :FV$$$V*:
*$$*:. .:*V$* $$: *$V $$*......... *$I......... .$$$* *$V V$F. .:FV.
V$* *$$. $$: *$V $$: *$F .$$F$V. *$V .$$.
V$F *$V $$: *$V $$: *$I .$$ .V$* *$V F$$*:.
$$: :$$ $$: *$V $$$VVVVVVVV *$$VVVVVVVV: .$$ *$V. *$V .*FV$$V*.
I$F ** *$V $$: *$V $$: *$F .$$ .I$* *$V .*$$*
V$* :V$F$$. I$F V$* $$: *$F .$$ :$$I$V *$$
*$$*:. .:*$$$F F$V*....*V$* $$*......... *$I......... .$$ F$$V V$*: .:V$*
:*IV$$VI*: :I: .*FVVVVF: VVVVVVVVVVVV *VVVVVVVVVVV. .VV :VI :*VV$$VI*.
QUEENS (Quantification of Uncertain Effects in ENgineering Systems):
a Python framework for solver-independent multi-query
analyses of large-scale computational models.
+---------------------------------------------------------------------------------------------------+
| git information |
|- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
| commit hash : 4d6a1e5c2ce6849df397567c514614e5896a85ad |
| branch : main |
| clean working tree : False |
+---------------------------------------------------------------------------------------------------+
Grid for experiment: grid_iterator_rosenbrock
Starting Analysis...
90%|█████████ | 90/100 [00:00<00:00, 210.65it/s]
+---------------------------------------------------------------------------------------------------+
| Batch summary for jobs 0 - 99 |
|- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
| number of jobs : 100 |
| number of parallel jobs : 1 |
| number of procs : 1 |
| total elapsed time : 5.893e-01s |
| average time per parallel job : 5.893e-03s |
+---------------------------------------------------------------------------------------------------+
100%|██████████| 100/100 [00:00<00:00, 169.49it/s]
Time for CALCULATION: 0.6098134517669678 s
QUEENS output#
If activated in the result description, QUEENS output is written to a file called <experiment_name>.pickle in the directory defined by the argument output_dir of the global settings object: <output_dir>/<experiment_name>.pickle. In the output folder, you also get a log file that contains the console output. It is called <experiment_name>.log.
In the case of the grid iterator, you get a dictionary including the raw input-output data and some statistics.
[12]:
#### Load Results ####
result_file = global_settings.result_file(".pickle")
results = load_result(result_file)
results
[12]:
{'mean': array([840.88294467]),
'var': array([1172253.36025137]),
'raw_output_data': {'result': array([[4.90900000e+03],
[2.94390322e+03],
[1.79761332e+03],
[1.18919753e+03],
[9.31367322e+02],
[9.30478433e+02],
[1.18653086e+03],
[1.79316888e+03],
[2.93768099e+03],
[4.90100000e+03],
[4.02011111e+03],
[2.26571392e+03],
[1.27744871e+03],
[7.74382716e+02],
[5.69227404e+02],
[5.68338515e+02],
[7.71716049e+02],
[1.27300427e+03],
[2.25949169e+03],
[4.01211111e+03],
[3.22011111e+03],
[1.67641350e+03],
[8.46172992e+02],
[4.48456790e+02],
[2.95976376e+02],
[2.95087487e+02],
[4.45790123e+02],
[8.41728547e+02],
[1.67019128e+03],
[3.21211111e+03],
[2.50900000e+03],
[1.17600198e+03],
[5.03786161e+02],
[2.11419753e+02],
[1.11614236e+02],
[1.10725347e+02],
[2.08753086e+02],
[4.99341716e+02],
[1.16977976e+03],
[2.50100000e+03],
[1.88677778e+03],
[7.64479348e+02],
[2.50288218e+02],
[6.32716049e+01],
[1.61409846e+01],
[1.52520957e+01],
[6.06049383e+01],
[2.45843774e+02],
[7.58257125e+02],
[1.87877778e+03],
[1.35344444e+03],
[4.41845603e+02],
[8.56791648e+01],
[4.01234568e+00],
[9.55662247e+00],
[8.66773358e+00],
[1.34567901e+00],
[8.12347203e+01],
[4.35623381e+02],
[1.34544444e+03],
[9.09000000e+02],
[2.08100747e+02],
[9.95900015e+00],
[3.36419753e+01],
[9.18611492e+01],
[9.09722603e+01],
[3.09753086e+01],
[5.51455571e+00],
[2.01878525e+02],
[9.01000000e+02],
[5.53444444e+02],
[6.32447798e+01],
[2.31277244e+01],
[1.52160494e+02],
[2.63054565e+02],
[2.62165676e+02],
[1.49493827e+02],
[1.86832800e+01],
[5.70225575e+01],
[5.45444444e+02],
[2.86777778e+02],
[7.27770157e+00],
[1.25185338e+02],
[3.59567901e+02],
[5.23136869e+02],
[5.22247980e+02],
[3.56901235e+02],
[1.20740893e+02],
[1.05547935e+00],
[2.78777778e+02],
[1.09000000e+02],
[4.01995123e+01],
[3.16131840e+02],
[6.55864198e+02],
[8.72108063e+02],
[8.71219174e+02],
[6.53197531e+02],
[3.11687395e+02],
[3.39772900e+01],
[1.01000000e+02]])},
'input_data': array([[-2. , -3. ],
[-1.55555556, -3. ],
[-1.11111111, -3. ],
[-0.66666667, -3. ],
[-0.22222222, -3. ],
[ 0.22222222, -3. ],
[ 0.66666667, -3. ],
[ 1.11111111, -3. ],
[ 1.55555556, -3. ],
[ 2. , -3. ],
[-2. , -2.33333333],
[-1.55555556, -2.33333333],
[-1.11111111, -2.33333333],
[-0.66666667, -2.33333333],
[-0.22222222, -2.33333333],
[ 0.22222222, -2.33333333],
[ 0.66666667, -2.33333333],
[ 1.11111111, -2.33333333],
[ 1.55555556, -2.33333333],
[ 2. , -2.33333333],
[-2. , -1.66666667],
[-1.55555556, -1.66666667],
[-1.11111111, -1.66666667],
[-0.66666667, -1.66666667],
[-0.22222222, -1.66666667],
[ 0.22222222, -1.66666667],
[ 0.66666667, -1.66666667],
[ 1.11111111, -1.66666667],
[ 1.55555556, -1.66666667],
[ 2. , -1.66666667],
[-2. , -1. ],
[-1.55555556, -1. ],
[-1.11111111, -1. ],
[-0.66666667, -1. ],
[-0.22222222, -1. ],
[ 0.22222222, -1. ],
[ 0.66666667, -1. ],
[ 1.11111111, -1. ],
[ 1.55555556, -1. ],
[ 2. , -1. ],
[-2. , -0.33333333],
[-1.55555556, -0.33333333],
[-1.11111111, -0.33333333],
[-0.66666667, -0.33333333],
[-0.22222222, -0.33333333],
[ 0.22222222, -0.33333333],
[ 0.66666667, -0.33333333],
[ 1.11111111, -0.33333333],
[ 1.55555556, -0.33333333],
[ 2. , -0.33333333],
[-2. , 0.33333333],
[-1.55555556, 0.33333333],
[-1.11111111, 0.33333333],
[-0.66666667, 0.33333333],
[-0.22222222, 0.33333333],
[ 0.22222222, 0.33333333],
[ 0.66666667, 0.33333333],
[ 1.11111111, 0.33333333],
[ 1.55555556, 0.33333333],
[ 2. , 0.33333333],
[-2. , 1. ],
[-1.55555556, 1. ],
[-1.11111111, 1. ],
[-0.66666667, 1. ],
[-0.22222222, 1. ],
[ 0.22222222, 1. ],
[ 0.66666667, 1. ],
[ 1.11111111, 1. ],
[ 1.55555556, 1. ],
[ 2. , 1. ],
[-2. , 1.66666667],
[-1.55555556, 1.66666667],
[-1.11111111, 1.66666667],
[-0.66666667, 1.66666667],
[-0.22222222, 1.66666667],
[ 0.22222222, 1.66666667],
[ 0.66666667, 1.66666667],
[ 1.11111111, 1.66666667],
[ 1.55555556, 1.66666667],
[ 2. , 1.66666667],
[-2. , 2.33333333],
[-1.55555556, 2.33333333],
[-1.11111111, 2.33333333],
[-0.66666667, 2.33333333],
[-0.22222222, 2.33333333],
[ 0.22222222, 2.33333333],
[ 0.66666667, 2.33333333],
[ 1.11111111, 2.33333333],
[ 1.55555556, 2.33333333],
[ 2. , 2.33333333],
[-2. , 3. ],
[-1.55555556, 3. ],
[-1.11111111, 3. ],
[-0.66666667, 3. ],
[-0.22222222, 3. ],
[ 0.22222222, 3. ],
[ 0.66666667, 3. ],
[ 1.11111111, 3. ],
[ 1.55555556, 3. ],
[ 2. , 3. ]])}
Postprocessing#
You can now interact with these results as with any other Python object. For example, you can plot the results.
Here, we use the same plotting function as before. But in order to do so we first reshape the QUEENS input-output-data into the same structure that we saw in the initial minimal example.
[13]:
input_data = results["input_data"]
output_data = results["raw_output_data"]["result"]
X1_QUEENS = input_data[:,0].reshape(grid_design["x2"]["num_grid_points"],grid_design["x1"]["num_grid_points"])
X2_QUEENS = input_data[:,1].reshape(grid_design["x2"]["num_grid_points"],grid_design["x1"]["num_grid_points"])
Z_QUEENS = output_data.reshape(grid_design["x2"]["num_grid_points"],grid_design["x1"]["num_grid_points"])
visualize_grid_and_surface(X1_QUEENS,X2_QUEENS, Z_QUEENS)
Validating QUEENS results against manual mesh generation#
numpy.linspace to generate linearly spaced points before using numpy.meshgrid).To check that the grid generated by QUEENS matches your own manually constructed mesh (using numpy.linspace / numpy.meshgrid), you can use numpy.allclose.
This function verifies that two arrays are numerically close to each other, up to floating-point tolerances.
[14]:
print(f"X1 and X1_QUEENS are identical: {np.allclose(X1, X1_QUEENS)}")
print(f"X2 and X2_QUEENS are identical: {np.allclose(X2, X2_QUEENS)}")
print(f"Z and Z_QUEENS are identical: {np.allclose(Z, Z_QUEENS)}")
X1 and X1_QUEENS are identical: True
X2 and X2_QUEENS are identical: True
Z and Z_QUEENS are identical: True
Thus, both approaches (np.meshgrid vs. Grid iterator) yield the same grid coordinates.
This confirms that the QUEENS Grid iterator behaves consistently with the standard NumPy approach, but integrates seamlessly into the QUEENS workflow with result tracking, logging, reproducibility, and generalisability.
Generalisability of the QUEENS workflow#
Example#
We already visualised the Rosenbrock function and saw its banana-shaped valley.
The valley looks flat in the plot, but the actual minimum is hidden inside it.
Finding this minimum is an optimisation problem.
We can solve it in QUEENS by simply switching from a Grid iterator to an ``Optimization`` iterator — (almost) no need to change the model setup. The only thing that we have to change in the model is the scheduler, since we need to request new compute resources, so we have to create a new scheduler; all other aspects of the model can stay the same, though! Since this we are conducting a new experiment, we are also introducing a new global setting with a new experiment name.
One of the most important parameters specific to the Optimization iterator is the initial guess.
[15]:
from queens.iterators import Optimization
global_settings_optimization = GlobalSettings(experiment_name="optimization_rosenbrock", output_dir="./")
scheduler_optimization = Local(global_settings_optimization.experiment_name, num_jobs=1)
model_optimization = Simulation(scheduler_optimization, driver)
optimization = Optimization(
algorithm="L-BFGS-B",
initial_guess=[-2.0, 3.0],
bounds=[float("-inf"), float("inf")],
max_feval=1e4,
objective_and_jacobian=True,
model=model_optimization,
parameters=parameters,
global_settings=global_settings_optimization,
result_description={"write_results": True},
)
with global_settings_optimization:
# Actual analysis
run_iterator(optimization, global_settings=global_settings_optimization)
# Load results
results = load_result(global_settings_optimization.result_file(".pickle"))
optimal_x = results.x
optimal_fun = results.fun
+---------------------------------------------------------------------------------------------------+
| Local |
|- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
| self : <queens.schedulers.local.Local object at 0x7f42c1e8ba10> |
| experiment_name : 'optimization_rosenbrock' |
| num_jobs : 1 |
| num_procs : 1 |
| restart_workers : False |
| verbose : True |
| experiment_base_dir : None |
| overwrite_existing_experiment : False |
+---------------------------------------------------------------------------------------------------+
To view the Dask dashboard open this link in your browser: http://127.0.0.1:8787/status
+---------------------------------------------------------------------------------------------------+
| Simulation |
|- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
| self : <queens.models.simulation.Simulation object at 0x7f42a5a55290> |
| scheduler : <queens.schedulers.local.Local object at 0x7f42c1e8ba10> |
| driver : <queens.drivers.function.Function object at 0x7f42c3a5b910> |
+---------------------------------------------------------------------------------------------------+
+---------------------------------------------------------------------------------------------------+
| Optimization |
|- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
| self : <queens.iterators.optimization.Optimization object at 0x7f42a5a55690> |
| model : <queens.models.simulation.Simulation object at 0x7f42a5a55290> |
| parameters : <queens.parameters.parameters.Parameters object at 0x7f42c3f0cf90> |
| global_settings : <queens.global_settings.GlobalSettings object at 0x7f42a5a0ab10> |
| initial_guess : [-2.0, 3.0] |
| result_description : {'write_results': True} |
| verbose_output : False |
| bounds : [-inf, inf] |
| constraints : None |
| max_feval : 10000.0 |
| algorithm : 'L-BFGS-B' |
| jac_method : '2-point' |
| jac_rel_step : None |
| objective_and_jacobian : True |
+---------------------------------------------------------------------------------------------------+
.**.
I I
* *
:. .:
I I
::: .* *. :*:
I * *. .* * I
.: *:*:::: I I ::::*:* :.
:: :I: ::.* *.:: :I: ::
:. * *: .V. .V. :* * .:
:. I :: I*. *I :: I .*
*. :: .* :: :: :* :: *: :* .*
*. I * I :**: I * I .*
*.:. I* ** *I .:.*
*:I :*.* :: *: *.*: I.*
*I: :* .** *I. *: :**
*V *. .*. *II* .*. .* V*
** ..:*I***I*:::: ::::*I***I*:.. **
...... ......
:*IV$$$V*: VV: *VV VVVVVVVVVVVF *VVVVVVVVVVV. .VF. :VI :FV$$$V*:
*$$*:. .:*V$* $$: *$V $$*......... *$I......... .$$$* *$V V$F. .:FV.
V$* *$$. $$: *$V $$: *$F .$$F$V. *$V .$$.
V$F *$V $$: *$V $$: *$I .$$ .V$* *$V F$$*:.
$$: :$$ $$: *$V $$$VVVVVVVV *$$VVVVVVVV: .$$ *$V. *$V .*FV$$V*.
I$F ** *$V $$: *$V $$: *$F .$$ .I$* *$V .*$$*
V$* :V$F$$. I$F V$* $$: *$F .$$ :$$I$V *$$
*$$*:. .:*$$$F F$V*....*V$* $$*......... *$I......... .$$ F$$V V$*: .:V$*
:*IV$$VI*: :I: .*FVVVVF: VVVVVVVVVVVV *VVVVVVVVVVV. .VV :VI :*VV$$VI*.
QUEENS (Quantification of Uncertain Effects in ENgineering Systems):
a Python framework for solver-independent multi-query
analyses of large-scale computational models.
+---------------------------------------------------------------------------------------------------+
| git information |
|- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
| commit hash : 4d6a1e5c2ce6849df397567c514614e5896a85ad |
| branch : main |
| clean working tree : False |
+---------------------------------------------------------------------------------------------------+
Optimization for experiment: optimization_rosenbrock
Starting Analysis...
Initialize Optimization run.
Welcome to Optimization core run.
33%|███▎ | 1/3 [00:00<00:00, 4.03it/s]
+---------------------------------------------------------------------------------------------------+
| Batch summary for jobs 0 - 2 |
|- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
| number of jobs : 3 |
| number of parallel jobs : 1 |
| number of procs : 1 |
| total elapsed time : 2.518e-01s |
| average time per parallel job : 8.393e-02s |
+---------------------------------------------------------------------------------------------------+
100%|██████████| 3/3 [00:00<00:00, 11.88it/s]
The intermediate, iterated parameters ['x1', 'x2'] are:
[-2. 3.]
0%| | 0/3 [00:00<?, ?it/s]
+---------------------------------------------------------------------------------------------------+
| Batch summary for jobs 3 - 5 |
|- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
| number of jobs : 3 |
| number of parallel jobs : 1 |
| number of procs : 1 |
| total elapsed time : 2.331e-02s |
| average time per parallel job : 7.771e-03s |
+---------------------------------------------------------------------------------------------------+
100%|██████████| 3/3 [00:00<00:00, 125.02it/s]
The intermediate, iterated parameters ['x1', 'x2'] are:
[-1.02943398 3.24083522]
0%| | 0/3 [00:00<?, ?it/s]
+---------------------------------------------------------------------------------------------------+
| Batch summary for jobs 6 - 8 |
|- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
| number of jobs : 3 |
| number of parallel jobs : 1 |
| number of procs : 1 |
| total elapsed time : 2.392e-02s |
| average time per parallel job : 7.973e-03s |
+---------------------------------------------------------------------------------------------------+
100%|██████████| 3/3 [00:00<00:00, 123.21it/s]
The intermediate, iterated parameters ['x1', 'x2'] are:
[-1.74192485 3.06403849]
0%| | 0/3 [00:00<?, ?it/s]
+---------------------------------------------------------------------------------------------------+
| Batch summary for jobs 9 - 11 |
|- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
| number of jobs : 3 |
| number of parallel jobs : 1 |
| number of procs : 1 |
| total elapsed time : 1.939e-02s |
| average time per parallel job : 6.463e-03s |
+---------------------------------------------------------------------------------------------------+
100%|██████████| 3/3 [00:00<00:00, 151.03it/s]
The intermediate, iterated parameters ['x1', 'x2'] are:
[-1.74671117 3.06218337]
0%| | 0/3 [00:00<?, ?it/s]
+---------------------------------------------------------------------------------------------------+
| Batch summary for jobs 12 - 14 |
|- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
| number of jobs : 3 |
| number of parallel jobs : 1 |
| number of procs : 1 |
| total elapsed time : 1.784e-02s |
| average time per parallel job : 5.946e-03s |
+---------------------------------------------------------------------------------------------------+
100%|██████████| 3/3 [00:00<00:00, 163.87it/s]
The intermediate, iterated parameters ['x1', 'x2'] are:
[-1.74761449 3.06121635]
0%| | 0/3 [00:00<?, ?it/s]
+---------------------------------------------------------------------------------------------------+
| Batch summary for jobs 15 - 17 |
|- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
| number of jobs : 3 |
| number of parallel jobs : 1 |
| number of procs : 1 |
| total elapsed time : 1.790e-02s |
| average time per parallel job : 5.968e-03s |
+---------------------------------------------------------------------------------------------------+
100%|██████████| 3/3 [00:00<00:00, 162.77it/s]
The intermediate, iterated parameters ['x1', 'x2'] are:
[-1.74764318 3.06027432]
0%| | 0/3 [00:00<?, ?it/s]
+---------------------------------------------------------------------------------------------------+
| Batch summary for jobs 18 - 20 |
|- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
| number of jobs : 3 |
| number of parallel jobs : 1 |
| number of procs : 1 |
| total elapsed time : 1.822e-02s |
| average time per parallel job : 6.073e-03s |
+---------------------------------------------------------------------------------------------------+
100%|██████████| 3/3 [00:00<00:00, 160.63it/s]
The intermediate, iterated parameters ['x1', 'x2'] are:
[-1.74657998 3.05129693]
0%| | 0/3 [00:00<?, ?it/s]
+---------------------------------------------------------------------------------------------------+
| Batch summary for jobs 21 - 23 |
|- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
| number of jobs : 3 |
| number of parallel jobs : 1 |
| number of procs : 1 |
| total elapsed time : 1.892e-02s |
| average time per parallel job : 6.306e-03s |
+---------------------------------------------------------------------------------------------------+
100%|██████████| 3/3 [00:00<00:00, 154.67it/s]
The intermediate, iterated parameters ['x1', 'x2'] are:
[-1.74265233 3.03127066]
0%| | 0/3 [00:00<?, ?it/s]
+---------------------------------------------------------------------------------------------------+
| Batch summary for jobs 24 - 26 |
|- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
| number of jobs : 3 |
| number of parallel jobs : 1 |
| number of procs : 1 |
| total elapsed time : 1.955e-02s |
| average time per parallel job : 6.518e-03s |
+---------------------------------------------------------------------------------------------------+
100%|██████████| 3/3 [00:00<00:00, 150.02it/s]
The intermediate, iterated parameters ['x1', 'x2'] are:
[-1.72817705 2.96943629]
0%| | 0/3 [00:00<?, ?it/s]
+---------------------------------------------------------------------------------------------------+
| Batch summary for jobs 27 - 29 |
|- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
| number of jobs : 3 |
| number of parallel jobs : 1 |
| number of procs : 1 |
| total elapsed time : 1.667e-02s |
| average time per parallel job : 5.555e-03s |
+---------------------------------------------------------------------------------------------------+
100%|██████████| 3/3 [00:00<00:00, 175.37it/s]
The intermediate, iterated parameters ['x1', 'x2'] are:
[-1.69156766 2.82727267]
0%| | 0/3 [00:00<?, ?it/s]
+---------------------------------------------------------------------------------------------------+
| Batch summary for jobs 30 - 32 |
|- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
| number of jobs : 3 |
| number of parallel jobs : 1 |
| number of procs : 1 |
| total elapsed time : 1.730e-02s |
| average time per parallel job : 5.766e-03s |
+---------------------------------------------------------------------------------------------------+
100%|██████████| 3/3 [00:00<00:00, 169.10it/s]
The intermediate, iterated parameters ['x1', 'x2'] are:
[-1.62619656 2.59111844]
0%| | 0/3 [00:00<?, ?it/s]
+---------------------------------------------------------------------------------------------------+
| Batch summary for jobs 33 - 35 |
|- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
| number of jobs : 3 |
| number of parallel jobs : 1 |
| number of procs : 1 |
| total elapsed time : 1.720e-02s |
| average time per parallel job : 5.732e-03s |
+---------------------------------------------------------------------------------------------------+
100%|██████████| 3/3 [00:00<00:00, 169.66it/s]
The intermediate, iterated parameters ['x1', 'x2'] are:
[-1.54984759 2.33921272]
0%| | 0/3 [00:00<?, ?it/s]
+---------------------------------------------------------------------------------------------------+
| Batch summary for jobs 36 - 38 |
|- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
| number of jobs : 3 |
| number of parallel jobs : 1 |
| number of procs : 1 |
| total elapsed time : 1.913e-02s |
| average time per parallel job : 6.376e-03s |
+---------------------------------------------------------------------------------------------------+
100%|██████████| 3/3 [00:00<00:00, 152.00it/s]
The intermediate, iterated parameters ['x1', 'x2'] are:
[-1.41782481 1.9499667 ]
0%| | 0/3 [00:00<?, ?it/s]
+---------------------------------------------------------------------------------------------------+
| Batch summary for jobs 39 - 41 |
|- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
| number of jobs : 3 |
| number of parallel jobs : 1 |
| number of procs : 1 |
| total elapsed time : 1.856e-02s |
| average time per parallel job : 6.188e-03s |
+---------------------------------------------------------------------------------------------------+
100%|██████████| 3/3 [00:00<00:00, 157.92it/s]
The intermediate, iterated parameters ['x1', 'x2'] are:
[-1.29734833 1.66252013]
0%| | 0/3 [00:00<?, ?it/s]
+---------------------------------------------------------------------------------------------------+
| Batch summary for jobs 42 - 44 |
|- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
| number of jobs : 3 |
| number of parallel jobs : 1 |
| number of procs : 1 |
| total elapsed time : 1.818e-02s |
| average time per parallel job : 6.059e-03s |
+---------------------------------------------------------------------------------------------------+
100%|██████████| 3/3 [00:00<00:00, 160.89it/s]
The intermediate, iterated parameters ['x1', 'x2'] are:
[-1.009206 0.88348725]
0%| | 0/3 [00:00<?, ?it/s]
+---------------------------------------------------------------------------------------------------+
| Batch summary for jobs 45 - 47 |
|- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
| number of jobs : 3 |
| number of parallel jobs : 1 |
| number of procs : 1 |
| total elapsed time : 1.823e-02s |
| average time per parallel job : 6.078e-03s |
+---------------------------------------------------------------------------------------------------+
100%|██████████| 3/3 [00:00<00:00, 160.46it/s]
The intermediate, iterated parameters ['x1', 'x2'] are:
[-1.17743931 1.3383294 ]
0%| | 0/3 [00:00<?, ?it/s]
+---------------------------------------------------------------------------------------------------+
| Batch summary for jobs 48 - 50 |
|- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
| number of jobs : 3 |
| number of parallel jobs : 1 |
| number of procs : 1 |
| total elapsed time : 1.843e-02s |
| average time per parallel job : 6.142e-03s |
+---------------------------------------------------------------------------------------------------+
100%|██████████| 3/3 [00:00<00:00, 159.14it/s]
The intermediate, iterated parameters ['x1', 'x2'] are:
[-1.00500963 0.94889939]
0%| | 0/3 [00:00<?, ?it/s]
+---------------------------------------------------------------------------------------------------+
| Batch summary for jobs 51 - 53 |
|- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
| number of jobs : 3 |
| number of parallel jobs : 1 |
| number of procs : 1 |
| total elapsed time : 2.264e-02s |
| average time per parallel job : 7.548e-03s |
+---------------------------------------------------------------------------------------------------+
100%|██████████| 3/3 [00:00<00:00, 129.79it/s]
The intermediate, iterated parameters ['x1', 'x2'] are:
[-0.90438028 0.82312013]
0%| | 0/3 [00:00<?, ?it/s]
+---------------------------------------------------------------------------------------------------+
| Batch summary for jobs 54 - 56 |
|- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
| number of jobs : 3 |
| number of parallel jobs : 1 |
| number of procs : 1 |
| total elapsed time : 1.856e-02s |
| average time per parallel job : 6.185e-03s |
+---------------------------------------------------------------------------------------------------+
100%|██████████| 3/3 [00:00<00:00, 158.07it/s]
The intermediate, iterated parameters ['x1', 'x2'] are:
[-0.58041252 0.19660862]
0%| | 0/3 [00:00<?, ?it/s]
+---------------------------------------------------------------------------------------------------+
| Batch summary for jobs 57 - 59 |
|- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
| number of jobs : 3 |
| number of parallel jobs : 1 |
| number of procs : 1 |
| total elapsed time : 1.788e-02s |
| average time per parallel job : 5.959e-03s |
+---------------------------------------------------------------------------------------------------+
100%|██████████| 3/3 [00:00<00:00, 162.05it/s]
The intermediate, iterated parameters ['x1', 'x2'] are:
[-0.77608233 0.57500858]
0%| | 0/3 [00:00<?, ?it/s]
+---------------------------------------------------------------------------------------------------+
| Batch summary for jobs 60 - 62 |
|- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
| number of jobs : 3 |
| number of parallel jobs : 1 |
| number of procs : 1 |
| total elapsed time : 2.399e-02s |
| average time per parallel job : 7.995e-03s |
+---------------------------------------------------------------------------------------------------+
100%|██████████| 3/3 [00:00<00:00, 122.72it/s]
The intermediate, iterated parameters ['x1', 'x2'] are:
[-0.57509874 0.23373203]
0%| | 0/3 [00:00<?, ?it/s]
+---------------------------------------------------------------------------------------------------+
| Batch summary for jobs 63 - 65 |
|- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
| number of jobs : 3 |
| number of parallel jobs : 1 |
| number of procs : 1 |
| total elapsed time : 1.811e-02s |
| average time per parallel job : 6.037e-03s |
+---------------------------------------------------------------------------------------------------+
100%|██████████| 3/3 [00:00<00:00, 161.69it/s]
The intermediate, iterated parameters ['x1', 'x2'] are:
[-0.69117941 0.43084072]
0%| | 0/3 [00:00<?, ?it/s]
+---------------------------------------------------------------------------------------------------+
| Batch summary for jobs 66 - 68 |
|- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
| number of jobs : 3 |
| number of parallel jobs : 1 |
| number of procs : 1 |
| total elapsed time : 2.187e-02s |
| average time per parallel job : 7.289e-03s |
+---------------------------------------------------------------------------------------------------+
100%|██████████| 3/3 [00:00<00:00, 134.32it/s]
The intermediate, iterated parameters ['x1', 'x2'] are:
[-0.614521 0.33718198]
0%| | 0/3 [00:00<?, ?it/s]
+---------------------------------------------------------------------------------------------------+
| Batch summary for jobs 69 - 71 |
|- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
| number of jobs : 3 |
| number of parallel jobs : 1 |
| number of procs : 1 |
| total elapsed time : 1.792e-02s |
| average time per parallel job : 5.972e-03s |
+---------------------------------------------------------------------------------------------------+
100%|██████████| 3/3 [00:00<00:00, 163.30it/s]
The intermediate, iterated parameters ['x1', 'x2'] are:
[-0.49381328 0.23544626]
0%| | 0/3 [00:00<?, ?it/s]
+---------------------------------------------------------------------------------------------------+
| Batch summary for jobs 72 - 74 |
|- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
| number of jobs : 3 |
| number of parallel jobs : 1 |
| number of procs : 1 |
| total elapsed time : 1.749e-02s |
| average time per parallel job : 5.830e-03s |
+---------------------------------------------------------------------------------------------------+
100%|██████████| 3/3 [00:00<00:00, 167.46it/s]
The intermediate, iterated parameters ['x1', 'x2'] are:
[-0.15377085 -0.15597063]
0%| | 0/3 [00:00<?, ?it/s]
+---------------------------------------------------------------------------------------------------+
| Batch summary for jobs 75 - 77 |
|- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
| number of jobs : 3 |
| number of parallel jobs : 1 |
| number of procs : 1 |
| total elapsed time : 1.822e-02s |
| average time per parallel job : 6.073e-03s |
+---------------------------------------------------------------------------------------------------+
100%|██████████| 3/3 [00:00<00:00, 158.60it/s]
The intermediate, iterated parameters ['x1', 'x2'] are:
[-0.41085761 0.13995744]
0%| | 0/3 [00:00<?, ?it/s]
+---------------------------------------------------------------------------------------------------+
| Batch summary for jobs 78 - 80 |
|- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
| number of jobs : 3 |
| number of parallel jobs : 1 |
| number of procs : 1 |
| total elapsed time : 1.771e-02s |
| average time per parallel job : 5.902e-03s |
+---------------------------------------------------------------------------------------------------+
100%|██████████| 3/3 [00:00<00:00, 164.56it/s]
The intermediate, iterated parameters ['x1', 'x2'] are:
[-0.25088201 0.00721074]
0%| | 0/3 [00:00<?, ?it/s]
+---------------------------------------------------------------------------------------------------+
| Batch summary for jobs 81 - 83 |
|- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
| number of jobs : 3 |
| number of parallel jobs : 1 |
| number of procs : 1 |
| total elapsed time : 1.993e-02s |
| average time per parallel job : 6.645e-03s |
+---------------------------------------------------------------------------------------------------+
100%|██████████| 3/3 [00:00<00:00, 146.59it/s]
The intermediate, iterated parameters ['x1', 'x2'] are:
[-0.22922801 0.03941756]
0%| | 0/3 [00:00<?, ?it/s]
+---------------------------------------------------------------------------------------------------+
| Batch summary for jobs 84 - 86 |
|- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
| number of jobs : 3 |
| number of parallel jobs : 1 |
| number of procs : 1 |
| total elapsed time : 2.317e-02s |
| average time per parallel job : 7.722e-03s |
+---------------------------------------------------------------------------------------------------+
100%|██████████| 3/3 [00:00<00:00, 127.18it/s]
The intermediate, iterated parameters ['x1', 'x2'] are:
[-0.08102584 -0.01844475]
0%| | 0/3 [00:00<?, ?it/s]
+---------------------------------------------------------------------------------------------------+
| Batch summary for jobs 87 - 89 |
|- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
| number of jobs : 3 |
| number of parallel jobs : 1 |
| number of procs : 1 |
| total elapsed time : 1.776e-02s |
| average time per parallel job : 5.921e-03s |
+---------------------------------------------------------------------------------------------------+
100%|██████████| 3/3 [00:00<00:00, 163.67it/s]
The intermediate, iterated parameters ['x1', 'x2'] are:
[ 0.06475338 -0.03973888]
0%| | 0/3 [00:00<?, ?it/s]
+---------------------------------------------------------------------------------------------------+
| Batch summary for jobs 90 - 92 |
|- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
| number of jobs : 3 |
| number of parallel jobs : 1 |
| number of procs : 1 |
| total elapsed time : 2.286e-02s |
| average time per parallel job : 7.620e-03s |
+---------------------------------------------------------------------------------------------------+
100%|██████████| 3/3 [00:00<00:00, 127.30it/s]
The intermediate, iterated parameters ['x1', 'x2'] are:
[0.12013693 0.01426238]
0%| | 0/3 [00:00<?, ?it/s]
+---------------------------------------------------------------------------------------------------+
| Batch summary for jobs 93 - 95 |
|- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
| number of jobs : 3 |
| number of parallel jobs : 1 |
| number of procs : 1 |
| total elapsed time : 1.715e-02s |
| average time per parallel job : 5.718e-03s |
+---------------------------------------------------------------------------------------------------+
100%|██████████| 3/3 [00:00<00:00, 170.35it/s]
The intermediate, iterated parameters ['x1', 'x2'] are:
[0.29447084 0.04585213]
0%| | 0/3 [00:00<?, ?it/s]
+---------------------------------------------------------------------------------------------------+
| Batch summary for jobs 96 - 98 |
|- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
| number of jobs : 3 |
| number of parallel jobs : 1 |
| number of procs : 1 |
| total elapsed time : 1.820e-02s |
| average time per parallel job : 6.066e-03s |
+---------------------------------------------------------------------------------------------------+
100%|██████████| 3/3 [00:00<00:00, 159.58it/s]
The intermediate, iterated parameters ['x1', 'x2'] are:
[0.20343334 0.0293559 ]
0%| | 0/3 [00:00<?, ?it/s]
+---------------------------------------------------------------------------------------------------+
| Batch summary for jobs 99 - 101 |
|- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
| number of jobs : 3 |
| number of parallel jobs : 1 |
| number of procs : 1 |
| total elapsed time : 1.722e-02s |
| average time per parallel job : 5.741e-03s |
+---------------------------------------------------------------------------------------------------+
100%|██████████| 3/3 [00:00<00:00, 169.67it/s]
The intermediate, iterated parameters ['x1', 'x2'] are:
[0.4270084 0.09967667]
0%| | 0/3 [00:00<?, ?it/s]
+---------------------------------------------------------------------------------------------------+
| Batch summary for jobs 102 - 104 |
|- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
| number of jobs : 3 |
| number of parallel jobs : 1 |
| number of procs : 1 |
| total elapsed time : 2.329e-02s |
| average time per parallel job : 7.765e-03s |
+---------------------------------------------------------------------------------------------------+
100%|██████████| 3/3 [00:00<00:00, 125.87it/s]
The intermediate, iterated parameters ['x1', 'x2'] are:
[0.27355856 0.05141229]
0%| | 0/3 [00:00<?, ?it/s]
+---------------------------------------------------------------------------------------------------+
| Batch summary for jobs 105 - 107 |
|- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
| number of jobs : 3 |
| number of parallel jobs : 1 |
| number of procs : 1 |
| total elapsed time : 1.758e-02s |
| average time per parallel job : 5.860e-03s |
+---------------------------------------------------------------------------------------------------+
100%|██████████| 3/3 [00:00<00:00, 164.89it/s]
The intermediate, iterated parameters ['x1', 'x2'] are:
[0.3440562 0.09357937]
0%| | 0/3 [00:00<?, ?it/s]
+---------------------------------------------------------------------------------------------------+
| Batch summary for jobs 108 - 110 |
|- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
| number of jobs : 3 |
| number of parallel jobs : 1 |
| number of procs : 1 |
| total elapsed time : 1.723e-02s |
| average time per parallel job : 5.743e-03s |
+---------------------------------------------------------------------------------------------------+
100%|██████████| 3/3 [00:00<00:00, 169.15it/s]
The intermediate, iterated parameters ['x1', 'x2'] are:
[0.42850246 0.17591048]
0%| | 0/3 [00:00<?, ?it/s]
+---------------------------------------------------------------------------------------------------+
| Batch summary for jobs 111 - 113 |
|- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
| number of jobs : 3 |
| number of parallel jobs : 1 |
| number of procs : 1 |
| total elapsed time : 1.681e-02s |
| average time per parallel job : 5.605e-03s |
+---------------------------------------------------------------------------------------------------+
100%|██████████| 3/3 [00:00<00:00, 173.39it/s]
The intermediate, iterated parameters ['x1', 'x2'] are:
[0.57578808 0.29149622]
0%| | 0/3 [00:00<?, ?it/s]
+---------------------------------------------------------------------------------------------------+
| Batch summary for jobs 114 - 116 |
|- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
| number of jobs : 3 |
| number of parallel jobs : 1 |
| number of procs : 1 |
| total elapsed time : 1.455e-02s |
| average time per parallel job : 4.850e-03s |
+---------------------------------------------------------------------------------------------------+
100%|██████████| 3/3 [00:00<00:00, 196.73it/s]
The intermediate, iterated parameters ['x1', 'x2'] are:
[0.50453994 0.23558262]
0%| | 0/3 [00:00<?, ?it/s]
+---------------------------------------------------------------------------------------------------+
| Batch summary for jobs 117 - 119 |
|- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
| number of jobs : 3 |
| number of parallel jobs : 1 |
| number of procs : 1 |
| total elapsed time : 1.963e-02s |
| average time per parallel job : 6.544e-03s |
+---------------------------------------------------------------------------------------------------+
100%|██████████| 3/3 [00:00<00:00, 149.57it/s]
The intermediate, iterated parameters ['x1', 'x2'] are:
[0.59015302 0.33193825]
0%| | 0/3 [00:00<?, ?it/s]
+---------------------------------------------------------------------------------------------------+
| Batch summary for jobs 120 - 122 |
|- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
| number of jobs : 3 |
| number of parallel jobs : 1 |
| number of procs : 1 |
| total elapsed time : 2.168e-02s |
| average time per parallel job : 7.226e-03s |
+---------------------------------------------------------------------------------------------------+
100%|██████████| 3/3 [00:00<00:00, 135.07it/s]
The intermediate, iterated parameters ['x1', 'x2'] are:
[0.64040129 0.41699719]
0%| | 0/3 [00:00<?, ?it/s]
+---------------------------------------------------------------------------------------------------+
| Batch summary for jobs 123 - 125 |
|- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
| number of jobs : 3 |
| number of parallel jobs : 1 |
| number of procs : 1 |
| total elapsed time : 1.760e-02s |
| average time per parallel job : 5.867e-03s |
+---------------------------------------------------------------------------------------------------+
100%|██████████| 3/3 [00:00<00:00, 163.74it/s]
The intermediate, iterated parameters ['x1', 'x2'] are:
[0.82271023 0.6353079 ]
0%| | 0/3 [00:00<?, ?it/s]
+---------------------------------------------------------------------------------------------------+
| Batch summary for jobs 126 - 128 |
|- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
| number of jobs : 3 |
| number of parallel jobs : 1 |
| number of procs : 1 |
| total elapsed time : 1.761e-02s |
| average time per parallel job : 5.870e-03s |
+---------------------------------------------------------------------------------------------------+
100%|██████████| 3/3 [00:00<00:00, 166.17it/s]
The intermediate, iterated parameters ['x1', 'x2'] are:
[0.71841923 0.51042185]
0%| | 0/3 [00:00<?, ?it/s]
+---------------------------------------------------------------------------------------------------+
| Batch summary for jobs 129 - 131 |
|- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
| number of jobs : 3 |
| number of parallel jobs : 1 |
| number of procs : 1 |
| total elapsed time : 1.732e-02s |
| average time per parallel job : 5.773e-03s |
+---------------------------------------------------------------------------------------------------+
100%|██████████| 3/3 [00:00<00:00, 167.12it/s]
The intermediate, iterated parameters ['x1', 'x2'] are:
[0.82073307 0.64605231]
0%| | 0/3 [00:00<?, ?it/s]
+---------------------------------------------------------------------------------------------------+
| Batch summary for jobs 132 - 134 |
|- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
| number of jobs : 3 |
| number of parallel jobs : 1 |
| number of procs : 1 |
| total elapsed time : 2.419e-02s |
| average time per parallel job : 8.063e-03s |
+---------------------------------------------------------------------------------------------------+
100%|██████████| 3/3 [00:00<00:00, 121.45it/s]
The intermediate, iterated parameters ['x1', 'x2'] are:
[0.7561657 0.56045976]
0%| | 0/3 [00:00<?, ?it/s]
+---------------------------------------------------------------------------------------------------+
| Batch summary for jobs 135 - 137 |
|- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
| number of jobs : 3 |
| number of parallel jobs : 1 |
| number of procs : 1 |
| total elapsed time : 1.747e-02s |
| average time per parallel job : 5.822e-03s |
+---------------------------------------------------------------------------------------------------+
100%|██████████| 3/3 [00:00<00:00, 167.42it/s]
The intermediate, iterated parameters ['x1', 'x2'] are:
[0.78679582 0.60901253]
33%|███▎ | 1/3 [00:00<00:00, 9.35it/s]
+---------------------------------------------------------------------------------------------------+
| Batch summary for jobs 138 - 140 |
|- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
| number of jobs : 3 |
| number of parallel jobs : 1 |
| number of procs : 1 |
| total elapsed time : 1.120e-01s |
| average time per parallel job : 3.733e-02s |
+---------------------------------------------------------------------------------------------------+
100%|██████████| 3/3 [00:00<00:00, 26.60it/s]
The intermediate, iterated parameters ['x1', 'x2'] are:
[0.84186009 0.70632677]
0%| | 0/3 [00:00<?, ?it/s]
+---------------------------------------------------------------------------------------------------+
| Batch summary for jobs 141 - 143 |
|- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
| number of jobs : 3 |
| number of parallel jobs : 1 |
| number of procs : 1 |
| total elapsed time : 1.647e-02s |
| average time per parallel job : 5.488e-03s |
+---------------------------------------------------------------------------------------------------+
100%|██████████| 3/3 [00:00<00:00, 176.93it/s]
The intermediate, iterated parameters ['x1', 'x2'] are:
[0.92131325 0.83572414]
0%| | 0/3 [00:00<?, ?it/s]
+---------------------------------------------------------------------------------------------------+
| Batch summary for jobs 144 - 146 |
|- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
| number of jobs : 3 |
| number of parallel jobs : 1 |
| number of procs : 1 |
| total elapsed time : 1.665e-02s |
| average time per parallel job : 5.551e-03s |
+---------------------------------------------------------------------------------------------------+
100%|██████████| 3/3 [00:00<00:00, 172.80it/s]
The intermediate, iterated parameters ['x1', 'x2'] are:
[0.87508933 0.76044389]
0%| | 0/3 [00:00<?, ?it/s]
+---------------------------------------------------------------------------------------------------+
| Batch summary for jobs 147 - 149 |
|- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
| number of jobs : 3 |
| number of parallel jobs : 1 |
| number of procs : 1 |
| total elapsed time : 1.793e-02s |
| average time per parallel job : 5.976e-03s |
+---------------------------------------------------------------------------------------------------+
100%|██████████| 3/3 [00:00<00:00, 162.92it/s]
The intermediate, iterated parameters ['x1', 'x2'] are:
[0.93363163 0.86591949]
0%| | 0/3 [00:00<?, ?it/s]
+---------------------------------------------------------------------------------------------------+
| Batch summary for jobs 150 - 152 |
|- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
| number of jobs : 3 |
| number of parallel jobs : 1 |
| number of procs : 1 |
| total elapsed time : 1.569e-02s |
| average time per parallel job : 5.232e-03s |
+---------------------------------------------------------------------------------------------------+
100%|██████████| 3/3 [00:00<00:00, 183.93it/s]
The intermediate, iterated parameters ['x1', 'x2'] are:
[0.94990355 0.90337776]
0%| | 0/3 [00:00<?, ?it/s]
+---------------------------------------------------------------------------------------------------+
| Batch summary for jobs 153 - 155 |
|- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
| number of jobs : 3 |
| number of parallel jobs : 1 |
| number of procs : 1 |
| total elapsed time : 2.204e-02s |
| average time per parallel job : 7.348e-03s |
+---------------------------------------------------------------------------------------------------+
100%|██████████| 3/3 [00:00<00:00, 133.29it/s]
The intermediate, iterated parameters ['x1', 'x2'] are:
[0.98488335 0.968213 ]
0%| | 0/3 [00:00<?, ?it/s]
+---------------------------------------------------------------------------------------------------+
| Batch summary for jobs 156 - 158 |
|- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
| number of jobs : 3 |
| number of parallel jobs : 1 |
| number of procs : 1 |
| total elapsed time : 1.712e-02s |
| average time per parallel job : 5.706e-03s |
+---------------------------------------------------------------------------------------------------+
100%|██████████| 3/3 [00:00<00:00, 170.85it/s]
The intermediate, iterated parameters ['x1', 'x2'] are:
[0.9892104 0.9778456]
0%| | 0/3 [00:00<?, ?it/s]
+---------------------------------------------------------------------------------------------------+
| Batch summary for jobs 159 - 161 |
|- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
| number of jobs : 3 |
| number of parallel jobs : 1 |
| number of procs : 1 |
| total elapsed time : 1.706e-02s |
| average time per parallel job : 5.686e-03s |
+---------------------------------------------------------------------------------------------------+
100%|██████████| 3/3 [00:00<00:00, 170.57it/s]
The intermediate, iterated parameters ['x1', 'x2'] are:
[0.99956993 0.99889122]
0%| | 0/3 [00:00<?, ?it/s]
+---------------------------------------------------------------------------------------------------+
| Batch summary for jobs 162 - 164 |
|- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
| number of jobs : 3 |
| number of parallel jobs : 1 |
| number of procs : 1 |
| total elapsed time : 1.816e-02s |
| average time per parallel job : 6.054e-03s |
+---------------------------------------------------------------------------------------------------+
100%|██████████| 3/3 [00:00<00:00, 161.06it/s]
The intermediate, iterated parameters ['x1', 'x2'] are:
[0.99943595 0.99894714]
0%| | 0/3 [00:00<?, ?it/s]
+---------------------------------------------------------------------------------------------------+
| Batch summary for jobs 165 - 167 |
|- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
| number of jobs : 3 |
| number of parallel jobs : 1 |
| number of procs : 1 |
| total elapsed time : 1.667e-02s |
| average time per parallel job : 5.558e-03s |
+---------------------------------------------------------------------------------------------------+
100%|██████████| 3/3 [00:00<00:00, 172.90it/s]
The intermediate, iterated parameters ['x1', 'x2'] are:
[0.99996402 0.99992774]
0%| | 0/3 [00:00<?, ?it/s]
+---------------------------------------------------------------------------------------------------+
| Batch summary for jobs 168 - 170 |
|- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
| number of jobs : 3 |
| number of parallel jobs : 1 |
| number of procs : 1 |
| total elapsed time : 1.727e-02s |
| average time per parallel job : 5.757e-03s |
+---------------------------------------------------------------------------------------------------+
100%|██████████| 3/3 [00:00<00:00, 168.61it/s]
The intermediate, iterated parameters ['x1', 'x2'] are:
[0.99999465 0.99998921]
Optimization took 1.800546E+00 seconds.
The optimum:
[0.99999465 0.99998921]
Time for CALCULATION: 1.8063390254974365 s
You have successfully identified the minimum of the Rosenbrock function with a gradient based optimisation algorithm:
[16]:
print(f"The minimum of the Rosenbrock function {optimal_fun} is at {optimal_x}.")
The minimum of the Rosenbrock function 2.9579352719460594e-11 is at [0.99999465 0.99998921].
Let’s visualise the minimum together with the surface plot.
[17]:
visualize_grid_and_surface(X1, X2, Z, min_point=(optimal_x[0], optimal_x[0], optimal_fun))
Optional tasks: time for some individualisation#
The resolution of the grid is relatively coarse. Increase the resolution by increasing the
num_grid_pointsin the grid design and repeat the QUEENS experiment.You can adjust the bounds of the grid per variable via the keywords
lower_boundandupper_boundof the Uniform parameter objects. Go ahead and see what happens if you change the bound.We are executing the study on our local machine, so we are using the
Localscheduler. Nevertheless, you can also run the model evaluations in parallel by increasingnum_jobs. See how the time for the calculation of an experiment changes by increasingnum_jobs. Warning: don’t go beyond the maximum number of CPUs your machine has.
Advanced optional task: Try another test function for optimisation#
To see how flexible QUEENS is, let’s try a different test function from the list of optimisation test functions.
Steps#
- Pick a functionChoose any test function you like (e.g. Rastrigin, Ackley, Himmelblau, …).
- Write it in PythonImplement the function with the same variable names (
x1,x2) so that QUEENS can recognise them. - Define the parametersCreate a new
Parametersobject withx1andx2in the correct domain for the chosen function. Wrap it in a QUEENS model
Create a new
Functiondriver from your Python functionWrap it into a
Simulationmodel
Run the analysis
First, use a
Griditerator to visualise the surface of your new function.Then, switch to an
Optimisationiterator to search for the minimum.
With these steps, you can quickly test different benchmark functions without changing the overall QUEENS workflow.