From bc8a09985abb04afb5acefe438692db25942626d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miguel=20Gonz=C3=A1lez=20Duque?= Date: Fri, 16 Aug 2024 13:40:13 +0200 Subject: [PATCH] Makes sure the observer examples run (#245) --- .../example_logging_rdkit_logp_using_mlflow.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/examples/observers/adding_an_mlflow_observer/example_logging_rdkit_logp_using_mlflow.py b/examples/observers/adding_an_mlflow_observer/example_logging_rdkit_logp_using_mlflow.py index 6f7d3d38..efe49299 100644 --- a/examples/observers/adding_an_mlflow_observer/example_logging_rdkit_logp_using_mlflow.py +++ b/examples/observers/adding_an_mlflow_observer/example_logging_rdkit_logp_using_mlflow.py @@ -29,12 +29,16 @@ # Initializing a logP objective function. problem = objective_factory.create( name="rdkit_logp", - observer=observer, string_representation="SELFIES", - observer_init_info={"run_id": None, "experiment_id": None}, ) f, x0 = problem.black_box, problem.x0 + # Attaching the observer to the black box + observer.initialize_observer( + f.info, caller_info={"run_id": None, "experiment_id": None}, seed=1 + ) + f.set_observer(observer) + # Logging some examples # The observer will register each call to f. f(np.array([["[C]", "[C]"]]))