Ax integrates easily with different scheduling frameworks and distributed training frameworks. In this example, Ax-driven optimization is executed in a distributed fashion using RayTune.
RayTune is a scalable framework for hyperparameter tuning that provides many state-of-the-art hyperparameter tuning algorithms and seamlessly scales from laptop to distributed cluster with fault tolerance. RayTune leverages Ray's Actor API to provide asynchronous parallel and distributed execution.
Ray 'Actors' are a simple and clean abstraction for replicating your Python classes across multiple workers and nodes. Each hyperparameter evaluation is asynchronously executed on a separate Ray actor and reports intermediate training progress back to RayTune. Upon reporting, RayTune then uses this information to performs actions such as early termination, re-prioritization, or checkpointing.
import logging
from ray import tune
from ray.tune import track
from ray.tune.suggest.ax import AxSearch
logger = logging.getLogger(tune.__name__)
logger.setLevel(level=logging.CRITICAL) # Reduce the number of Ray warnings that are not relevant here.
import torch
import numpy as np
from ax.plot.contour import plot_contour
from ax.plot.trace import optimization_trace_single_method
from ax.service.ax_client import AxClient
from ax.utils.notebook.plotting import render, init_notebook_plotting
from ax.utils.tutorials.cnn_utils import CNN, load_mnist, train, evaluate
init_notebook_plotting()
[INFO 06-10 18:33:25] ipy_plotting: Injecting Plotly library into cell. Do not overwrite or delete cell.
We specify enforce_sequential_optimization
as False, because Ray runs many trials in parallel. With the sequential optimization enforcement, AxClient
would expect the first few trials to be completed with data before generating more trials.
When high parallelism is not required, it is best to enforce sequential optimization, as it allows for achieving optimal results in fewer (but sequential) trials. In cases where parallelism is important, such as with distributed training using Ray, we choose to forego minimizing resource utilization and run more trials in parallel.
ax = AxClient(enforce_sequential_optimization=False)
[INFO 06-10 18:33:25] ax.service.ax_client: Starting optimization with verbose logging. To disable logging, set the `verbose_logging` argument to `False`. Note that float values in the logs are rounded to 2 decimal points.
In WithDBSettings, db settings: None
Here we set up the search space and specify the objective; refer to the Ax API tutorials for more detail.
ax.create_experiment(
name="mnist_experiment",
parameters=[
{"name": "lr", "type": "range", "bounds": [1e-6, 0.4], "log_scale": True},
{"name": "momentum", "type": "range", "bounds": [0.0, 1.0]},
],
objective_name="mean_accuracy",
)
[INFO 06-10 18:33:25] ax.modelbridge.dispatch_utils: Using Bayesian Optimization generation strategy: GenerationStrategy(name='Sobol+GPEI', steps=[Sobol for 5 trials, GPEI for subsequent trials]). Iterations after 5 will take longer to generate due to model-fitting.
Since we use the Ax Service API here, we evaluate the parameterizations that Ax suggests, using RayTune. The evaluation function follows its usual pattern, taking in a parameterization and outputting an objective value. For detail on evaluation functions, see Trial Evaluation.
def train_evaluate(parameterization):
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
train_loader, valid_loader, test_loader = load_mnist(data_path='~/.data')
net = train(net=CNN(), train_loader=train_loader, parameters=parameterization, dtype=torch.float, device=device)
track.log(
mean_accuracy=evaluate(
net=net,
data_loader=valid_loader,
dtype=torch.float,
device=device,
)
)
Execute the Ax optimization and trial evaluation in RayTune using AxSearch algorithm:
tune.run(
train_evaluate,
num_samples=30,
search_alg=AxSearch(ax), # Note that the argument here is the `AxClient`.
verbose=0, # Set this level to 1 to see status updates and to 2 to also see trial results.
# To use GPU, specify: resources_per_trial={"gpu": 1}.
)
2020-06-10 18:33:25,414 INFO resource_spec.py:212 -- Starting Ray with 4.35 GiB memory available for workers and up to 2.18 GiB for objects. You can adjust these settings with ray.init(memory=<bytes>, object_store_memory=<bytes>).
2020-06-10 18:33:25,814 INFO services.py:1170 -- View the Ray dashboard at localhost:8265
[INFO 06-10 18:33:26] ax.service.ax_client: Generated new trial 0 with parameters {'lr': 0.0, 'momentum': 0.9}.
[INFO 06-10 18:33:26] ax.service.ax_client: Generated new trial 1 with parameters {'lr': 0.0, 'momentum': 0.67}.
[INFO 06-10 18:33:26] ax.service.ax_client: Generated new trial 2 with parameters {'lr': 0.0, 'momentum': 0.32}.
[INFO 06-10 18:33:26] ax.service.ax_client: Generated new trial 3 with parameters {'lr': 0.0, 'momentum': 0.59}.
[INFO 06-10 18:33:26] ax.service.ax_client: Generated new trial 4 with parameters {'lr': 0.0, 'momentum': 0.96}.
[INFO 06-10 18:33:27] ax.service.ax_client: Generated new trial 5 with parameters {'lr': 0.0, 'momentum': 0.15}.
[INFO 06-10 18:33:27] ax.service.ax_client: Generated new trial 6 with parameters {'lr': 0.01, 'momentum': 0.21}.
[INFO 06-10 18:33:27] ax.service.ax_client: Generated new trial 7 with parameters {'lr': 0.0, 'momentum': 0.43}.
[INFO 06-10 18:33:28] ax.service.ax_client: Generated new trial 8 with parameters {'lr': 0.04, 'momentum': 0.61}.
[INFO 06-10 18:33:28] ax.service.ax_client: Generated new trial 9 with parameters {'lr': 0.0, 'momentum': 0.85}.
[INFO 06-10 18:33:28] ax.service.ax_client: Generated new trial 10 with parameters {'lr': 0.0, 'momentum': 0.7}.
[INFO 06-10 18:33:28] ax.service.ax_client: Generated new trial 11 with parameters {'lr': 0.05, 'momentum': 1.0}.
[INFO 06-10 18:33:28] ax.service.ax_client: Generated new trial 12 with parameters {'lr': 0.05, 'momentum': 0.51}.
[INFO 06-10 18:33:28] ax.service.ax_client: Generated new trial 13 with parameters {'lr': 0.0, 'momentum': 0.89}.
[INFO 06-10 18:33:28] ax.service.ax_client: Generated new trial 14 with parameters {'lr': 0.0, 'momentum': 0.27}.
[INFO 06-10 18:33:28] ax.service.ax_client: Generated new trial 15 with parameters {'lr': 0.0, 'momentum': 0.58}.
[INFO 06-10 18:33:29] ax.service.ax_client: Generated new trial 16 with parameters {'lr': 0.0, 'momentum': 1.0}.
[INFO 06-10 18:33:29] ax.service.ax_client: Generated new trial 17 with parameters {'lr': 0.04, 'momentum': 0.65}.
[INFO 06-10 18:33:29] ax.service.ax_client: Generated new trial 18 with parameters {'lr': 0.0, 'momentum': 0.46}.
[INFO 06-10 18:33:29] ax.service.ax_client: Generated new trial 19 with parameters {'lr': 0.04, 'momentum': 0.79}.
[INFO 06-10 18:33:29] ax.service.ax_client: Generated new trial 20 with parameters {'lr': 0.0, 'momentum': 0.84}.
[INFO 06-10 18:33:29] ax.service.ax_client: Generated new trial 21 with parameters {'lr': 0.0, 'momentum': 0.4}.
[INFO 06-10 18:33:29] ax.service.ax_client: Generated new trial 22 with parameters {'lr': 0.0, 'momentum': 0.29}.
[INFO 06-10 18:33:30] ax.service.ax_client: Generated new trial 23 with parameters {'lr': 0.0, 'momentum': 0.15}.
[INFO 06-10 18:33:30] ax.service.ax_client: Generated new trial 24 with parameters {'lr': 0.0, 'momentum': 0.63}.
[INFO 06-10 18:33:30] ax.service.ax_client: Generated new trial 25 with parameters {'lr': 0.0, 'momentum': 0.89}.
[INFO 06-10 18:33:30] ax.service.ax_client: Generated new trial 26 with parameters {'lr': 0.0, 'momentum': 0.82}.
[INFO 06-10 18:33:30] ax.service.ax_client: Generated new trial 27 with parameters {'lr': 0.0, 'momentum': 0.49}.
[INFO 06-10 18:33:31] ax.service.ax_client: Generated new trial 28 with parameters {'lr': 0.0, 'momentum': 0.9}.
[INFO 06-10 18:33:31] ax.service.ax_client: Generated new trial 29 with parameters {'lr': 0.0, 'momentum': 0.01}.
(pid=4171) Downloading http://yann.lecun.com/exdb/mnist/train-images-idx3-ubyte.gz to /home/travis/.data/MNIST/raw/train-images-idx3-ubyte.gz (pid=4171) 2020-06-10 18:33:33,702 INFO trainable.py:217 -- Getting current IP. (pid=4170) 2020-06-10 18:33:33,799 INFO trainable.py:217 -- Getting current IP. (pid=4170) Downloading http://yann.lecun.com/exdb/mnist/train-images-idx3-ubyte.gz to /home/travis/.data/MNIST/raw/train-images-idx3-ubyte.gz 0.1% 0.1% 0.9% 0.4% 8.8% 4.3% 29.7% 18.8% 55.0% 19.5% 20.0% 20.3% 20.7% 21.1% 21.4% 21.5% 22.0% 22.6% 22.8% 22.9% 23.2% 25.5% 60.2% 80.4% 60.7% 60.9% 61.2% 61.3% 80.5% 80.6% 80.7% 80.9% 81.1% 81.4% 81.7% 61.4% 61.6% 81.8% 61.7% 82.1% 61.7% 62.0% 62.1% 85.0% 65.2% 85.1% 65.5% 65.6% 65.7% 85.4% 85.5% 85.9% 65.8% 85.9% 65.9% 66.2% 66.4% 86.0% 66.5% 86.1% 86.2% 66.6% 86.4% 66.8% 88.2% 71.2% 88.3% 88.6% 88.8% 88.8% 89.2% 71.3% 71.4% 89.3% 71.6% 89.4% 72.0% 72.4% 89.6% 89.7% 72.5% 89.9% 72.6% 90.1% 72.7% 90.2% 72.8% 91.7% 77.8% 92.1% 92.3% 77.9% 92.5% 78.1% 92.6% 92.7% 92.9% 93.1% 93.2% 93.5% 93.6% 93.9% 78.2% 94.0% 78.3% 94.1% 100.1% (pid=4171) Extracting /home/travis/.data/MNIST/raw/train-images-idx3-ubyte.gz to /home/travis/.data/MNIST/raw 100.1% (pid=4170) Extracting /home/travis/.data/MNIST/raw/train-images-idx3-ubyte.gz to /home/travis/.data/MNIST/raw (pid=4170) Downloading http://yann.lecun.com/exdb/mnist/train-labels-idx1-ubyte.gz to /home/travis/.data/MNIST/raw/train-labels-idx1-ubyte.gz (pid=4171) Downloading http://yann.lecun.com/exdb/mnist/train-labels-idx1-ubyte.gz to /home/travis/.data/MNIST/raw/train-labels-idx1-ubyte.gz 28.4% 113.5% (pid=4170) Extracting /home/travis/.data/MNIST/raw/train-labels-idx1-ubyte.gz to /home/travis/.data/MNIST/raw (pid=4170) Downloading http://yann.lecun.com/exdb/mnist/t10k-images-idx3-ubyte.gz to /home/travis/.data/MNIST/raw/t10k-images-idx3-ubyte.gz (pid=4171) Extracting /home/travis/.data/MNIST/raw/train-labels-idx1-ubyte.gz to /home/travis/.data/MNIST/raw (pid=4171) Downloading http://yann.lecun.com/exdb/mnist/t10k-images-idx3-ubyte.gz to /home/travis/.data/MNIST/raw/t10k-images-idx3-ubyte.gz 113.5% 0.5% 0.5% 5.5% 5.5% 25.8% 25.8% (pid=4171) Extracting /home/travis/.data/MNIST/raw/t10k-images-idx3-ubyte.gz to /home/travis/.data/MNIST/raw 100.4% 100.4% (pid=4170) Extracting /home/travis/.data/MNIST/raw/t10k-images-idx3-ubyte.gz to /home/travis/.data/MNIST/raw (pid=4171) Downloading http://yann.lecun.com/exdb/mnist/t10k-labels-idx1-ubyte.gz to /home/travis/.data/MNIST/raw/t10k-labels-idx1-ubyte.gz (pid=4170) Downloading http://yann.lecun.com/exdb/mnist/t10k-labels-idx1-ubyte.gz to /home/travis/.data/MNIST/raw/t10k-labels-idx1-ubyte.gz 180.4% (pid=4170) Extracting /home/travis/.data/MNIST/raw/t10k-labels-idx1-ubyte.gz to /home/travis/.data/MNIST/raw (pid=4170) Processing... (pid=4171) Extracting /home/travis/.data/MNIST/raw/t10k-labels-idx1-ubyte.gz to /home/travis/.data/MNIST/raw (pid=4171) Processing... 180.4% (pid=4170) /pytorch/torch/csrc/utils/tensor_numpy.cpp:141: UserWarning: (pid=4170) (pid=4170) The given NumPy array is not writeable, and PyTorch does not support non-writeable tensors. This means you can write to the underlying (supposedly non-writeable) NumPy array using the tensor. You may want to copy the array to protect its data or make it writeable before converting it to a tensor. This type of warning will be suppressed for the rest of this program. (pid=4170) (pid=4171) /pytorch/torch/csrc/utils/tensor_numpy.cpp:141: UserWarning: (pid=4171) (pid=4171) The given NumPy array is not writeable, and PyTorch does not support non-writeable tensors. This means you can write to the underlying (supposedly non-writeable) NumPy array using the tensor. You may want to copy the array to protect its data or make it writeable before converting it to a tensor. This type of warning will be suppressed for the rest of this program. (pid=4171) (pid=4170) Done! (pid=4171) Done!
[INFO 06-10 18:33:56] ax.service.ax_client: Completed trial 1 with data: {'mean_accuracy': (0.95, 0.0)}. [INFO 06-10 18:33:57] ax.service.ax_client: Completed trial 0 with data: {'mean_accuracy': (0.97, 0.0)}.
(pid=4265) 2020-06-10 18:33:59,884 INFO trainable.py:217 -- Getting current IP. (pid=4275) 2020-06-10 18:34:01,045 INFO trainable.py:217 -- Getting current IP.
[INFO 06-10 18:34:20] ax.service.ax_client: Completed trial 2 with data: {'mean_accuracy': (0.34, 0.0)}. [INFO 06-10 18:34:20] ax.service.ax_client: Completed trial 3 with data: {'mean_accuracy': (0.97, 0.0)}.
(pid=4300) 2020-06-10 18:34:24,103 INFO trainable.py:217 -- Getting current IP. (pid=4299) 2020-06-10 18:34:24,381 INFO trainable.py:217 -- Getting current IP.
[INFO 06-10 18:34:44] ax.service.ax_client: Completed trial 4 with data: {'mean_accuracy': (0.93, 0.0)}. [INFO 06-10 18:34:45] ax.service.ax_client: Completed trial 5 with data: {'mean_accuracy': (0.92, 0.0)}.
(pid=4309) 2020-06-10 18:34:47,146 INFO trainable.py:217 -- Getting current IP. (pid=4344) 2020-06-10 18:34:48,688 INFO trainable.py:217 -- Getting current IP.
[INFO 06-10 18:35:07] ax.service.ax_client: Completed trial 6 with data: {'mean_accuracy': (0.11, 0.0)}. [INFO 06-10 18:35:08] ax.service.ax_client: Completed trial 7 with data: {'mean_accuracy': (0.92, 0.0)}.
(pid=4370) 2020-06-10 18:35:10,809 INFO trainable.py:217 -- Getting current IP. (pid=4381) 2020-06-10 18:35:12,575 INFO trainable.py:217 -- Getting current IP.
[INFO 06-10 18:35:31] ax.service.ax_client: Completed trial 8 with data: {'mean_accuracy': (0.11, 0.0)}. [INFO 06-10 18:35:33] ax.service.ax_client: Completed trial 9 with data: {'mean_accuracy': (0.76, 0.0)}.
(pid=4402) 2020-06-10 18:35:34,907 INFO trainable.py:217 -- Getting current IP. (pid=4415) 2020-06-10 18:35:37,328 INFO trainable.py:217 -- Getting current IP.
[INFO 06-10 18:35:54] ax.service.ax_client: Completed trial 10 with data: {'mean_accuracy': (0.82, 0.0)}. [INFO 06-10 18:35:58] ax.service.ax_client: Completed trial 11 with data: {'mean_accuracy': (0.11, 0.0)}.
(pid=4433) 2020-06-10 18:35:58,959 INFO trainable.py:217 -- Getting current IP. (pid=4446) 2020-06-10 18:36:02,468 INFO trainable.py:217 -- Getting current IP.
[INFO 06-10 18:36:19] ax.service.ax_client: Completed trial 12 with data: {'mean_accuracy': (0.09, 0.0)}.
(pid=4447) 2020-06-10 18:36:22,817 INFO trainable.py:217 -- Getting current IP.
[INFO 06-10 18:36:23] ax.service.ax_client: Completed trial 13 with data: {'mean_accuracy': (0.96, 0.0)}.
(pid=4483) 2020-06-10 18:36:27,918 INFO trainable.py:217 -- Getting current IP.
[INFO 06-10 18:36:43] ax.service.ax_client: Completed trial 14 with data: {'mean_accuracy': (0.77, 0.0)}.
(pid=4504) 2020-06-10 18:36:47,442 INFO trainable.py:217 -- Getting current IP.
[INFO 06-10 18:36:48] ax.service.ax_client: Completed trial 15 with data: {'mean_accuracy': (0.83, 0.0)}.
(pid=4520) 2020-06-10 18:36:53,054 INFO trainable.py:217 -- Getting current IP.
[INFO 06-10 18:37:07] ax.service.ax_client: Completed trial 16 with data: {'mean_accuracy': (0.9, 0.0)}.
(pid=4537) 2020-06-10 18:37:11,977 INFO trainable.py:217 -- Getting current IP.
[INFO 06-10 18:37:12] ax.service.ax_client: Completed trial 17 with data: {'mean_accuracy': (0.1, 0.0)}.
(pid=4554) 2020-06-10 18:37:16,727 INFO trainable.py:217 -- Getting current IP.
[INFO 06-10 18:37:32] ax.service.ax_client: Completed trial 18 with data: {'mean_accuracy': (0.96, 0.0)}. [INFO 06-10 18:37:36] ax.service.ax_client: Completed trial 19 with data: {'mean_accuracy': (0.1, 0.0)}.
(pid=4570) 2020-06-10 18:37:37,139 INFO trainable.py:217 -- Getting current IP. (pid=4583) 2020-06-10 18:37:41,236 INFO trainable.py:217 -- Getting current IP.
[INFO 06-10 18:37:58] ax.service.ax_client: Completed trial 20 with data: {'mean_accuracy': (0.91, 0.0)}. [INFO 06-10 18:38:01] ax.service.ax_client: Completed trial 21 with data: {'mean_accuracy': (0.9, 0.0)}.
(pid=4584) 2020-06-10 18:38:02,200 INFO trainable.py:217 -- Getting current IP. (pid=4615) 2020-06-10 18:38:05,584 INFO trainable.py:217 -- Getting current IP.
[INFO 06-10 18:38:23] ax.service.ax_client: Completed trial 22 with data: {'mean_accuracy': (0.57, 0.0)}. [INFO 06-10 18:38:26] ax.service.ax_client: Completed trial 23 with data: {'mean_accuracy': (0.58, 0.0)}.
(pid=4616) 2020-06-10 18:38:26,588 INFO trainable.py:217 -- Getting current IP.
2020-06-10 18:38:27,114 WARNING worker.py:1090 -- The actor or task with ID ffffffffffffffffa9ccc7780100 is pending and cannot currently be scheduled. It requires {CPU: 1.000000} for execution and {CPU: 1.000000} for placement, but this node only has remaining {node:10.30.4.147: 1.000000}, {CPU: 1.000000}, {memory: 4.345703 GiB}, {object_store_memory: 1.464844 GiB}. In total there are 0 pending tasks and 1 pending actors on this node. This is likely due to all cluster resources being claimed by actors. To resolve the issue, consider creating fewer actors or increase the resources available to this Ray cluster. You can ignore this message if this Ray cluster is expected to auto-scale.
(pid=4655) 2020-06-10 18:38:30,868 INFO trainable.py:217 -- Getting current IP.
[INFO 06-10 18:38:48] ax.service.ax_client: Completed trial 24 with data: {'mean_accuracy': (0.47, 0.0)}. [INFO 06-10 18:38:51] ax.service.ax_client: Completed trial 25 with data: {'mean_accuracy': (0.96, 0.0)}.
(pid=4673) 2020-06-10 18:38:52,113 INFO trainable.py:217 -- Getting current IP. (pid=4686) 2020-06-10 18:38:55,017 INFO trainable.py:217 -- Getting current IP.
[INFO 06-10 18:39:13] ax.service.ax_client: Completed trial 26 with data: {'mean_accuracy': (0.11, 0.0)}. [INFO 06-10 18:39:15] ax.service.ax_client: Completed trial 27 with data: {'mean_accuracy': (0.18, 0.0)}.
(pid=4706) 2020-06-10 18:39:17,232 INFO trainable.py:217 -- Getting current IP. (pid=4719) 2020-06-10 18:39:18,594 INFO trainable.py:217 -- Getting current IP.
[INFO 06-10 18:39:38] ax.service.ax_client: Completed trial 28 with data: {'mean_accuracy': (0.11, 0.0)}. [INFO 06-10 18:39:38] ax.service.ax_client: Completed trial 29 with data: {'mean_accuracy': (0.43, 0.0)}.
<ray.tune.analysis.experiment_analysis.ExperimentAnalysis at 0x7fc0a42ca6a0>
best_parameters, values = ax.get_best_parameters()
best_parameters
{'lr': 0.0017583437892744037, 'momentum': 0.5872646635398269}
means, covariances = values
means
{'mean_accuracy': 0.9705}
render(
plot_contour(
model=ax.generation_strategy.model, param_x='lr', param_y='momentum', metric_name='mean_accuracy'
)
)
/home/travis/virtualenv/python3.7.1/lib/python3.7/site-packages/numpy/core/fromnumeric.py:3335: RuntimeWarning: Mean of empty slice. /home/travis/virtualenv/python3.7.1/lib/python3.7/site-packages/numpy/core/_methods.py:161: RuntimeWarning: invalid value encountered in double_scalars
--------------------------------------------------------------------------- NotImplementedError Traceback (most recent call last) <ipython-input-9-1ad1935854d6> in <module> 1 render( 2 plot_contour( ----> 3 model=ax.generation_strategy.model, param_x='lr', param_y='momentum', metric_name='mean_accuracy' 4 ) 5 ) ~/build/facebook/Ax/ax/plot/contour.py in plot_contour(model, param_x, param_y, metric_name, generator_runs_dict, relative, density, slice_values, lower_is_better, fixed_features, trial_index) 153 generator_runs_dict=generator_runs_dict, 154 density=density, --> 155 slice_values=slice_values, 156 ) 157 config = { ~/build/facebook/Ax/ax/plot/contour.py in _get_contour_predictions(model, x_param_name, y_param_name, metric, generator_runs_dict, density, slice_values, fixed_features) 95 param_grid_obsf.append(predf) 96 ---> 97 mu, cov = model.predict(param_grid_obsf) 98 99 f_plt = mu[metric] ~/build/facebook/Ax/ax/modelbridge/base.py in predict(self, observation_features) 493 # Predict in single batch. 494 try: --> 495 observation_data = self._batch_predict(observation_features) 496 # Predict one by one. 497 except (TypeError, ValueError): ~/build/facebook/Ax/ax/modelbridge/base.py in _batch_predict(self, observation_features) 423 ) 424 # Apply terminal transform and predict --> 425 observation_data = self._predict(observation_features) 426 427 # Apply reverse transforms, in reverse order ~/build/facebook/Ax/ax/modelbridge/random.py in _predict(self, observation_features) 102 output. 103 """ --> 104 raise NotImplementedError("RandomModelBridge does not support prediction.") 105 106 def _cross_validate( NotImplementedError: RandomModelBridge does not support prediction.
# `plot_single_method` expects a 2-d array of means, because it expects to average means from multiple
# optimization runs, so we wrap out best objectives array in another array.
best_objectives = np.array([[trial.objective_mean * 100 for trial in ax.experiment.trials.values()]])
best_objective_plot = optimization_trace_single_method(
y=np.maximum.accumulate(best_objectives, axis=1),
title="Model performance vs. # of iterations",
ylabel="Accuracy",
)
render(best_objective_plot)