1. Lightweight, versatile, and platform agnostic architecture

Optuna is entirely written in Python and has few dependencies. This means that we can quickly move to the real example once you get interested in Optuna.

Quadratic Function Example

Usually, Optuna is used to optimize hyperparameters, but as an example, let’s optimize a simple quadratic function: \((x - 2)^2\).

First of all, import optuna.

import optuna

In optuna, conventionally functions to be optimized are named objective.

def objective(trial):
    x = trial.suggest_float("x", -10, 10)
    return (x - 2) ** 2

This function returns the value of \((x - 2)^2\). Our goal is to find the value of x that minimizes the output of the objective function. This is the “optimization.” During the optimization, Optuna repeatedly calls and evaluates the objective function with different values of x.

A Trial object corresponds to a single execution of the objective function and is internally instantiated upon each invocation of the function.

The suggest APIs (for example, suggest_float()) are called inside the objective function to obtain parameters for a trial. suggest_float() selects parameters uniformly within the range provided. In our example, from \(-10\) to \(10\).

To start the optimization, we create a study object and pass the objective function to method optimize() as follows.

study = optuna.create_study()
study.optimize(objective, n_trials=100)

You can get the best parameter as follows.

best_params = study.best_params
found_x = best_params["x"]
print("Found x: {}, (x - 2)^2: {}".format(found_x, (found_x - 2) ** 2))
Found x: 2.0077359739941096, (x - 2)^2: 5.984529363754058e-05

We can see that the x value found by Optuna is close to the optimal value of 2.

Note

When used to search for hyperparameters in machine learning, usually the objective function would return the loss or accuracy of the model.

Study Object

Let us clarify the terminology in Optuna as follows:

  • Trial: A single call of the objective function

  • Study: An optimization session, which is a set of trials

  • Parameter: A variable whose value is to be optimized, such as x in the above example

In Optuna, we use the study object to manage optimization. Method create_study() returns a study object. A study object has useful properties for analyzing the optimization outcome.

To get the dictionary of parameter name and parameter values:

{'x': 2.0077359739941096}

To get the best observed value of the objective function:

study.best_value
5.984529363754058e-05

To get the best trial:

study.best_trial
FrozenTrial(number=41, values=[5.984529363754058e-05], datetime_start=datetime.datetime(2022, 8, 18, 0, 19, 9, 937418), datetime_complete=datetime.datetime(2022, 8, 18, 0, 19, 9, 940568), params={'x': 2.0077359739941096}, distributions={'x': FloatDistribution(high=10.0, log=False, low=-10.0, step=None)}, user_attrs={}, system_attrs={}, intermediate_values={}, trial_id=41, state=TrialState.COMPLETE, value=None)

To get all trials:

study.trials
[FrozenTrial(number=0, values=[73.8809645998463], datetime_start=datetime.datetime(2022, 8, 18, 0, 19, 9, 820885), datetime_complete=datetime.datetime(2022, 8, 18, 0, 19, 9, 821307), params={'x': -6.595403690336266}, distributions={'x': FloatDistribution(high=10.0, log=False, low=-10.0, step=None)}, user_attrs={}, system_attrs={}, intermediate_values={}, trial_id=0, state=TrialState.COMPLETE, value=None), FrozenTrial(number=1, values=[142.87013220414457], datetime_start=datetime.datetime(2022, 8, 18, 0, 19, 9, 821756), datetime_complete=datetime.datetime(2022, 8, 18, 0, 19, 9, 822035), params={'x': -9.952829464363012}, distributions={'x': FloatDistribution(high=10.0, log=False, low=-10.0, step=None)}, user_attrs={}, system_attrs={}, intermediate_values={}, trial_id=1, state=TrialState.COMPLETE, value=None), FrozenTrial(number=2, values=[14.791812754494181], datetime_start=datetime.datetime(2022, 8, 18, 0, 19, 9, 822455), datetime_complete=datetime.datetime(2022, 8, 18, 0, 19, 9, 822706), params={'x': 5.8460125785668176}, distributions={'x': FloatDistribution(high=10.0, log=False, low=-10.0, step=None)}, user_attrs={}, system_attrs={}, intermediate_values={}, trial_id=2, state=TrialState.COMPLETE, value=None), FrozenTrial(number=3, values=[5.076524888768716], datetime_start=datetime.datetime(2022, 8, 18, 0, 19, 9, 823093), datetime_complete=datetime.datetime(2022, 8, 18, 0, 19, 9, 823353), params={'x': 4.253114486387391}, distributions={'x': FloatDistribution(high=10.0, log=False, low=-10.0, step=None)}, user_attrs={}, system_attrs={}, intermediate_values={}, trial_id=3, state=TrialState.COMPLETE, value=None), FrozenTrial(number=4, values=[1.0701132519563719], datetime_start=datetime.datetime(2022, 8, 18, 0, 19, 9, 823730), datetime_complete=datetime.datetime(2022, 8, 18, 0, 19, 9, 823982), params={'x': 0.9655372157702473}, distributions={'x': FloatDistribution(high=10.0, log=False, low=-10.0, step=None)}, user_attrs={}, system_attrs={}, intermediate_values={}, trial_id=4, state=TrialState.COMPLETE, value=None), FrozenTrial(number=5, values=[0.8507537379259196], datetime_start=datetime.datetime(2022, 8, 18, 0, 19, 9, 824361), datetime_complete=datetime.datetime(2022, 8, 18, 0, 19, 9, 824606), params={'x': 1.0776368730668384}, distributions={'x': FloatDistribution(high=10.0, log=False, low=-10.0, step=None)}, user_attrs={}, system_attrs={}, intermediate_values={}, trial_id=5, state=TrialState.COMPLETE, value=None), FrozenTrial(number=6, values=[0.0792706789731731], datetime_start=datetime.datetime(2022, 8, 18, 0, 19, 9, 824986), datetime_complete=datetime.datetime(2022, 8, 18, 0, 19, 9, 825241), params={'x': 1.7184495090162812}, distributions={'x': FloatDistribution(high=10.0, log=False, low=-10.0, step=None)}, user_attrs={}, system_attrs={}, intermediate_values={}, trial_id=6, state=TrialState.COMPLETE, value=None), FrozenTrial(number=7, values=[0.07355039451832607], datetime_start=datetime.datetime(2022, 8, 18, 0, 19, 9, 825619), datetime_complete=datetime.datetime(2022, 8, 18, 0, 19, 9, 825870), params={'x': 1.7287982402005362}, distributions={'x': FloatDistribution(high=10.0, log=False, low=-10.0, step=None)}, user_attrs={}, system_attrs={}, intermediate_values={}, trial_id=7, state=TrialState.COMPLETE, value=None), FrozenTrial(number=8, values=[45.72006862273602], datetime_start=datetime.datetime(2022, 8, 18, 0, 19, 9, 826247), datetime_complete=datetime.datetime(2022, 8, 18, 0, 19, 9, 826515), params={'x': 8.761661676151508}, distributions={'x': FloatDistribution(high=10.0, log=False, low=-10.0, step=None)}, user_attrs={}, system_attrs={}, intermediate_values={}, trial_id=8, state=TrialState.COMPLETE, value=None), FrozenTrial(number=9, values=[66.31034423367447], datetime_start=datetime.datetime(2022, 8, 18, 0, 19, 9, 826885), datetime_complete=datetime.datetime(2022, 8, 18, 0, 19, 9, 827140), params={'x': -6.143116371124416}, distributions={'x': FloatDistribution(high=10.0, log=False, low=-10.0, step=None)}, user_attrs={}, system_attrs={}, intermediate_values={}, trial_id=9, state=TrialState.COMPLETE, value=None), FrozenTrial(number=10, values=[25.86937810731729], datetime_start=datetime.datetime(2022, 8, 18, 0, 19, 9, 827548), datetime_complete=datetime.datetime(2022, 8, 18, 0, 19, 9, 831054), params={'x': -3.0861948554216134}, distributions={'x': FloatDistribution(high=10.0, log=False, low=-10.0, step=None)}, user_attrs={}, system_attrs={}, intermediate_values={}, trial_id=10, state=TrialState.COMPLETE, value=None), FrozenTrial(number=11, values=[3.122751908684668], datetime_start=datetime.datetime(2022, 8, 18, 0, 19, 9, 831516), datetime_complete=datetime.datetime(2022, 8, 18, 0, 19, 9, 834568), params={'x': 3.7671309823226653}, distributions={'x': FloatDistribution(high=10.0, log=False, low=-10.0, step=None)}, user_attrs={}, system_attrs={}, intermediate_values={}, trial_id=11, state=TrialState.COMPLETE, value=None), FrozenTrial(number=12, values=[11.710062424600492], datetime_start=datetime.datetime(2022, 8, 18, 0, 19, 9, 835082), datetime_complete=datetime.datetime(2022, 8, 18, 0, 19, 9, 838046), params={'x': -1.421996847543915}, distributions={'x': FloatDistribution(high=10.0, log=False, low=-10.0, step=None)}, user_attrs={}, system_attrs={}, intermediate_values={}, trial_id=12, state=TrialState.COMPLETE, value=None), FrozenTrial(number=13, values=[32.41936345793159], datetime_start=datetime.datetime(2022, 8, 18, 0, 19, 9, 838488), datetime_complete=datetime.datetime(2022, 8, 18, 0, 19, 9, 841475), params={'x': 7.693800440648722}, distributions={'x': FloatDistribution(high=10.0, log=False, low=-10.0, step=None)}, user_attrs={}, system_attrs={}, intermediate_values={}, trial_id=13, state=TrialState.COMPLETE, value=None), FrozenTrial(number=14, values=[0.33806624506183247], datetime_start=datetime.datetime(2022, 8, 18, 0, 19, 9, 841901), datetime_complete=datetime.datetime(2022, 8, 18, 0, 19, 9, 844930), params={'x': 2.5814346438438567}, distributions={'x': FloatDistribution(high=10.0, log=False, low=-10.0, step=None)}, user_attrs={}, system_attrs={}, intermediate_values={}, trial_id=14, state=TrialState.COMPLETE, value=None), FrozenTrial(number=15, values=[20.14202532661093], datetime_start=datetime.datetime(2022, 8, 18, 0, 19, 9, 845357), datetime_complete=datetime.datetime(2022, 8, 18, 0, 19, 9, 848395), params={'x': -2.487986778791904}, distributions={'x': FloatDistribution(high=10.0, log=False, low=-10.0, step=None)}, user_attrs={}, system_attrs={}, intermediate_values={}, trial_id=15, state=TrialState.COMPLETE, value=None), FrozenTrial(number=16, values=[17.74867062326389], datetime_start=datetime.datetime(2022, 8, 18, 0, 19, 9, 848821), datetime_complete=datetime.datetime(2022, 8, 18, 0, 19, 9, 851892), params={'x': 6.212917115641357}, distributions={'x': FloatDistribution(high=10.0, log=False, low=-10.0, step=None)}, user_attrs={}, system_attrs={}, intermediate_values={}, trial_id=16, state=TrialState.COMPLETE, value=None), FrozenTrial(number=17, values=[0.5728958576625374], datetime_start=datetime.datetime(2022, 8, 18, 0, 19, 9, 852319), datetime_complete=datetime.datetime(2022, 8, 18, 0, 19, 9, 855321), params={'x': 1.2431011575761677}, distributions={'x': FloatDistribution(high=10.0, log=False, low=-10.0, step=None)}, user_attrs={}, system_attrs={}, intermediate_values={}, trial_id=17, state=TrialState.COMPLETE, value=None), FrozenTrial(number=18, values=[6.197797190981864], datetime_start=datetime.datetime(2022, 8, 18, 0, 19, 9, 855744), datetime_complete=datetime.datetime(2022, 8, 18, 0, 19, 9, 858720), params={'x': -0.4895375456059834}, distributions={'x': FloatDistribution(high=10.0, log=False, low=-10.0, step=None)}, user_attrs={}, system_attrs={}, intermediate_values={}, trial_id=18, state=TrialState.COMPLETE, value=None), FrozenTrial(number=19, values=[42.87308648729982], datetime_start=datetime.datetime(2022, 8, 18, 0, 19, 9, 859151), datetime_complete=datetime.datetime(2022, 8, 18, 0, 19, 9, 862138), params={'x': -4.547754308715303}, distributions={'x': FloatDistribution(high=10.0, log=False, low=-10.0, step=None)}, user_attrs={}, system_attrs={}, intermediate_values={}, trial_id=19, state=TrialState.COMPLETE, value=None), FrozenTrial(number=20, values=[1.4585855973329624], datetime_start=datetime.datetime(2022, 8, 18, 0, 19, 9, 862759), datetime_complete=datetime.datetime(2022, 8, 18, 0, 19, 9, 865789), params={'x': 3.2077191715514672}, distributions={'x': FloatDistribution(high=10.0, log=False, low=-10.0, step=None)}, user_attrs={}, system_attrs={}, intermediate_values={}, trial_id=20, state=TrialState.COMPLETE, value=None), FrozenTrial(number=21, values=[0.4805838389467523], datetime_start=datetime.datetime(2022, 8, 18, 0, 19, 9, 866224), datetime_complete=datetime.datetime(2022, 8, 18, 0, 19, 9, 869267), params={'x': 1.3067584555533676}, distributions={'x': FloatDistribution(high=10.0, log=False, low=-10.0, step=None)}, user_attrs={}, system_attrs={}, intermediate_values={}, trial_id=21, state=TrialState.COMPLETE, value=None), FrozenTrial(number=22, values=[1.1069546636825602], datetime_start=datetime.datetime(2022, 8, 18, 0, 19, 9, 869694), datetime_complete=datetime.datetime(2022, 8, 18, 0, 19, 9, 872746), params={'x': 3.0521191299860297}, distributions={'x': FloatDistribution(high=10.0, log=False, low=-10.0, step=None)}, user_attrs={}, system_attrs={}, intermediate_values={}, trial_id=22, state=TrialState.COMPLETE, value=None), FrozenTrial(number=23, values=[11.858368220446552], datetime_start=datetime.datetime(2022, 8, 18, 0, 19, 9, 873181), datetime_complete=datetime.datetime(2022, 8, 18, 0, 19, 9, 876239), params={'x': 5.443598150256001}, distributions={'x': FloatDistribution(high=10.0, log=False, low=-10.0, step=None)}, user_attrs={}, system_attrs={}, intermediate_values={}, trial_id=23, state=TrialState.COMPLETE, value=None), FrozenTrial(number=24, values=[0.2622328537443612], datetime_start=datetime.datetime(2022, 8, 18, 0, 19, 9, 876668), datetime_complete=datetime.datetime(2022, 8, 18, 0, 19, 9, 879796), params={'x': 2.512086763883193}, distributions={'x': FloatDistribution(high=10.0, log=False, low=-10.0, step=None)}, user_attrs={}, system_attrs={}, intermediate_values={}, trial_id=24, state=TrialState.COMPLETE, value=None), FrozenTrial(number=25, values=[7.490180481095434], datetime_start=datetime.datetime(2022, 8, 18, 0, 19, 9, 880224), datetime_complete=datetime.datetime(2022, 8, 18, 0, 19, 9, 883306), params={'x': -0.7368194096606802}, distributions={'x': FloatDistribution(high=10.0, log=False, low=-10.0, step=None)}, user_attrs={}, system_attrs={}, intermediate_values={}, trial_id=25, state=TrialState.COMPLETE, value=None), FrozenTrial(number=26, values=[27.929988424424593], datetime_start=datetime.datetime(2022, 8, 18, 0, 19, 9, 883736), datetime_complete=datetime.datetime(2022, 8, 18, 0, 19, 9, 886764), params={'x': 7.2848830095305415}, distributions={'x': FloatDistribution(high=10.0, log=False, low=-10.0, step=None)}, user_attrs={}, system_attrs={}, intermediate_values={}, trial_id=26, state=TrialState.COMPLETE, value=None), FrozenTrial(number=27, values=[6.2313358253040425], datetime_start=datetime.datetime(2022, 8, 18, 0, 19, 9, 887221), datetime_complete=datetime.datetime(2022, 8, 18, 0, 19, 9, 890259), params={'x': 4.4962643740806065}, distributions={'x': FloatDistribution(high=10.0, log=False, low=-10.0, step=None)}, user_attrs={}, system_attrs={}, intermediate_values={}, trial_id=27, state=TrialState.COMPLETE, value=None), FrozenTrial(number=28, values=[0.012467363722369038], datetime_start=datetime.datetime(2022, 8, 18, 0, 19, 9, 890704), datetime_complete=datetime.datetime(2022, 8, 18, 0, 19, 9, 893788), params={'x': 2.111657349611967}, distributions={'x': FloatDistribution(high=10.0, log=False, low=-10.0, step=None)}, user_attrs={}, system_attrs={}, intermediate_values={}, trial_id=28, state=TrialState.COMPLETE, value=None), FrozenTrial(number=29, values=[18.408468202965924], datetime_start=datetime.datetime(2022, 8, 18, 0, 19, 9, 894217), datetime_complete=datetime.datetime(2022, 8, 18, 0, 19, 9, 897336), params={'x': -2.2905090843588622}, distributions={'x': FloatDistribution(high=10.0, log=False, low=-10.0, step=None)}, user_attrs={}, system_attrs={}, intermediate_values={}, trial_id=29, state=TrialState.COMPLETE, value=None), FrozenTrial(number=30, values=[37.55023974277399], datetime_start=datetime.datetime(2022, 8, 18, 0, 19, 9, 897767), datetime_complete=datetime.datetime(2022, 8, 18, 0, 19, 9, 901166), params={'x': -4.127825041788807}, distributions={'x': FloatDistribution(high=10.0, log=False, low=-10.0, step=None)}, user_attrs={}, system_attrs={}, intermediate_values={}, trial_id=30, state=TrialState.COMPLETE, value=None), FrozenTrial(number=31, values=[0.08408613761611024], datetime_start=datetime.datetime(2022, 8, 18, 0, 19, 9, 901596), datetime_complete=datetime.datetime(2022, 8, 18, 0, 19, 9, 904746), params={'x': 2.2899760983531405}, distributions={'x': FloatDistribution(high=10.0, log=False, low=-10.0, step=None)}, user_attrs={}, system_attrs={}, intermediate_values={}, trial_id=31, state=TrialState.COMPLETE, value=None), FrozenTrial(number=32, values=[3.2604092707597823], datetime_start=datetime.datetime(2022, 8, 18, 0, 19, 9, 905181), datetime_complete=datetime.datetime(2022, 8, 18, 0, 19, 9, 908379), params={'x': 0.19433965797556985}, distributions={'x': FloatDistribution(high=10.0, log=False, low=-10.0, step=None)}, user_attrs={}, system_attrs={}, intermediate_values={}, trial_id=32, state=TrialState.COMPLETE, value=None), FrozenTrial(number=33, values=[115.95912876938775], datetime_start=datetime.datetime(2022, 8, 18, 0, 19, 9, 908812), datetime_complete=datetime.datetime(2022, 8, 18, 0, 19, 9, 911938), params={'x': -8.768432047860438}, distributions={'x': FloatDistribution(high=10.0, log=False, low=-10.0, step=None)}, user_attrs={}, system_attrs={}, intermediate_values={}, trial_id=33, state=TrialState.COMPLETE, value=None), FrozenTrial(number=34, values=[0.11303825369800682], datetime_start=datetime.datetime(2022, 8, 18, 0, 19, 9, 912379), datetime_complete=datetime.datetime(2022, 8, 18, 0, 19, 9, 915509), params={'x': 2.3362116204089425}, distributions={'x': FloatDistribution(high=10.0, log=False, low=-10.0, step=None)}, user_attrs={}, system_attrs={}, intermediate_values={}, trial_id=34, state=TrialState.COMPLETE, value=None), FrozenTrial(number=35, values=[9.498576715404019], datetime_start=datetime.datetime(2022, 8, 18, 0, 19, 9, 915947), datetime_complete=datetime.datetime(2022, 8, 18, 0, 19, 9, 919049), params={'x': 5.081976105586158}, distributions={'x': FloatDistribution(high=10.0, log=False, low=-10.0, step=None)}, user_attrs={}, system_attrs={}, intermediate_values={}, trial_id=35, state=TrialState.COMPLETE, value=None), FrozenTrial(number=36, values=[3.2262256900340733], datetime_start=datetime.datetime(2022, 8, 18, 0, 19, 9, 919511), datetime_complete=datetime.datetime(2022, 8, 18, 0, 19, 9, 922633), params={'x': 0.20383027248701424}, distributions={'x': FloatDistribution(high=10.0, log=False, low=-10.0, step=None)}, user_attrs={}, system_attrs={}, intermediate_values={}, trial_id=36, state=TrialState.COMPLETE, value=None), FrozenTrial(number=37, values=[0.053214311116219604], datetime_start=datetime.datetime(2022, 8, 18, 0, 19, 9, 923067), datetime_complete=datetime.datetime(2022, 8, 18, 0, 19, 9, 926195), params={'x': 1.7693177269137925}, distributions={'x': FloatDistribution(high=10.0, log=False, low=-10.0, step=None)}, user_attrs={}, system_attrs={}, intermediate_values={}, trial_id=37, state=TrialState.COMPLETE, value=None), FrozenTrial(number=38, values=[10.706662293037777], datetime_start=datetime.datetime(2022, 8, 18, 0, 19, 9, 926645), datetime_complete=datetime.datetime(2022, 8, 18, 0, 19, 9, 929777), params={'x': -1.2721036494948899}, distributions={'x': FloatDistribution(high=10.0, log=False, low=-10.0, step=None)}, user_attrs={}, system_attrs={}, intermediate_values={}, trial_id=38, state=TrialState.COMPLETE, value=None), FrozenTrial(number=39, values=[0.24743821997004925], datetime_start=datetime.datetime(2022, 8, 18, 0, 19, 9, 930210), datetime_complete=datetime.datetime(2022, 8, 18, 0, 19, 9, 933343), params={'x': 1.5025683765882498}, distributions={'x': FloatDistribution(high=10.0, log=False, low=-10.0, step=None)}, user_attrs={}, system_attrs={}, intermediate_values={}, trial_id=39, state=TrialState.COMPLETE, value=None), FrozenTrial(number=40, values=[4.563372096288087], datetime_start=datetime.datetime(2022, 8, 18, 0, 19, 9, 933775), datetime_complete=datetime.datetime(2022, 8, 18, 0, 19, 9, 936985), params={'x': 4.1362050688751975}, distributions={'x': FloatDistribution(high=10.0, log=False, low=-10.0, step=None)}, user_attrs={}, system_attrs={}, intermediate_values={}, trial_id=40, state=TrialState.COMPLETE, value=None), FrozenTrial(number=41, values=[5.984529363754058e-05], datetime_start=datetime.datetime(2022, 8, 18, 0, 19, 9, 937418), datetime_complete=datetime.datetime(2022, 8, 18, 0, 19, 9, 940568), params={'x': 2.0077359739941096}, distributions={'x': FloatDistribution(high=10.0, log=False, low=-10.0, step=None)}, user_attrs={}, system_attrs={}, intermediate_values={}, trial_id=41, state=TrialState.COMPLETE, value=None), FrozenTrial(number=42, values=[2.413579975401861], datetime_start=datetime.datetime(2022, 8, 18, 0, 19, 9, 941005), datetime_complete=datetime.datetime(2022, 8, 18, 0, 19, 9, 944167), params={'x': 0.4464299258154265}, distributions={'x': FloatDistribution(high=10.0, log=False, low=-10.0, step=None)}, user_attrs={}, system_attrs={}, intermediate_values={}, trial_id=42, state=TrialState.COMPLETE, value=None), FrozenTrial(number=43, values=[2.9218644891435575], datetime_start=datetime.datetime(2022, 8, 18, 0, 19, 9, 944603), datetime_complete=datetime.datetime(2022, 8, 18, 0, 19, 9, 947961), params={'x': 3.7093462168746147}, distributions={'x': FloatDistribution(high=10.0, log=False, low=-10.0, step=None)}, user_attrs={}, system_attrs={}, intermediate_values={}, trial_id=43, state=TrialState.COMPLETE, value=None), FrozenTrial(number=44, values=[0.027098625441956865], datetime_start=datetime.datetime(2022, 8, 18, 0, 19, 9, 948400), datetime_complete=datetime.datetime(2022, 8, 18, 0, 19, 9, 951593), params={'x': 1.8353833986441317}, distributions={'x': FloatDistribution(high=10.0, log=False, low=-10.0, step=None)}, user_attrs={}, system_attrs={}, intermediate_values={}, trial_id=44, state=TrialState.COMPLETE, value=None), FrozenTrial(number=45, values=[0.02911670235783985], datetime_start=datetime.datetime(2022, 8, 18, 0, 19, 9, 952031), datetime_complete=datetime.datetime(2022, 8, 18, 0, 19, 9, 955263), params={'x': 1.8293638304525097}, distributions={'x': FloatDistribution(high=10.0, log=False, low=-10.0, step=None)}, user_attrs={}, system_attrs={}, intermediate_values={}, trial_id=45, state=TrialState.COMPLETE, value=None), FrozenTrial(number=46, values=[20.0511204381943], datetime_start=datetime.datetime(2022, 8, 18, 0, 19, 9, 955700), datetime_complete=datetime.datetime(2022, 8, 18, 0, 19, 9, 958857), params={'x': 6.477847746205123}, distributions={'x': FloatDistribution(high=10.0, log=False, low=-10.0, step=None)}, user_attrs={}, system_attrs={}, intermediate_values={}, trial_id=46, state=TrialState.COMPLETE, value=None), FrozenTrial(number=47, values=[1.3371094883357189], datetime_start=datetime.datetime(2022, 8, 18, 0, 19, 9, 959325), datetime_complete=datetime.datetime(2022, 8, 18, 0, 19, 9, 962501), params={'x': 0.8436654946185689}, distributions={'x': FloatDistribution(high=10.0, log=False, low=-10.0, step=None)}, user_attrs={}, system_attrs={}, intermediate_values={}, trial_id=47, state=TrialState.COMPLETE, value=None), FrozenTrial(number=48, values=[8.620592719869078], datetime_start=datetime.datetime(2022, 8, 18, 0, 19, 9, 962938), datetime_complete=datetime.datetime(2022, 8, 18, 0, 19, 9, 966112), params={'x': 4.9360845900397825}, distributions={'x': FloatDistribution(high=10.0, log=False, low=-10.0, step=None)}, user_attrs={}, system_attrs={}, intermediate_values={}, trial_id=48, state=TrialState.COMPLETE, value=None), FrozenTrial(number=49, values=[13.323150042320465], datetime_start=datetime.datetime(2022, 8, 18, 0, 19, 9, 966566), datetime_complete=datetime.datetime(2022, 8, 18, 0, 19, 9, 969727), params={'x': -1.6500890458070285}, distributions={'x': FloatDistribution(high=10.0, log=False, low=-10.0, step=None)}, user_attrs={}, system_attrs={}, intermediate_values={}, trial_id=49, state=TrialState.COMPLETE, value=None), FrozenTrial(number=50, values=[6.469390240124633], datetime_start=datetime.datetime(2022, 8, 18, 0, 19, 9, 970164), datetime_complete=datetime.datetime(2022, 8, 18, 0, 19, 9, 973343), params={'x': -0.5434996048996417}, distributions={'x': FloatDistribution(high=10.0, log=False, low=-10.0, step=None)}, user_attrs={}, system_attrs={}, intermediate_values={}, trial_id=50, state=TrialState.COMPLETE, value=None), FrozenTrial(number=51, values=[0.021108924263830306], datetime_start=datetime.datetime(2022, 8, 18, 0, 19, 9, 973785), datetime_complete=datetime.datetime(2022, 8, 18, 0, 19, 9, 976967), params={'x': 1.854710894201147}, distributions={'x': FloatDistribution(high=10.0, log=False, low=-10.0, step=None)}, user_attrs={}, system_attrs={}, intermediate_values={}, trial_id=51, state=TrialState.COMPLETE, value=None), FrozenTrial(number=52, values=[1.3699784506994899], datetime_start=datetime.datetime(2022, 8, 18, 0, 19, 9, 977408), datetime_complete=datetime.datetime(2022, 8, 18, 0, 19, 9, 980635), params={'x': 3.1704607856308087}, distributions={'x': FloatDistribution(high=10.0, log=False, low=-10.0, step=None)}, user_attrs={}, system_attrs={}, intermediate_values={}, trial_id=52, state=TrialState.COMPLETE, value=None), FrozenTrial(number=53, values=[0.002060679493319655], datetime_start=datetime.datetime(2022, 8, 18, 0, 19, 9, 981076), datetime_complete=datetime.datetime(2022, 8, 18, 0, 19, 9, 984238), params={'x': 1.9546052922322474}, distributions={'x': FloatDistribution(high=10.0, log=False, low=-10.0, step=None)}, user_attrs={}, system_attrs={}, intermediate_values={}, trial_id=53, state=TrialState.COMPLETE, value=None), FrozenTrial(number=54, values=[0.02216292609965159], datetime_start=datetime.datetime(2022, 8, 18, 0, 19, 9, 984678), datetime_complete=datetime.datetime(2022, 8, 18, 0, 19, 9, 987853), params={'x': 1.8511278195912628}, distributions={'x': FloatDistribution(high=10.0, log=False, low=-10.0, step=None)}, user_attrs={}, system_attrs={}, intermediate_values={}, trial_id=54, state=TrialState.COMPLETE, value=None), FrozenTrial(number=55, values=[3.3318439461117], datetime_start=datetime.datetime(2022, 8, 18, 0, 19, 9, 988292), datetime_complete=datetime.datetime(2022, 8, 18, 0, 19, 9, 991509), params={'x': 3.82533392728884}, distributions={'x': FloatDistribution(high=10.0, log=False, low=-10.0, step=None)}, user_attrs={}, system_attrs={}, intermediate_values={}, trial_id=55, state=TrialState.COMPLETE, value=None), FrozenTrial(number=56, values=[1.0115481269293827], datetime_start=datetime.datetime(2022, 8, 18, 0, 19, 9, 991951), datetime_complete=datetime.datetime(2022, 8, 18, 0, 19, 9, 995449), params={'x': 3.005757489124184}, distributions={'x': FloatDistribution(high=10.0, log=False, low=-10.0, step=None)}, user_attrs={}, system_attrs={}, intermediate_values={}, trial_id=56, state=TrialState.COMPLETE, value=None), FrozenTrial(number=57, values=[1.3822980578156185], datetime_start=datetime.datetime(2022, 8, 18, 0, 19, 9, 995891), datetime_complete=datetime.datetime(2022, 8, 18, 0, 19, 9, 999061), params={'x': 0.8242882760575965}, distributions={'x': FloatDistribution(high=10.0, log=False, low=-10.0, step=None)}, user_attrs={}, system_attrs={}, intermediate_values={}, trial_id=57, state=TrialState.COMPLETE, value=None), FrozenTrial(number=58, values=[5.105288101829534], datetime_start=datetime.datetime(2022, 8, 18, 0, 19, 9, 999526), datetime_complete=datetime.datetime(2022, 8, 18, 0, 19, 10, 2677), params={'x': -0.25948846021163274}, distributions={'x': FloatDistribution(high=10.0, log=False, low=-10.0, step=None)}, user_attrs={}, system_attrs={}, intermediate_values={}, trial_id=58, state=TrialState.COMPLETE, value=None), FrozenTrial(number=59, values=[0.00786593083105928], datetime_start=datetime.datetime(2022, 8, 18, 0, 19, 10, 3117), datetime_complete=datetime.datetime(2022, 8, 18, 0, 19, 10, 6268), params={'x': 2.0886900830479895}, distributions={'x': FloatDistribution(high=10.0, log=False, low=-10.0, step=None)}, user_attrs={}, system_attrs={}, intermediate_values={}, trial_id=59, state=TrialState.COMPLETE, value=None), FrozenTrial(number=60, values=[6.420609621364218], datetime_start=datetime.datetime(2022, 8, 18, 0, 19, 10, 6727), datetime_complete=datetime.datetime(2022, 8, 18, 0, 19, 10, 9907), params={'x': 4.533892188188799}, distributions={'x': FloatDistribution(high=10.0, log=False, low=-10.0, step=None)}, user_attrs={}, system_attrs={}, intermediate_values={}, trial_id=60, state=TrialState.COMPLETE, value=None), FrozenTrial(number=61, values=[0.007996469916135845], datetime_start=datetime.datetime(2022, 8, 18, 0, 19, 10, 10350), datetime_complete=datetime.datetime(2022, 8, 18, 0, 19, 10, 13527), params={'x': 1.9105770168461382}, distributions={'x': FloatDistribution(high=10.0, log=False, low=-10.0, step=None)}, user_attrs={}, system_attrs={}, intermediate_values={}, trial_id=61, state=TrialState.COMPLETE, value=None), FrozenTrial(number=62, values=[63.05609694875464], datetime_start=datetime.datetime(2022, 8, 18, 0, 19, 10, 13969), datetime_complete=datetime.datetime(2022, 8, 18, 0, 19, 10, 17216), params={'x': 9.940786922513073}, distributions={'x': FloatDistribution(high=10.0, log=False, low=-10.0, step=None)}, user_attrs={}, system_attrs={}, intermediate_values={}, trial_id=62, state=TrialState.COMPLETE, value=None), FrozenTrial(number=63, values=[0.13952300278947763], datetime_start=datetime.datetime(2022, 8, 18, 0, 19, 10, 17658), datetime_complete=datetime.datetime(2022, 8, 18, 0, 19, 10, 20870), params={'x': 2.373527780478879}, distributions={'x': FloatDistribution(high=10.0, log=False, low=-10.0, step=None)}, user_attrs={}, system_attrs={}, intermediate_values={}, trial_id=63, state=TrialState.COMPLETE, value=None), FrozenTrial(number=64, values=[1.4770967273207858], datetime_start=datetime.datetime(2022, 8, 18, 0, 19, 10, 21313), datetime_complete=datetime.datetime(2022, 8, 18, 0, 19, 10, 24544), params={'x': 0.7846413174207435}, distributions={'x': FloatDistribution(high=10.0, log=False, low=-10.0, step=None)}, user_attrs={}, system_attrs={}, intermediate_values={}, trial_id=64, state=TrialState.COMPLETE, value=None), FrozenTrial(number=65, values=[1.7973900519904846], datetime_start=datetime.datetime(2022, 8, 18, 0, 19, 10, 24987), datetime_complete=datetime.datetime(2022, 8, 18, 0, 19, 10, 28198), params={'x': 3.3406677634635975}, distributions={'x': FloatDistribution(high=10.0, log=False, low=-10.0, step=None)}, user_attrs={}, system_attrs={}, intermediate_values={}, trial_id=65, state=TrialState.COMPLETE, value=None), FrozenTrial(number=66, values=[0.6177754740202653], datetime_start=datetime.datetime(2022, 8, 18, 0, 19, 10, 28641), datetime_complete=datetime.datetime(2022, 8, 18, 0, 19, 10, 31924), params={'x': 2.785986942652526}, distributions={'x': FloatDistribution(high=10.0, log=False, low=-10.0, step=None)}, user_attrs={}, system_attrs={}, intermediate_values={}, trial_id=66, state=TrialState.COMPLETE, value=None), FrozenTrial(number=67, values=[0.4812625919303426], datetime_start=datetime.datetime(2022, 8, 18, 0, 19, 10, 32368), datetime_complete=datetime.datetime(2022, 8, 18, 0, 19, 10, 35600), params={'x': 1.3062690781503663}, distributions={'x': FloatDistribution(high=10.0, log=False, low=-10.0, step=None)}, user_attrs={}, system_attrs={}, intermediate_values={}, trial_id=67, state=TrialState.COMPLETE, value=None), FrozenTrial(number=68, values=[0.06728694842616834], datetime_start=datetime.datetime(2022, 8, 18, 0, 19, 10, 36043), datetime_complete=datetime.datetime(2022, 8, 18, 0, 19, 10, 39266), params={'x': 2.259397279141799}, distributions={'x': FloatDistribution(high=10.0, log=False, low=-10.0, step=None)}, user_attrs={}, system_attrs={}, intermediate_values={}, trial_id=68, state=TrialState.COMPLETE, value=None), FrozenTrial(number=69, values=[9.56987784245638], datetime_start=datetime.datetime(2022, 8, 18, 0, 19, 10, 39708), datetime_complete=datetime.datetime(2022, 8, 18, 0, 19, 10, 42934), params={'x': -1.0935219156256806}, distributions={'x': FloatDistribution(high=10.0, log=False, low=-10.0, step=None)}, user_attrs={}, system_attrs={}, intermediate_values={}, trial_id=69, state=TrialState.COMPLETE, value=None), FrozenTrial(number=70, values=[4.609380945022113], datetime_start=datetime.datetime(2022, 8, 18, 0, 19, 10, 43397), datetime_complete=datetime.datetime(2022, 8, 18, 0, 19, 10, 46628), params={'x': -0.14694688919454024}, distributions={'x': FloatDistribution(high=10.0, log=False, low=-10.0, step=None)}, user_attrs={}, system_attrs={}, intermediate_values={}, trial_id=70, state=TrialState.COMPLETE, value=None), FrozenTrial(number=71, values=[0.03608679800814665], datetime_start=datetime.datetime(2022, 8, 18, 0, 19, 10, 47075), datetime_complete=datetime.datetime(2022, 8, 18, 0, 19, 10, 50269), params={'x': 1.810034745260754}, distributions={'x': FloatDistribution(high=10.0, log=False, low=-10.0, step=None)}, user_attrs={}, system_attrs={}, intermediate_values={}, trial_id=71, state=TrialState.COMPLETE, value=None), FrozenTrial(number=72, values=[2.807497889121854], datetime_start=datetime.datetime(2022, 8, 18, 0, 19, 10, 50736), datetime_complete=datetime.datetime(2022, 8, 18, 0, 19, 10, 54262), params={'x': 3.675558978109053}, distributions={'x': FloatDistribution(high=10.0, log=False, low=-10.0, step=None)}, user_attrs={}, system_attrs={}, intermediate_values={}, trial_id=72, state=TrialState.COMPLETE, value=None), FrozenTrial(number=73, values=[1.8090266947034848], datetime_start=datetime.datetime(2022, 8, 18, 0, 19, 10, 54868), datetime_complete=datetime.datetime(2022, 8, 18, 0, 19, 10, 58101), params={'x': 0.6549993699988521}, distributions={'x': FloatDistribution(high=10.0, log=False, low=-10.0, step=None)}, user_attrs={}, system_attrs={}, intermediate_values={}, trial_id=73, state=TrialState.COMPLETE, value=None), FrozenTrial(number=74, values=[0.004577776655326875], datetime_start=datetime.datetime(2022, 8, 18, 0, 19, 10, 58561), datetime_complete=datetime.datetime(2022, 8, 18, 0, 19, 10, 61773), params={'x': 2.0676592688057363}, distributions={'x': FloatDistribution(high=10.0, log=False, low=-10.0, step=None)}, user_attrs={}, system_attrs={}, intermediate_values={}, trial_id=74, state=TrialState.COMPLETE, value=None), FrozenTrial(number=75, values=[0.6505021754958192], datetime_start=datetime.datetime(2022, 8, 18, 0, 19, 10, 62219), datetime_complete=datetime.datetime(2022, 8, 18, 0, 19, 10, 65471), params={'x': 1.1934628492773447}, distributions={'x': FloatDistribution(high=10.0, log=False, low=-10.0, step=None)}, user_attrs={}, system_attrs={}, intermediate_values={}, trial_id=75, state=TrialState.COMPLETE, value=None), FrozenTrial(number=76, values=[0.4824779351044481], datetime_start=datetime.datetime(2022, 8, 18, 0, 19, 10, 65917), datetime_complete=datetime.datetime(2022, 8, 18, 0, 19, 10, 69199), params={'x': 2.6946063166315493}, distributions={'x': FloatDistribution(high=10.0, log=False, low=-10.0, step=None)}, user_attrs={}, system_attrs={}, intermediate_values={}, trial_id=76, state=TrialState.COMPLETE, value=None), FrozenTrial(number=77, values=[14.790951232633597], datetime_start=datetime.datetime(2022, 8, 18, 0, 19, 10, 69644), datetime_complete=datetime.datetime(2022, 8, 18, 0, 19, 10, 72950), params={'x': 5.8459005749802735}, distributions={'x': FloatDistribution(high=10.0, log=False, low=-10.0, step=None)}, user_attrs={}, system_attrs={}, intermediate_values={}, trial_id=77, state=TrialState.COMPLETE, value=None), FrozenTrial(number=78, values=[3.163275223076919], datetime_start=datetime.datetime(2022, 8, 18, 0, 19, 10, 73395), datetime_complete=datetime.datetime(2022, 8, 18, 0, 19, 10, 76667), params={'x': 0.22144012665389323}, distributions={'x': FloatDistribution(high=10.0, log=False, low=-10.0, step=None)}, user_attrs={}, system_attrs={}, intermediate_values={}, trial_id=78, state=TrialState.COMPLETE, value=None), FrozenTrial(number=79, values=[0.0023123776433160935], datetime_start=datetime.datetime(2022, 8, 18, 0, 19, 10, 77114), datetime_complete=datetime.datetime(2022, 8, 18, 0, 19, 10, 80381), params={'x': 1.9519128120668707}, distributions={'x': FloatDistribution(high=10.0, log=False, low=-10.0, step=None)}, user_attrs={}, system_attrs={}, intermediate_values={}, trial_id=79, state=TrialState.COMPLETE, value=None), FrozenTrial(number=80, values=[5.428416402759647], datetime_start=datetime.datetime(2022, 8, 18, 0, 19, 10, 80830), datetime_complete=datetime.datetime(2022, 8, 18, 0, 19, 10, 84128), params={'x': 4.329896221457009}, distributions={'x': FloatDistribution(high=10.0, log=False, low=-10.0, step=None)}, user_attrs={}, system_attrs={}, intermediate_values={}, trial_id=80, state=TrialState.COMPLETE, value=None), FrozenTrial(number=81, values=[8.264090977718614e-05], datetime_start=datetime.datetime(2022, 8, 18, 0, 19, 10, 84578), datetime_complete=datetime.datetime(2022, 8, 18, 0, 19, 10, 87891), params={'x': 2.0090907045808994}, distributions={'x': FloatDistribution(high=10.0, log=False, low=-10.0, step=None)}, user_attrs={}, system_attrs={}, intermediate_values={}, trial_id=81, state=TrialState.COMPLETE, value=None), FrozenTrial(number=82, values=[0.07048993791673652], datetime_start=datetime.datetime(2022, 8, 18, 0, 19, 10, 88340), datetime_complete=datetime.datetime(2022, 8, 18, 0, 19, 10, 91652), params={'x': 2.265499412271923}, distributions={'x': FloatDistribution(high=10.0, log=False, low=-10.0, step=None)}, user_attrs={}, system_attrs={}, intermediate_values={}, trial_id=82, state=TrialState.COMPLETE, value=None), FrozenTrial(number=83, values=[2.0851721073356217], datetime_start=datetime.datetime(2022, 8, 18, 0, 19, 10, 92103), datetime_complete=datetime.datetime(2022, 8, 18, 0, 19, 10, 95385), params={'x': 3.4440125024859105}, distributions={'x': FloatDistribution(high=10.0, log=False, low=-10.0, step=None)}, user_attrs={}, system_attrs={}, intermediate_values={}, trial_id=83, state=TrialState.COMPLETE, value=None), FrozenTrial(number=84, values=[0.44742885309926766], datetime_start=datetime.datetime(2022, 8, 18, 0, 19, 10, 95837), datetime_complete=datetime.datetime(2022, 8, 18, 0, 19, 10, 99081), params={'x': 1.3310987717911802}, distributions={'x': FloatDistribution(high=10.0, log=False, low=-10.0, step=None)}, user_attrs={}, system_attrs={}, intermediate_values={}, trial_id=84, state=TrialState.COMPLETE, value=None), FrozenTrial(number=85, values=[0.596568810793877], datetime_start=datetime.datetime(2022, 8, 18, 0, 19, 10, 99560), datetime_complete=datetime.datetime(2022, 8, 18, 0, 19, 10, 102824), params={'x': 2.7723786705974454}, distributions={'x': FloatDistribution(high=10.0, log=False, low=-10.0, step=None)}, user_attrs={}, system_attrs={}, intermediate_values={}, trial_id=85, state=TrialState.COMPLETE, value=None), FrozenTrial(number=86, values=[0.0025612325768237243], datetime_start=datetime.datetime(2022, 8, 18, 0, 19, 10, 103300), datetime_complete=datetime.datetime(2022, 8, 18, 0, 19, 10, 106584), params={'x': 1.9493913784338703}, distributions={'x': FloatDistribution(high=10.0, log=False, low=-10.0, step=None)}, user_attrs={}, system_attrs={}, intermediate_values={}, trial_id=86, state=TrialState.COMPLETE, value=None), FrozenTrial(number=87, values=[4.178208976443955], datetime_start=datetime.datetime(2022, 8, 18, 0, 19, 10, 107048), datetime_complete=datetime.datetime(2022, 8, 18, 0, 19, 10, 110879), params={'x': 4.04406677396898}, distributions={'x': FloatDistribution(high=10.0, log=False, low=-10.0, step=None)}, user_attrs={}, system_attrs={}, intermediate_values={}, trial_id=87, state=TrialState.COMPLETE, value=None), FrozenTrial(number=88, values=[2.65646304649942], datetime_start=datetime.datetime(2022, 8, 18, 0, 19, 10, 111377), datetime_complete=datetime.datetime(2022, 8, 18, 0, 19, 10, 114989), params={'x': 0.37013404032742003}, distributions={'x': FloatDistribution(high=10.0, log=False, low=-10.0, step=None)}, user_attrs={}, system_attrs={}, intermediate_values={}, trial_id=88, state=TrialState.COMPLETE, value=None), FrozenTrial(number=89, values=[0.8662856340016426], datetime_start=datetime.datetime(2022, 8, 18, 0, 19, 10, 115471), datetime_complete=datetime.datetime(2022, 8, 18, 0, 19, 10, 118757), params={'x': 1.0692553336163335}, distributions={'x': FloatDistribution(high=10.0, log=False, low=-10.0, step=None)}, user_attrs={}, system_attrs={}, intermediate_values={}, trial_id=89, state=TrialState.COMPLETE, value=None), FrozenTrial(number=90, values=[0.03221073268135897], datetime_start=datetime.datetime(2022, 8, 18, 0, 19, 10, 119234), datetime_complete=datetime.datetime(2022, 8, 18, 0, 19, 10, 122520), params={'x': 2.179473487405129}, distributions={'x': FloatDistribution(high=10.0, log=False, low=-10.0, step=None)}, user_attrs={}, system_attrs={}, intermediate_values={}, trial_id=90, state=TrialState.COMPLETE, value=None), FrozenTrial(number=91, values=[0.05328396350784812], datetime_start=datetime.datetime(2022, 8, 18, 0, 19, 10, 122971), datetime_complete=datetime.datetime(2022, 8, 18, 0, 19, 10, 126255), params={'x': 1.7691668058795527}, distributions={'x': FloatDistribution(high=10.0, log=False, low=-10.0, step=None)}, user_attrs={}, system_attrs={}, intermediate_values={}, trial_id=91, state=TrialState.COMPLETE, value=None), FrozenTrial(number=92, values=[1.866233369957946], datetime_start=datetime.datetime(2022, 8, 18, 0, 19, 10, 126760), datetime_complete=datetime.datetime(2022, 8, 18, 0, 19, 10, 130039), params={'x': 3.366101522566294}, distributions={'x': FloatDistribution(high=10.0, log=False, low=-10.0, step=None)}, user_attrs={}, system_attrs={}, intermediate_values={}, trial_id=92, state=TrialState.COMPLETE, value=None), FrozenTrial(number=93, values=[0.9542195728569262], datetime_start=datetime.datetime(2022, 8, 18, 0, 19, 10, 130504), datetime_complete=datetime.datetime(2022, 8, 18, 0, 19, 10, 133785), params={'x': 2.976841631410602}, distributions={'x': FloatDistribution(high=10.0, log=False, low=-10.0, step=None)}, user_attrs={}, system_attrs={}, intermediate_values={}, trial_id=93, state=TrialState.COMPLETE, value=None), FrozenTrial(number=94, values=[0.0010258940378253551], datetime_start=datetime.datetime(2022, 8, 18, 0, 19, 10, 134239), datetime_complete=datetime.datetime(2022, 8, 18, 0, 19, 10, 137636), params={'x': 2.0320295806688966}, distributions={'x': FloatDistribution(high=10.0, log=False, low=-10.0, step=None)}, user_attrs={}, system_attrs={}, intermediate_values={}, trial_id=94, state=TrialState.COMPLETE, value=None), FrozenTrial(number=95, values=[0.4334044418965321], datetime_start=datetime.datetime(2022, 8, 18, 0, 19, 10, 138088), datetime_complete=datetime.datetime(2022, 8, 18, 0, 19, 10, 141384), params={'x': 2.6583345972197816}, distributions={'x': FloatDistribution(high=10.0, log=False, low=-10.0, step=None)}, user_attrs={}, system_attrs={}, intermediate_values={}, trial_id=95, state=TrialState.COMPLETE, value=None), FrozenTrial(number=96, values=[87.26668328741135], datetime_start=datetime.datetime(2022, 8, 18, 0, 19, 10, 141837), datetime_complete=datetime.datetime(2022, 8, 18, 0, 19, 10, 145209), params={'x': -7.34166383934957}, distributions={'x': FloatDistribution(high=10.0, log=False, low=-10.0, step=None)}, user_attrs={}, system_attrs={}, intermediate_values={}, trial_id=96, state=TrialState.COMPLETE, value=None), FrozenTrial(number=97, values=[0.3180101784466244], datetime_start=datetime.datetime(2022, 8, 18, 0, 19, 10, 145663), datetime_complete=datetime.datetime(2022, 8, 18, 0, 19, 10, 149032), params={'x': 1.4360760880698316}, distributions={'x': FloatDistribution(high=10.0, log=False, low=-10.0, step=None)}, user_attrs={}, system_attrs={}, intermediate_values={}, trial_id=97, state=TrialState.COMPLETE, value=None), FrozenTrial(number=98, values=[1.9894806990210008], datetime_start=datetime.datetime(2022, 8, 18, 0, 19, 10, 149486), datetime_complete=datetime.datetime(2022, 8, 18, 0, 19, 10, 152799), params={'x': 0.5895104753948008}, distributions={'x': FloatDistribution(high=10.0, log=False, low=-10.0, step=None)}, user_attrs={}, system_attrs={}, intermediate_values={}, trial_id=98, state=TrialState.COMPLETE, value=None), FrozenTrial(number=99, values=[7.7070459336979145], datetime_start=datetime.datetime(2022, 8, 18, 0, 19, 10, 153254), datetime_complete=datetime.datetime(2022, 8, 18, 0, 19, 10, 156586), params={'x': -0.7761566839243628}, distributions={'x': FloatDistribution(high=10.0, log=False, low=-10.0, step=None)}, user_attrs={}, system_attrs={}, intermediate_values={}, trial_id=99, state=TrialState.COMPLETE, value=None)]

To get the number of trials:

len(study.trials)
100

By executing optimize() again, we can continue the optimization.

study.optimize(objective, n_trials=100)

To get the updated number of trials:

len(study.trials)
200

As the objective function is so easy that the last 100 trials don’t improve the result. However, we can check the result again:

best_params = study.best_params
found_x = best_params["x"]
print("Found x: {}, (x - 2)^2: {}".format(found_x, (found_x - 2) ** 2))
Found x: 2.0047947780720374, (x - 2)^2: 2.2989896760090986e-05

Total running time of the script: ( 0 minutes 0.761 seconds)

Gallery generated by Sphinx-Gallery