Result Storage

This notebook will show how to store pypesto result objects to be able to load them later on for visualization and further analysis. This includes sampling, profiling and optimization. Additionally, we will show how to use optimization history to look further into an optimization run and how to store the history.

After this notebook, you will…

  • know how to store and load optimization, profiling and sampling results

  • know how to store and load optimization history

  • know basic plotting functions for optimization history to inspect optimization convergence

[1]:
# install if not done yet
# %pip install pypesto --quiet

Imports

[2]:
import logging
import random
import tempfile

import matplotlib as mpl
import matplotlib.pyplot as plt
import numpy as np
from IPython.display import Markdown, display

import pypesto.optimize as optimize
import pypesto.petab
import pypesto.profile as profile
import pypesto.sample as sample
import pypesto.visualize as visualize

mpl.rcParams["figure.dpi"] = 100
mpl.rcParams["font.size"] = 18
# set a random seed to get reproducible results
random.seed(3142)

%matplotlib inline

0. Objective function and problem definition

We will use the Boehm model from the benchmark initiative in this notebook as an example. We load the model through PEtab, a data format for specifying parameter estimation problems in systems biology.

[3]:
%%capture
# directory of the PEtab problem
petab_yaml = "./boehm_JProteomeRes2014/boehm_JProteomeRes2014.yaml"

importer = pypesto.petab.PetabImporter.from_yaml(petab_yaml)
problem = importer.create_problem(verbose=False)

1. Filling in the result file

We will now run a standard parameter estimation pipeline with this model. Aside from the part on the history, we shall not go into detail here, as this is covered in other tutorials such as Getting Started and AMICI in pyPESTO.

Optimization

[4]:
%%time

# create optimizers
optimizer = optimize.FidesOptimizer(
    verbose=logging.ERROR, options={"maxiter": 200}
)

# set number of starts
n_starts = 15  # usually a larger number >=100 is used

# Optimization
result = pypesto.optimize.minimize(
    problem=problem, optimizer=optimizer, n_starts=n_starts
)
2024-04-13 07:04:07.236 - amici.swig_wrappers - DEBUG - [model1_data1][CVODES:CVode:ERR_FAILURE] AMICI ERROR: in module CVODES in function CVode : At t = 145.741 and h = 3.27868e-05, the error test failed repeatedly or with |h| = hmin.
2024-04-13 07:04:07.237 - amici.swig_wrappers - ERROR - [model1_data1][FORWARD_FAILURE] AMICI forward simulation failed at t = 145.741: AMICI failed to integrate the forward problem
2024-04-13 07:04:07.580 - amici.swig_wrappers - DEBUG - [model1_data1][CVODES:CVode:ERR_FAILURE] AMICI ERROR: in module CVODES in function CVode : At t = 89.1257 and h = 1.46489e-05, the error test failed repeatedly or with |h| = hmin.
2024-04-13 07:04:07.581 - amici.swig_wrappers - ERROR - [model1_data1][FORWARD_FAILURE] AMICI forward simulation failed at t = 89.1257: AMICI failed to integrate the forward problem
2024-04-13 07:04:07.600 - amici.swig_wrappers - DEBUG - [model1_data1][CVODES:CVode:ERR_FAILURE] AMICI ERROR: in module CVODES in function CVode : At t = 145.265 and h = 4.14927e-05, the error test failed repeatedly or with |h| = hmin.
2024-04-13 07:04:07.601 - amici.swig_wrappers - ERROR - [model1_data1][FORWARD_FAILURE] AMICI forward simulation failed at t = 145.265: AMICI failed to integrate the forward problem
2024-04-13 07:04:08.789 - amici.swig_wrappers - DEBUG - [model1_data1][CVODES:CVode:ERR_FAILURE] AMICI ERROR: in module CVODES in function CVode : At t = 145.342 and h = 2.79807e-05, the error test failed repeatedly or with |h| = hmin.
2024-04-13 07:04:08.790 - amici.swig_wrappers - ERROR - [model1_data1][FORWARD_FAILURE] AMICI forward simulation failed at t = 145.342: AMICI failed to integrate the forward problem
2024-04-13 07:04:08.897 - amici.swig_wrappers - DEBUG - [model1_data1][CVODES:CVode:ERR_FAILURE] AMICI ERROR: in module CVODES in function CVode : At t = 145.867 and h = 3.0393e-05, the error test failed repeatedly or with |h| = hmin.
2024-04-13 07:04:08.897 - amici.swig_wrappers - ERROR - [model1_data1][FORWARD_FAILURE] AMICI forward simulation failed at t = 145.867: AMICI failed to integrate the forward problem
2024-04-13 07:04:09.484 - amici.swig_wrappers - DEBUG - [model1_data1][CVODES:CVode:ERR_FAILURE] AMICI ERROR: in module CVODES in function CVode : At t = 138.34 and h = 1.09278e-05, the error test failed repeatedly or with |h| = hmin.
2024-04-13 07:04:09.484 - amici.swig_wrappers - ERROR - [model1_data1][FORWARD_FAILURE] AMICI forward simulation failed at t = 138.34: AMICI failed to integrate the forward problem
2024-04-13 07:04:10.920 - amici.swig_wrappers - DEBUG - [model1_data1][CVODES:CVode:ERR_FAILURE] AMICI ERROR: in module CVODES in function CVode : At t = 55.65 and h = 4.26484e-06, the error test failed repeatedly or with |h| = hmin.
2024-04-13 07:04:10.920 - amici.swig_wrappers - ERROR - [model1_data1][FORWARD_FAILURE] AMICI forward simulation failed at t = 55.65: AMICI failed to integrate the forward problem
2024-04-13 07:04:11.254 - amici.swig_wrappers - DEBUG - [model1_data1][CVODES:CVode:ERR_FAILURE] AMICI ERROR: in module CVODES in function CVode : At t = 87.7506 and h = 1.24847e-05, the error test failed repeatedly or with |h| = hmin.
2024-04-13 07:04:11.255 - amici.swig_wrappers - ERROR - [model1_data1][FORWARD_FAILURE] AMICI forward simulation failed at t = 87.7506: AMICI failed to integrate the forward problem
2024-04-13 07:04:15.355 - amici.swig_wrappers - DEBUG - [model1_data1][CVODES:CVode:TOO_MUCH_WORK] AMICI ERROR: in module CVODES in function CVode : At t = 129.639, mxstep steps taken before reaching tout.
2024-04-13 07:04:15.356 - amici.swig_wrappers - ERROR - [model1_data1][FORWARD_FAILURE] AMICI forward simulation failed at t = 129.639: AMICI failed to integrate the forward problem
2024-04-13 07:04:17.737 - amici.swig_wrappers - DEBUG - [model1_data1][CVODES:CVode:ERR_FAILURE] AMICI ERROR: in module CVODES in function CVode : At t = 86.8368 and h = 4.13922e-06, the error test failed repeatedly or with |h| = hmin.
2024-04-13 07:04:17.738 - amici.swig_wrappers - ERROR - [model1_data1][FORWARD_FAILURE] AMICI forward simulation failed at t = 86.8368: AMICI failed to integrate the forward problem
2024-04-13 07:04:20.122 - amici.swig_wrappers - DEBUG - [model1_data1][CVODES:CVode:ERR_FAILURE] AMICI ERROR: in module CVODES in function CVode : At t = 212.838 and h = 2.76932e-06, the error test failed repeatedly or with |h| = hmin.
2024-04-13 07:04:20.123 - amici.swig_wrappers - ERROR - [model1_data1][FORWARD_FAILURE] AMICI forward simulation failed at t = 212.838: AMICI failed to integrate the forward problem
2024-04-13 07:04:23.620 - amici.swig_wrappers - DEBUG - [model1_data1][CVODES:CVode:ERR_FAILURE] AMICI ERROR: in module CVODES in function CVode : At t = 89.3833 and h = 1.2243e-05, the error test failed repeatedly or with |h| = hmin.
2024-04-13 07:04:23.620 - amici.swig_wrappers - ERROR - [model1_data1][FORWARD_FAILURE] AMICI forward simulation failed at t = 89.3833: AMICI failed to integrate the forward problem
2024-04-13 07:04:23.910 - amici.swig_wrappers - DEBUG - [model1_data1][CVODES:CVode:ERR_FAILURE] AMICI ERROR: in module CVODES in function CVode : At t = 88.971 and h = 8.24527e-06, the error test failed repeatedly or with |h| = hmin.
2024-04-13 07:04:23.911 - amici.swig_wrappers - ERROR - [model1_data1][FORWARD_FAILURE] AMICI forward simulation failed at t = 88.971: AMICI failed to integrate the forward problem
2024-04-13 07:04:23.946 - amici.swig_wrappers - DEBUG - [model1_data1][CVODES:CVode:ERR_FAILURE] AMICI ERROR: in module CVODES in function CVode : At t = 89.0648 and h = 1.42259e-05, the error test failed repeatedly or with |h| = hmin.
2024-04-13 07:04:23.946 - amici.swig_wrappers - ERROR - [model1_data1][FORWARD_FAILURE] AMICI forward simulation failed at t = 89.0648: AMICI failed to integrate the forward problem
2024-04-13 07:04:24.345 - amici.swig_wrappers - DEBUG - [model1_data1][CVODES:CVode:ERR_FAILURE] AMICI ERROR: in module CVODES in function CVode : At t = 119.782 and h = 5.46474e-06, the error test failed repeatedly or with |h| = hmin.
2024-04-13 07:04:24.346 - amici.swig_wrappers - ERROR - [model1_data1][FORWARD_FAILURE] AMICI forward simulation failed at t = 119.782: AMICI failed to integrate the forward problem
CPU times: user 19.7 s, sys: 600 ms, total: 20.3 s
Wall time: 19.4 s
[5]:
display(Markdown(result.summary()))

Optimization Result

  • number of starts: 15

  • best value: 147.54396596083967, id=0

  • worst value: 249.74599786264127, id=6

  • number of non-finite values: 0

  • execution time summary:

    • Mean execution time: 1.292s

    • Maximum execution time: 2.792s, id=9

    • Minimum execution time: 0.391s, id=4

  • summary of optimizer messages:

    Count

    Message

    15

    Converged according to fval difference

  • best value found (approximately) 8 time(s)

  • number of plateaus found: 3

A summary of the best run:

Optimizer Result

  • optimizer used: <FidesOptimizer hessian_update=default verbose=40 options={‘maxiter’: 200}>

  • message: Converged according to fval difference

  • number of evaluations: 60

  • time taken to optimize: 1.006s

  • startpoint: [ 3.15531398 -3.47246864 2.7046161 0.20438608 0.02461155 -3.37253495 3.43360947 -4.29344547 2.64801546]

  • endpoint: [-1.50317507 -3.35729603 4.99999865 -1.77790715 -1.75871163 3.98198843 0.63201326 0.78932498 0.73479197]

  • final objective value: 147.54396596083967

  • final gradient value: [-1.22435156e-02 -6.30038511e-04 -4.96526331e-06 -4.85369081e-03 -5.83905109e-03 6.61505800e-03 1.92780845e-03 3.85757383e-04 -2.97661982e-03]

  • final hessian value: [[ 2.41996621e+03 2.18992114e+01 -1.18651413e-04 1.80808985e+03 6.87792284e+02 -9.06127613e+02 1.80978486e+01 -9.19660492e+00 -8.87305195e+00] [ 2.18992114e+01 1.01315914e+00 -2.10641040e-06 1.36163021e+01 8.91135593e-01 -9.02494221e+00 -4.48529423e-02 -2.97937775e-01 3.44241435e-01] [-1.18651413e-04 -2.10641040e-06 1.05957720e-11 -8.28352679e-05 -2.49610286e-05 6.41462937e-05 2.77288431e-06 -5.67176816e-08 8.71677465e-06] [ 1.80808985e+03 1.36163021e+01 -8.28352679e-05 1.37866836e+03 5.21835357e+02 -6.38328376e+02 2.39979487e+01 -8.17884207e+00 -1.58079306e+01] [ 6.87792284e+02 8.91135593e-01 -2.49610286e-05 5.21835357e+02 2.98393676e+02 -2.95499645e+02 -1.05257036e+01 -4.04934430e+00 1.45884928e+01] [-9.06127613e+02 -9.02494221e+00 6.41462937e-05 -6.38328376e+02 -2.95499645e+02 8.97221471e+02 1.04516443e+01 -3.74612568e+01 2.69943808e+01] [ 1.80978486e+01 -4.48529423e-02 2.77288431e-06 2.39979487e+01 -1.05257036e+01 1.04516443e+01 8.48259308e+01 0.00000000e+00 0.00000000e+00] [-9.19660492e+00 -2.97937775e-01 -5.67176816e-08 -8.17884207e+00 -4.04934430e+00 -3.74612568e+01 0.00000000e+00 8.48294815e+01 0.00000000e+00] [-8.87305195e+00 3.44241435e-01 8.71677465e-06 -1.58079306e+01 1.45884928e+01 2.69943808e+01 0.00000000e+00 0.00000000e+00 8.48372237e+01]]

Profiling

[6]:
%%time

# Profiling
result = profile.parameter_profile(
    problem=problem,
    result=result,
    optimizer=optimizer,
    profile_index=np.array([1, 1, 1, 0, 0, 0, 0, 0, 1]),
)
2024-04-13 07:04:25.130 - amici.swig_wrappers - DEBUG - [model1_data1][CVODES:CVode:ERR_FAILURE] AMICI ERROR: in module CVODES in function CVode : At t = 90.2785 and h = 1.03587e-05, the error test failed repeatedly or with |h| = hmin.
2024-04-13 07:04:25.131 - amici.swig_wrappers - ERROR - [model1_data1][FORWARD_FAILURE] AMICI forward simulation failed at t = 90.2785: AMICI failed to integrate the forward problem
2024-04-13 07:04:25.296 - amici.swig_wrappers - DEBUG - [model1_data1][CVODES:CVode:ERR_FAILURE] AMICI ERROR: in module CVODES in function CVode : At t = 145.819 and h = 4.11152e-05, the error test failed repeatedly or with |h| = hmin.
2024-04-13 07:04:25.297 - amici.swig_wrappers - ERROR - [model1_data1][FORWARD_FAILURE] AMICI forward simulation failed at t = 145.819: AMICI failed to integrate the forward problem
2024-04-13 07:04:25.541 - amici.swig_wrappers - DEBUG - [model1_data1][CVODES:CVode:ERR_FAILURE] AMICI ERROR: in module CVODES in function CVode : At t = 95.3217 and h = 1.3416e-05, the error test failed repeatedly or with |h| = hmin.
2024-04-13 07:04:25.542 - amici.swig_wrappers - ERROR - [model1_data1][FORWARD_FAILURE] AMICI forward simulation failed at t = 95.3217: AMICI failed to integrate the forward problem
2024-04-13 07:04:25.578 - amici.swig_wrappers - DEBUG - [model1_data1][CVODES:CVode:ERR_FAILURE] AMICI ERROR: in module CVODES in function CVode : At t = 146.879 and h = 4.49438e-05, the error test failed repeatedly or with |h| = hmin.
2024-04-13 07:04:25.579 - amici.swig_wrappers - ERROR - [model1_data1][FORWARD_FAILURE] AMICI forward simulation failed at t = 146.879: AMICI failed to integrate the forward problem
2024-04-13 07:04:25.831 - amici.swig_wrappers - DEBUG - [model1_data1][CVODES:CVode:ERR_FAILURE] AMICI ERROR: in module CVODES in function CVode : At t = 92.1423 and h = 3.877e-06, the error test failed repeatedly or with |h| = hmin.
2024-04-13 07:04:25.832 - amici.swig_wrappers - ERROR - [model1_data1][FORWARD_FAILURE] AMICI forward simulation failed at t = 92.1423: AMICI failed to integrate the forward problem
2024-04-13 07:04:26.698 - amici.swig_wrappers - DEBUG - [model1_data1][CVODES:CVode:ERR_FAILURE] AMICI ERROR: in module CVODES in function CVode : At t = 84.3898 and h = 3.23165e-06, the error test failed repeatedly or with |h| = hmin.
2024-04-13 07:04:26.699 - amici.swig_wrappers - ERROR - [model1_data1][FORWARD_FAILURE] AMICI forward simulation failed at t = 84.3898: AMICI failed to integrate the forward problem
2024-04-13 07:04:27.071 - amici.swig_wrappers - DEBUG - [model1_data1][CVODES:CVode:ERR_FAILURE] AMICI ERROR: in module CVODES in function CVode : At t = 82.2383 and h = 4.10509e-06, the error test failed repeatedly or with |h| = hmin.
2024-04-13 07:04:27.072 - amici.swig_wrappers - ERROR - [model1_data1][FORWARD_FAILURE] AMICI forward simulation failed at t = 82.2383: AMICI failed to integrate the forward problem
2024-04-13 07:04:27.448 - amici.swig_wrappers - DEBUG - [model1_data1][CVODES:CVode:ERR_FAILURE] AMICI ERROR: in module CVODES in function CVode : At t = 78.7428 and h = 1.19502e-05, the error test failed repeatedly or with |h| = hmin.
2024-04-13 07:04:27.449 - amici.swig_wrappers - ERROR - [model1_data1][FORWARD_FAILURE] AMICI forward simulation failed at t = 78.7428: AMICI failed to integrate the forward problem
2024-04-13 07:04:27.691 - amici.swig_wrappers - DEBUG - [model1_data1][CVODES:CVode:ERR_FAILURE] AMICI ERROR: in module CVODES in function CVode : At t = 142.948 and h = 1.78255e-05, the error test failed repeatedly or with |h| = hmin.
2024-04-13 07:04:27.692 - amici.swig_wrappers - ERROR - [model1_data1][FORWARD_FAILURE] AMICI forward simulation failed at t = 142.948: AMICI failed to integrate the forward problem
2024-04-13 07:04:28.656 - amici.swig_wrappers - DEBUG - [model1_data1][CVODES:CVode:ERR_FAILURE] AMICI ERROR: in module CVODES in function CVode : At t = 140.96 and h = 3.77823e-05, the error test failed repeatedly or with |h| = hmin.
2024-04-13 07:04:28.656 - amici.swig_wrappers - ERROR - [model1_data1][FORWARD_FAILURE] AMICI forward simulation failed at t = 140.96: AMICI failed to integrate the forward problem
2024-04-13 07:04:29.086 - amici.swig_wrappers - DEBUG - [model1_data1][CVODES:CVode:ERR_FAILURE] AMICI ERROR: in module CVODES in function CVode : At t = 139.745 and h = 2.51001e-05, the error test failed repeatedly or with |h| = hmin.
2024-04-13 07:04:29.087 - amici.swig_wrappers - ERROR - [model1_data1][FORWARD_FAILURE] AMICI forward simulation failed at t = 139.745: AMICI failed to integrate the forward problem
2024-04-13 07:04:29.162 - amici.swig_wrappers - DEBUG - [model1_data1][CVODES:CVode:ERR_FAILURE] AMICI ERROR: in module CVODES in function CVode : At t = 138.78 and h = 5.12235e-06, the error test failed repeatedly or with |h| = hmin.
2024-04-13 07:04:29.163 - amici.swig_wrappers - ERROR - [model1_data1][FORWARD_FAILURE] AMICI forward simulation failed at t = 138.78: AMICI failed to integrate the forward problem
2024-04-13 07:04:29.623 - amici.swig_wrappers - DEBUG - [model1_data1][CVODES:CVode:ERR_FAILURE] AMICI ERROR: in module CVODES in function CVode : At t = 139.225 and h = 4.44623e-06, the error test failed repeatedly or with |h| = hmin.
2024-04-13 07:04:29.623 - amici.swig_wrappers - ERROR - [model1_data1][FORWARD_FAILURE] AMICI forward simulation failed at t = 139.225: AMICI failed to integrate the forward problem
2024-04-13 07:04:29.951 - amici.swig_wrappers - DEBUG - [model1_data1][CVODES:CVode:ERR_FAILURE] AMICI ERROR: in module CVODES in function CVode : At t = 135.147 and h = 3.5278e-05, the error test failed repeatedly or with |h| = hmin.
2024-04-13 07:04:29.952 - amici.swig_wrappers - ERROR - [model1_data1][FORWARD_FAILURE] AMICI forward simulation failed at t = 135.147: AMICI failed to integrate the forward problem
2024-04-13 07:04:30.010 - amici.swig_wrappers - DEBUG - [model1_data1][CVODES:CVode:ERR_FAILURE] AMICI ERROR: in module CVODES in function CVode : At t = 135.889 and h = 3.35083e-05, the error test failed repeatedly or with |h| = hmin.
2024-04-13 07:04:30.011 - amici.swig_wrappers - ERROR - [model1_data1][FORWARD_FAILURE] AMICI forward simulation failed at t = 135.889: AMICI failed to integrate the forward problem
2024-04-13 07:04:30.540 - amici.swig_wrappers - DEBUG - [model1_data1][CVODES:CVode:ERR_FAILURE] AMICI ERROR: in module CVODES in function CVode : At t = 132.425 and h = 4.40571e-06, the error test failed repeatedly or with |h| = hmin.
2024-04-13 07:04:30.541 - amici.swig_wrappers - ERROR - [model1_data1][FORWARD_FAILURE] AMICI forward simulation failed at t = 132.425: AMICI failed to integrate the forward problem
2024-04-13 07:04:30.620 - amici.swig_wrappers - DEBUG - [model1_data1][CVODES:CVode:ERR_FAILURE] AMICI ERROR: in module CVODES in function CVode : At t = 132.504 and h = 1.80232e-05, the error test failed repeatedly or with |h| = hmin.
2024-04-13 07:04:30.621 - amici.swig_wrappers - ERROR - [model1_data1][FORWARD_FAILURE] AMICI forward simulation failed at t = 132.504: AMICI failed to integrate the forward problem
2024-04-13 07:04:30.948 - amici.swig_wrappers - DEBUG - [model1_data1][CVODES:CVode:ERR_FAILURE] AMICI ERROR: in module CVODES in function CVode : At t = 54.4122 and h = 8.24162e-06, the error test failed repeatedly or with |h| = hmin.
2024-04-13 07:04:30.949 - amici.swig_wrappers - ERROR - [model1_data1][FORWARD_FAILURE] AMICI forward simulation failed at t = 54.4122: AMICI failed to integrate the forward problem
2024-04-13 07:04:31.920 - amici.swig_wrappers - DEBUG - [model1_data1][CVODES:CVode:ERR_FAILURE] AMICI ERROR: in module CVODES in function CVode : At t = 85.5191 and h = 9.56603e-06, the error test failed repeatedly or with |h| = hmin.
2024-04-13 07:04:31.921 - amici.swig_wrappers - ERROR - [model1_data1][FORWARD_FAILURE] AMICI forward simulation failed at t = 85.5191: AMICI failed to integrate the forward problem
2024-04-13 07:04:32.344 - amici.swig_wrappers - DEBUG - [model1_data1][CVODES:CVode:ERR_FAILURE] AMICI ERROR: in module CVODES in function CVode : At t = 99.3727 and h = 1.66273e-05, the error test failed repeatedly or with |h| = hmin.
2024-04-13 07:04:32.345 - amici.swig_wrappers - ERROR - [model1_data1][FORWARD_FAILURE] AMICI forward simulation failed at t = 99.3727: AMICI failed to integrate the forward problem
2024-04-13 07:04:32.400 - amici.swig_wrappers - DEBUG - [model1_data1][CVODES:CVode:ERR_FAILURE] AMICI ERROR: in module CVODES in function CVode : At t = 151.466 and h = 3.92371e-05, the error test failed repeatedly or with |h| = hmin.
2024-04-13 07:04:32.401 - amici.swig_wrappers - ERROR - [model1_data1][FORWARD_FAILURE] AMICI forward simulation failed at t = 151.466: AMICI failed to integrate the forward problem
2024-04-13 07:04:32.422 - amici.swig_wrappers - DEBUG - [model1_data1][CVODES:CVode:ERR_FAILURE] AMICI ERROR: in module CVODES in function CVode : At t = 152.185 and h = 2.76295e-05, the error test failed repeatedly or with |h| = hmin.
2024-04-13 07:04:32.422 - amici.swig_wrappers - ERROR - [model1_data1][FORWARD_FAILURE] AMICI forward simulation failed at t = 152.185: AMICI failed to integrate the forward problem
2024-04-13 07:04:32.728 - amici.swig_wrappers - DEBUG - [model1_data1][CVODES:CVode:ERR_FAILURE] AMICI ERROR: in module CVODES in function CVode : At t = 154.864 and h = 4.98108e-05, the error test failed repeatedly or with |h| = hmin.
2024-04-13 07:04:32.728 - amici.swig_wrappers - ERROR - [model1_data1][FORWARD_FAILURE] AMICI forward simulation failed at t = 154.864: AMICI failed to integrate the forward problem
2024-04-13 07:04:32.922 - amici.swig_wrappers - DEBUG - [model1_data1][CVODES:CVode:ERR_FAILURE] AMICI ERROR: in module CVODES in function CVode : At t = 155.234 and h = 4.10301e-06, the error test failed repeatedly or with |h| = hmin.
2024-04-13 07:04:32.923 - amici.swig_wrappers - ERROR - [model1_data1][FORWARD_FAILURE] AMICI forward simulation failed at t = 155.234: AMICI failed to integrate the forward problem
2024-04-13 07:04:33.082 - amici.swig_wrappers - DEBUG - [model1_data1][CVODES:CVode:ERR_FAILURE] AMICI ERROR: in module CVODES in function CVode : At t = 158.583 and h = 3.15621e-05, the error test failed repeatedly or with |h| = hmin.
2024-04-13 07:04:33.083 - amici.swig_wrappers - ERROR - [model1_data1][FORWARD_FAILURE] AMICI forward simulation failed at t = 158.583: AMICI failed to integrate the forward problem
2024-04-13 07:04:33.774 - amici.swig_wrappers - DEBUG - [model1_data1][CVODES:CVode:ERR_FAILURE] AMICI ERROR: in module CVODES in function CVode : At t = 71.2869 and h = 1.69338e-05, the error test failed repeatedly or with |h| = hmin.
2024-04-13 07:04:33.775 - amici.swig_wrappers - ERROR - [model1_data1][FORWARD_FAILURE] AMICI forward simulation failed at t = 71.2869: AMICI failed to integrate the forward problem
2024-04-13 07:04:34.735 - amici.swig_wrappers - DEBUG - [model1_data1][CVODES:CVode:ERR_FAILURE] AMICI ERROR: in module CVODES in function CVode : At t = 140.034 and h = 3.05365e-06, the error test failed repeatedly or with |h| = hmin.
2024-04-13 07:04:34.736 - amici.swig_wrappers - ERROR - [model1_data1][FORWARD_FAILURE] AMICI forward simulation failed at t = 140.034: AMICI failed to integrate the forward problem
2024-04-13 07:04:35.214 - amici.swig_wrappers - DEBUG - [model1_data1][CVODES:CVode:ERR_FAILURE] AMICI ERROR: in module CVODES in function CVode : At t = 138.295 and h = 4.90667e-06, the error test failed repeatedly or with |h| = hmin.
2024-04-13 07:04:35.215 - amici.swig_wrappers - ERROR - [model1_data1][FORWARD_FAILURE] AMICI forward simulation failed at t = 138.295: AMICI failed to integrate the forward problem
2024-04-13 07:04:35.323 - amici.swig_wrappers - DEBUG - [model1_data1][CVODES:CVode:ERR_FAILURE] AMICI ERROR: in module CVODES in function CVode : At t = 95.6119 and h = 1.55423e-05, the error test failed repeatedly or with |h| = hmin.
2024-04-13 07:04:35.324 - amici.swig_wrappers - ERROR - [model1_data1][FORWARD_FAILURE] AMICI forward simulation failed at t = 95.6119: AMICI failed to integrate the forward problem
2024-04-13 07:04:35.646 - amici.swig_wrappers - DEBUG - [model1_data1][CVODES:CVode:ERR_FAILURE] AMICI ERROR: in module CVODES in function CVode : At t = 97.2007 and h = 2.84204e-06, the error test failed repeatedly or with |h| = hmin.
2024-04-13 07:04:35.646 - amici.swig_wrappers - ERROR - [model1_data1][FORWARD_FAILURE] AMICI forward simulation failed at t = 97.2007: AMICI failed to integrate the forward problem
2024-04-13 07:04:35.685 - amici.swig_wrappers - DEBUG - [model1_data1][CVODES:CVode:ERR_FAILURE] AMICI ERROR: in module CVODES in function CVode : At t = 135.898 and h = 3.56028e-05, the error test failed repeatedly or with |h| = hmin.
2024-04-13 07:04:35.686 - amici.swig_wrappers - ERROR - [model1_data1][FORWARD_FAILURE] AMICI forward simulation failed at t = 135.898: AMICI failed to integrate the forward problem
2024-04-13 07:04:35.705 - amici.swig_wrappers - DEBUG - [model1_data1][CVODES:CVode:ERR_FAILURE] AMICI ERROR: in module CVODES in function CVode : At t = 136.171 and h = 1.40718e-05, the error test failed repeatedly or with |h| = hmin.
2024-04-13 07:04:35.706 - amici.swig_wrappers - ERROR - [model1_data1][FORWARD_FAILURE] AMICI forward simulation failed at t = 136.171: AMICI failed to integrate the forward problem
CPU times: user 12.1 s, sys: 430 ms, total: 12.6 s
Wall time: 11.8 s

Sampling

[7]:
%%time

# Sampling
sampler = sample.AdaptiveMetropolisSampler()
result = sample.sample(
    problem=problem,
    sampler=sampler,
    n_samples=5000,  # rather low
    result=result,
    filename=None,
)
Elapsed time: 17.509506160999997
CPU times: user 15.2 s, sys: 2.27 s, total: 17.5 s
Wall time: 13.7 s

2. Storing the result file

We filled all our analyses into one result file. We can now store this result object into HDF5 format to reload this later on.

[8]:
# create temporary file
fn = tempfile.NamedTemporaryFile(suffix=".hdf5", delete=False)
# write the result with the write_result function.
# Choose which parts of the result object to save with
# corresponding booleans.
pypesto.store.write_result(
    result=result,
    filename=fn.name,
    problem=True,
    optimize=True,
    profile=True,
    sample=True,
)

As easy as we can save the result object, we can also load it again:

[9]:
# load result with read_result function
result_loaded = pypesto.store.read_result(fn.name)
/home/docs/checkouts/readthedocs.org/user_builds/pypesto/envs/v0.5.0/lib/python3.11/site-packages/pypesto/store/read_from_hdf5.py:304: UserWarning: You are loading a problem. This problem is not to be used without a separately created objective.
  result.problem = pypesto_problem_reader.read()

As you can see, when loading the result object, we get a warning regarding the problem. This is the case, as the problem is not fully saved into hdf5, as a big part of the problem is the objective function. Therefore, after loading the result object, we cannot evaluate the objective function anymore. We can, however, still use the result object for plotting and further analysis.

The best practice would be to still create the problem through petab and insert it into the result object after loading it.

[10]:
# dummy call to non-existent objective function would fail
test_parameter = result.optimize_result[0].x[problem.x_free_indices]
# result_loaded.problem.objective(test_parameter)
[11]:
result_loaded.problem = problem
print(
    f"Objective function call: {result_loaded.problem.objective(test_parameter)}"
)
print(f"Corresponding saved value: {result_loaded.optimize_result[0].fval}")
Objective function call: 147.54396450276076
Corresponding saved value: 147.54396596083967

To show that for visualizations however, the storage and loading of the result object is accurate, we will plot some result visualizations.

3. Visualization Comparison

Optimization

[12]:
# waterfall plot original
ax = visualize.waterfall(result)
ax.title.set_text("Original Result")
../_images/example_store_24_0.png
[13]:
# waterfall plot loaded
ax = visualize.waterfall(result_loaded)
ax.title.set_text("Loaded Result")
../_images/example_store_25_0.png

Profiling

[14]:
# profile plot original
ax = visualize.profiles(result)
../_images/example_store_27_0.png
[15]:
# profile plot loaded
ax = visualize.profiles(result_loaded)
../_images/example_store_28_0.png

Sampling

[16]:
# sampling plot original
ax = visualize.sampling_fval_traces(result)
/home/docs/checkouts/readthedocs.org/user_builds/pypesto/envs/v0.5.0/lib/python3.11/site-packages/pypesto/visualize/sampling.py:79: UserWarning: Burn in index not found in the results, the full chain will be shown.
You may want to use, e.g., `pypesto.sample.geweke_test`.
  _, params_fval, _, _, _ = get_data_to_plot(
../_images/example_store_30_1.png
[17]:
# sampling plot loaded
ax = visualize.sampling_fval_traces(result_loaded)
/home/docs/checkouts/readthedocs.org/user_builds/pypesto/envs/v0.5.0/lib/python3.11/site-packages/pypesto/visualize/sampling.py:79: UserWarning: Burn in index not found in the results, the full chain will be shown.
You may want to use, e.g., `pypesto.sample.geweke_test`.
  _, params_fval, _, _, _ = get_data_to_plot(
../_images/example_store_31_1.png

We can see that we are perfectly able to reproduce the plots from the loaded result object. With this, we can reuse the result object for further analysis and visualization again and again without spending time and resources on rerunning the analyses.

4. Optimization History

During optimization, it is possible to regularly write the objective function trace to file. This is useful, e.g., when runs fail, or for various diagnostics. Currently, pyPESTO can save histories to 3 backends: in-memory, as CSV files, or to HDF5 files.

Memory History

To record the history in-memory, just set trace_record=True in the pypesto.HistoryOptions. Then, the optimization result contains those histories:

[18]:
# record the history
history_options = pypesto.HistoryOptions(trace_record=True)

# Run optimizations
result = optimize.minimize(
    problem=problem,
    optimizer=optimizer,
    n_starts=n_starts,
    history_options=history_options,
    filename=None,
)
2024-04-13 07:04:58.863 - amici.swig_wrappers - DEBUG - [model1_data1][CVODES:CVode:ERR_FAILURE] AMICI ERROR: in module CVODES in function CVode : At t = 145.292 and h = 4.21667e-05, the error test failed repeatedly or with |h| = hmin.
2024-04-13 07:04:58.864 - amici.swig_wrappers - ERROR - [model1_data1][FORWARD_FAILURE] AMICI forward simulation failed at t = 145.292: AMICI failed to integrate the forward problem
2024-04-13 07:04:59.180 - amici.swig_wrappers - DEBUG - [model1_data1][CVODES:CVode:ERR_FAILURE] AMICI ERROR: in module CVODES in function CVode : At t = 145.598 and h = 2.06108e-05, the error test failed repeatedly or with |h| = hmin.
2024-04-13 07:04:59.181 - amici.swig_wrappers - ERROR - [model1_data1][FORWARD_FAILURE] AMICI forward simulation failed at t = 145.598: AMICI failed to integrate the forward problem
2024-04-13 07:04:59.201 - amici.swig_wrappers - DEBUG - [model1_data1][CVODES:CVode:ERR_FAILURE] AMICI ERROR: in module CVODES in function CVode : At t = 145.629 and h = 2.34725e-06, the error test failed repeatedly or with |h| = hmin.
2024-04-13 07:04:59.201 - amici.swig_wrappers - ERROR - [model1_data1][FORWARD_FAILURE] AMICI forward simulation failed at t = 145.629: AMICI failed to integrate the forward problem
2024-04-13 07:04:59.314 - amici.swig_wrappers - DEBUG - [model1_data1][CVODES:CVode:ERR_FAILURE] AMICI ERROR: in module CVODES in function CVode : At t = 145.757 and h = 4.46327e-05, the error test failed repeatedly or with |h| = hmin.
2024-04-13 07:04:59.315 - amici.swig_wrappers - ERROR - [model1_data1][FORWARD_FAILURE] AMICI forward simulation failed at t = 145.757: AMICI failed to integrate the forward problem
2024-04-13 07:04:59.496 - amici.swig_wrappers - DEBUG - [model1_data1][CVODES:CVode:ERR_FAILURE] AMICI ERROR: in module CVODES in function CVode : At t = 88.9436 and h = 1.61072e-05, the error test failed repeatedly or with |h| = hmin.
2024-04-13 07:04:59.497 - amici.swig_wrappers - ERROR - [model1_data1][FORWARD_FAILURE] AMICI forward simulation failed at t = 88.9436: AMICI failed to integrate the forward problem
2024-04-13 07:04:59.519 - amici.swig_wrappers - DEBUG - [model1_data1][CVODES:CVode:ERR_FAILURE] AMICI ERROR: in module CVODES in function CVode : At t = 88.9301 and h = 1.16027e-05, the error test failed repeatedly or with |h| = hmin.
2024-04-13 07:04:59.522 - amici.swig_wrappers - ERROR - [model1_data1][FORWARD_FAILURE] AMICI forward simulation failed at t = 88.9301: AMICI failed to integrate the forward problem
2024-04-13 07:05:02.642 - amici.swig_wrappers - DEBUG - [model1_data1][CVODES:CVode:ERR_FAILURE] AMICI ERROR: in module CVODES in function CVode : At t = 88.8741 and h = 1.82792e-05, the error test failed repeatedly or with |h| = hmin.
2024-04-13 07:05:02.643 - amici.swig_wrappers - ERROR - [model1_data1][FORWARD_FAILURE] AMICI forward simulation failed at t = 88.8741: AMICI failed to integrate the forward problem
2024-04-13 07:05:02.739 - amici.swig_wrappers - DEBUG - [model1_data1][CVODES:CVode:ERR_FAILURE] AMICI ERROR: in module CVODES in function CVode : At t = 88.8 and h = 1.47655e-05, the error test failed repeatedly or with |h| = hmin.
2024-04-13 07:05:02.740 - amici.swig_wrappers - ERROR - [model1_data1][FORWARD_FAILURE] AMICI forward simulation failed at t = 88.8: AMICI failed to integrate the forward problem
2024-04-13 07:05:03.541 - amici.swig_wrappers - DEBUG - [model1_data1][CVODES:CVode:ERR_FAILURE] AMICI ERROR: in module CVODES in function CVode : At t = 21.4733 and h = 3.85976e-06, the error test failed repeatedly or with |h| = hmin.
2024-04-13 07:05:03.542 - amici.swig_wrappers - ERROR - [model1_data1][FORWARD_FAILURE] AMICI forward simulation failed at t = 21.4733: AMICI failed to integrate the forward problem
2024-04-13 07:05:03.666 - amici.swig_wrappers - DEBUG - [model1_data1][CVODES:CVode:ERR_FAILURE] AMICI ERROR: in module CVODES in function CVode : At t = 27.5091 and h = 4.11826e-06, the error test failed repeatedly or with |h| = hmin.
2024-04-13 07:05:03.667 - amici.swig_wrappers - ERROR - [model1_data1][FORWARD_FAILURE] AMICI forward simulation failed at t = 27.5091: AMICI failed to integrate the forward problem

Now, in addition to queries on the result, we can also access the history.

[19]:
print("History type: ", type(result.optimize_result.list[0].history))
# print("Function value trace of best run: ", result.optimize_result.list[0].history.get_fval_trace())

fig, ax = plt.subplots(1, 2)
visualize.waterfall(result, ax=ax[0])
visualize.optimizer_history(result, ax=ax[1])
fig.set_size_inches((15, 5))
History type:  <class 'pypesto.history.memory.MemoryHistory'>
../_images/example_store_39_1.png

CSV History

The in-memory storage is, however, not stored anywhere. To do that, it is possible to store either to CSV or HDF5. This is specified via the storage_file option. If it ends in .csv, a pypesto.objective.history.CsvHistory will be employed; if it ends in .hdf5 a pypesto.objective.history.Hdf5History. Occurrences of the substring {id} in the filename are replaced by the multistart id, allowing to maintain a separate file per run (this is necessary for CSV as otherwise runs are overwritten).

[20]:
# create temporary file
with tempfile.NamedTemporaryFile(suffix="_{id}.csv") as fn_csv:
    # record the history and store to CSV
    history_options = pypesto.HistoryOptions(
        trace_record=True, storage_file=fn_csv.name
    )

    # Run optimizations
    result = optimize.minimize(
        problem=problem,
        optimizer=optimizer,
        n_starts=n_starts,
        history_options=history_options,
        filename=None,
    )
2024-04-13 07:05:20.874 - amici.swig_wrappers - DEBUG - [model1_data1][CVODES:CVode:ERR_FAILURE] AMICI ERROR: in module CVODES in function CVode : At t = 89.2789 and h = 1.68903e-05, the error test failed repeatedly or with |h| = hmin.
2024-04-13 07:05:20.875 - amici.swig_wrappers - ERROR - [model1_data1][FORWARD_FAILURE] AMICI forward simulation failed at t = 89.2789: AMICI failed to integrate the forward problem
2024-04-13 07:05:21.003 - amici.swig_wrappers - DEBUG - [model1_data1][CVODES:CVode:ERR_FAILURE] AMICI ERROR: in module CVODES in function CVode : At t = 145.481 and h = 2.09263e-05, the error test failed repeatedly or with |h| = hmin.
2024-04-13 07:05:21.004 - amici.swig_wrappers - ERROR - [model1_data1][FORWARD_FAILURE] AMICI forward simulation failed at t = 145.481: AMICI failed to integrate the forward problem
2024-04-13 07:05:21.318 - amici.swig_wrappers - DEBUG - [model1_data1][CVODES:CVode:ERR_FAILURE] AMICI ERROR: in module CVODES in function CVode : At t = 88.8581 and h = 1.52709e-05, the error test failed repeatedly or with |h| = hmin.
2024-04-13 07:05:21.319 - amici.swig_wrappers - ERROR - [model1_data1][FORWARD_FAILURE] AMICI forward simulation failed at t = 88.8581: AMICI failed to integrate the forward problem
2024-04-13 07:05:21.590 - amici.swig_wrappers - DEBUG - [model1_data1][CVODES:CVode:ERR_FAILURE] AMICI ERROR: in module CVODES in function CVode : At t = 89.0421 and h = 4.74237e-06, the error test failed repeatedly or with |h| = hmin.
2024-04-13 07:05:21.591 - amici.swig_wrappers - ERROR - [model1_data1][FORWARD_FAILURE] AMICI forward simulation failed at t = 89.0421: AMICI failed to integrate the forward problem
2024-04-13 07:05:21.980 - amici.swig_wrappers - DEBUG - [model1_data1][CVODES:CVode:ERR_FAILURE] AMICI ERROR: in module CVODES in function CVode : At t = 89.0769 and h = 1.35294e-05, the error test failed repeatedly or with |h| = hmin.
2024-04-13 07:05:21.981 - amici.swig_wrappers - ERROR - [model1_data1][FORWARD_FAILURE] AMICI forward simulation failed at t = 89.0769: AMICI failed to integrate the forward problem
2024-04-13 07:05:23.629 - amici.swig_wrappers - DEBUG - [model1_data1][CVODES:CVode:ERR_FAILURE] AMICI ERROR: in module CVODES in function CVode : At t = 89.0041 and h = 4.22346e-06, the error test failed repeatedly or with |h| = hmin.
2024-04-13 07:05:23.630 - amici.swig_wrappers - ERROR - [model1_data1][FORWARD_FAILURE] AMICI forward simulation failed at t = 89.0041: AMICI failed to integrate the forward problem
2024-04-13 07:05:24.694 - amici.swig_wrappers - DEBUG - [model1_data1][CVODES:CVode:ERR_FAILURE] AMICI ERROR: in module CVODES in function CVode : At t = 188.662 and h = 4.54643e-05, the error test failed repeatedly or with |h| = hmin.
2024-04-13 07:05:24.695 - amici.swig_wrappers - ERROR - [model1_data1][FORWARD_FAILURE] AMICI forward simulation failed at t = 188.662: AMICI failed to integrate the forward problem
2024-04-13 07:05:25.638 - amici.swig_wrappers - DEBUG - [model1_data1][CVODES:CVode:ERR_FAILURE] AMICI ERROR: in module CVODES in function CVode : At t = 145.631 and h = 3.03929e-05, the error test failed repeatedly or with |h| = hmin.
2024-04-13 07:05:25.638 - amici.swig_wrappers - ERROR - [model1_data1][FORWARD_FAILURE] AMICI forward simulation failed at t = 145.631: AMICI failed to integrate the forward problem
2024-04-13 07:05:25.741 - amici.swig_wrappers - DEBUG - [model1_data1][CVODES:CVode:ERR_FAILURE] AMICI ERROR: in module CVODES in function CVode : At t = 144.589 and h = 4.64427e-05, the error test failed repeatedly or with |h| = hmin.
2024-04-13 07:05:25.742 - amici.swig_wrappers - ERROR - [model1_data1][FORWARD_FAILURE] AMICI forward simulation failed at t = 144.589: AMICI failed to integrate the forward problem
2024-04-13 07:05:27.073 - amici.swig_wrappers - DEBUG - [model1_data1][CVODES:CVode:ERR_FAILURE] AMICI ERROR: in module CVODES in function CVode : At t = 85.5189 and h = 4.7785e-06, the error test failed repeatedly or with |h| = hmin.
2024-04-13 07:05:27.073 - amici.swig_wrappers - ERROR - [model1_data1][FORWARD_FAILURE] AMICI forward simulation failed at t = 85.5189: AMICI failed to integrate the forward problem
2024-04-13 07:05:27.149 - amici.swig_wrappers - DEBUG - [model1_data1][CVODES:CVode:ERR_FAILURE] AMICI ERROR: in module CVODES in function CVode : At t = 97.7864 and h = 1.52264e-05, the error test failed repeatedly or with |h| = hmin.
2024-04-13 07:05:27.149 - amici.swig_wrappers - ERROR - [model1_data1][FORWARD_FAILURE] AMICI forward simulation failed at t = 97.7864: AMICI failed to integrate the forward problem
2024-04-13 07:05:27.504 - amici.swig_wrappers - DEBUG - [model1_data1][CVODES:CVode:ERR_FAILURE] AMICI ERROR: in module CVODES in function CVode : At t = 90.0481 and h = 1.59656e-05, the error test failed repeatedly or with |h| = hmin.
2024-04-13 07:05:27.505 - amici.swig_wrappers - ERROR - [model1_data1][FORWARD_FAILURE] AMICI forward simulation failed at t = 90.0481: AMICI failed to integrate the forward problem
2024-04-13 07:05:27.665 - amici.swig_wrappers - DEBUG - [model1_data1][CVODES:CVode:ERR_FAILURE] AMICI ERROR: in module CVODES in function CVode : At t = 89.4768 and h = 1.34082e-05, the error test failed repeatedly or with |h| = hmin.
2024-04-13 07:05:27.666 - amici.swig_wrappers - ERROR - [model1_data1][FORWARD_FAILURE] AMICI forward simulation failed at t = 89.4768: AMICI failed to integrate the forward problem
2024-04-13 07:05:28.809 - amici.swig_wrappers - DEBUG - [model1_data1][CVODES:CVode:ERR_FAILURE] AMICI ERROR: in module CVODES in function CVode : At t = 168.521 and h = 2.8908e-05, the error test failed repeatedly or with |h| = hmin.
2024-04-13 07:05:28.810 - amici.swig_wrappers - ERROR - [model1_data1][FORWARD_FAILURE] AMICI forward simulation failed at t = 168.521: AMICI failed to integrate the forward problem
2024-04-13 07:05:29.554 - amici.swig_wrappers - DEBUG - [model1_data1][CVODES:CVode:ERR_FAILURE] AMICI ERROR: in module CVODES in function CVode : At t = 98.1063 and h = 1.86095e-05, the error test failed repeatedly or with |h| = hmin.
2024-04-13 07:05:29.555 - amici.swig_wrappers - ERROR - [model1_data1][FORWARD_FAILURE] AMICI forward simulation failed at t = 98.1063: AMICI failed to integrate the forward problem
2024-04-13 07:05:30.352 - amici.swig_wrappers - DEBUG - [model1_data1][CVODES:CVode:ERR_FAILURE] AMICI ERROR: in module CVODES in function CVode : At t = 88.759 and h = 1.62583e-05, the error test failed repeatedly or with |h| = hmin.
2024-04-13 07:05:30.352 - amici.swig_wrappers - ERROR - [model1_data1][FORWARD_FAILURE] AMICI forward simulation failed at t = 88.759: AMICI failed to integrate the forward problem
2024-04-13 07:05:31.522 - amici.swig_wrappers - DEBUG - [model1_data1][CVODES:CVode:ERR_FAILURE] AMICI ERROR: in module CVODES in function CVode : At t = 146.783 and h = 3.12603e-05, the error test failed repeatedly or with |h| = hmin.
2024-04-13 07:05:31.522 - amici.swig_wrappers - ERROR - [model1_data1][FORWARD_FAILURE] AMICI forward simulation failed at t = 146.783: AMICI failed to integrate the forward problem
2024-04-13 07:05:31.629 - amici.swig_wrappers - DEBUG - [model1_data1][CVODES:CVode:ERR_FAILURE] AMICI ERROR: in module CVODES in function CVode : At t = 142.228 and h = 2.37082e-05, the error test failed repeatedly or with |h| = hmin.
2024-04-13 07:05:31.630 - amici.swig_wrappers - ERROR - [model1_data1][FORWARD_FAILURE] AMICI forward simulation failed at t = 142.228: AMICI failed to integrate the forward problem
2024-04-13 07:05:33.999 - amici.swig_wrappers - DEBUG - [model1_data1][CVODES:CVode:ERR_FAILURE] AMICI ERROR: in module CVODES in function CVode : At t = 150.572 and h = 9.92632e-06, the error test failed repeatedly or with |h| = hmin.
2024-04-13 07:05:34.000 - amici.swig_wrappers - ERROR - [model1_data1][FORWARD_FAILURE] AMICI forward simulation failed at t = 150.572: AMICI failed to integrate the forward problem
2024-04-13 07:05:34.314 - amici.swig_wrappers - DEBUG - [model1_data1][CVODES:CVode:ERR_FAILURE] AMICI ERROR: in module CVODES in function CVode : At t = 139.75 and h = 3.6657e-05, the error test failed repeatedly or with |h| = hmin.
2024-04-13 07:05:34.315 - amici.swig_wrappers - ERROR - [model1_data1][FORWARD_FAILURE] AMICI forward simulation failed at t = 139.75: AMICI failed to integrate the forward problem
2024-04-13 07:05:36.656 - amici.swig_wrappers - DEBUG - [model1_data1][CVODES:CVode:ERR_FAILURE] AMICI ERROR: in module CVODES in function CVode : At t = 145.084 and h = 2.75447e-05, the error test failed repeatedly or with |h| = hmin.
2024-04-13 07:05:36.656 - amici.swig_wrappers - ERROR - [model1_data1][FORWARD_FAILURE] AMICI forward simulation failed at t = 145.084: AMICI failed to integrate the forward problem
2024-04-13 07:05:37.023 - amici.swig_wrappers - DEBUG - [model1_data1][CVODES:CVode:ERR_FAILURE] AMICI ERROR: in module CVODES in function CVode : At t = 89.0329 and h = 1.95637e-05, the error test failed repeatedly or with |h| = hmin.
2024-04-13 07:05:37.024 - amici.swig_wrappers - ERROR - [model1_data1][FORWARD_FAILURE] AMICI forward simulation failed at t = 89.0329: AMICI failed to integrate the forward problem
2024-04-13 07:05:37.997 - amici.swig_wrappers - DEBUG - [model1_data1][CVODES:CVode:ERR_FAILURE] AMICI ERROR: in module CVODES in function CVode : At t = 89.0597 and h = 1.45749e-05, the error test failed repeatedly or with |h| = hmin.
2024-04-13 07:05:37.998 - amici.swig_wrappers - ERROR - [model1_data1][FORWARD_FAILURE] AMICI forward simulation failed at t = 89.0597: AMICI failed to integrate the forward problem
2024-04-13 07:05:38.178 - amici.swig_wrappers - DEBUG - [model1_data1][CVODES:CVode:ERR_FAILURE] AMICI ERROR: in module CVODES in function CVode : At t = 89.2728 and h = 1.47724e-05, the error test failed repeatedly or with |h| = hmin.
2024-04-13 07:05:38.178 - amici.swig_wrappers - ERROR - [model1_data1][FORWARD_FAILURE] AMICI forward simulation failed at t = 89.2728: AMICI failed to integrate the forward problem
2024-04-13 07:05:38.199 - amici.swig_wrappers - DEBUG - [model1_data1][CVODES:CVode:ERR_FAILURE] AMICI ERROR: in module CVODES in function CVode : At t = 89.0688 and h = 1.35025e-05, the error test failed repeatedly or with |h| = hmin.
2024-04-13 07:05:38.200 - amici.swig_wrappers - ERROR - [model1_data1][FORWARD_FAILURE] AMICI forward simulation failed at t = 89.0688: AMICI failed to integrate the forward problem
2024-04-13 07:05:39.570 - amici.swig_wrappers - DEBUG - [model1_data1][CVODES:CVode:ERR_FAILURE] AMICI ERROR: in module CVODES in function CVode : At t = 121.459 and h = 2.18829e-05, the error test failed repeatedly or with |h| = hmin.
2024-04-13 07:05:39.571 - amici.swig_wrappers - ERROR - [model1_data1][FORWARD_FAILURE] AMICI forward simulation failed at t = 121.459: AMICI failed to integrate the forward problem

Note that for this simple cost function, saving to CSV takes a considerable amount of time. This overhead decreases for more costly simulators, e.g., using ODE simulations via AMICI.

[21]:
print("History type: ", type(result.optimize_result.list[0].history))
# print("Function value trace of best run: ", result.optimize_result.list[0].history.get_fval_trace())

fig, ax = plt.subplots(1, 2)
visualize.waterfall(result, ax=ax[0])
visualize.optimizer_history(result, ax=ax[1])
fig.set_size_inches((15, 5))
History type:  <class 'pypesto.history.amici.CsvAmiciHistory'>
../_images/example_store_44_1.png

HDF5 History

Just as in CSV, writing the history to HDF5 takes a considerable amount of time. If a user specifies a HDF5 output file named my_results.hdf5 and uses a parallelization engine, then: * a folder is created to contain partial results, named my_results/ (the stem of the output filename) * files are created to store the results of each start, named my_results/my_results_{START_INDEX}.hdf5 * a file is created to store the combined result from all starts, named my_results.hdf5. Note that this file depends on the files in the my_results/ directory, so cease to function if my_results/ is deleted.

[22]:
# create temporary file
f_hdf5 = tempfile.NamedTemporaryFile(suffix=".hdf5", delete=False)
fn_hdf5 = f_hdf5.name

# record the history and store to CSV
history_options = pypesto.HistoryOptions(
    trace_record=True, storage_file=fn_hdf5
)

# Run optimizations
result = optimize.minimize(
    problem=problem,
    optimizer=optimizer,
    n_starts=n_starts,
    history_options=history_options,
    filename=fn_hdf5,
)
2024-04-13 07:05:46.324 - amici.swig_wrappers - DEBUG - [model1_data1][CVODES:CVode:ERR_FAILURE] AMICI ERROR: in module CVODES in function CVode : At t = 89.2626 and h = 1.33787e-05, the error test failed repeatedly or with |h| = hmin.
2024-04-13 07:05:46.325 - amici.swig_wrappers - ERROR - [model1_data1][FORWARD_FAILURE] AMICI forward simulation failed at t = 89.2626: AMICI failed to integrate the forward problem
2024-04-13 07:05:48.741 - amici.swig_wrappers - DEBUG - [model1_data1][CVODES:CVode:ERR_FAILURE] AMICI ERROR: in module CVODES in function CVode : At t = 146.101 and h = 1.5129e-05, the error test failed repeatedly or with |h| = hmin.
2024-04-13 07:05:48.742 - amici.swig_wrappers - ERROR - [model1_data1][FORWARD_FAILURE] AMICI forward simulation failed at t = 146.101: AMICI failed to integrate the forward problem
2024-04-13 07:05:48.930 - amici.swig_wrappers - DEBUG - [model1_data1][CVODES:CVode:ERR_FAILURE] AMICI ERROR: in module CVODES in function CVode : At t = 91.1164 and h = 3.49892e-06, the error test failed repeatedly or with |h| = hmin.
2024-04-13 07:05:48.930 - amici.swig_wrappers - ERROR - [model1_data1][FORWARD_FAILURE] AMICI forward simulation failed at t = 91.1164: AMICI failed to integrate the forward problem
2024-04-13 07:05:49.313 - amici.swig_wrappers - DEBUG - [model1_data1][CVODES:CVode:ERR_FAILURE] AMICI ERROR: in module CVODES in function CVode : At t = 88.9826 and h = 1.53104e-05, the error test failed repeatedly or with |h| = hmin.
2024-04-13 07:05:49.314 - amici.swig_wrappers - ERROR - [model1_data1][FORWARD_FAILURE] AMICI forward simulation failed at t = 88.9826: AMICI failed to integrate the forward problem
2024-04-13 07:05:50.551 - amici.swig_wrappers - DEBUG - [model1_data1][CVODES:CVode:ERR_FAILURE] AMICI ERROR: in module CVODES in function CVode : At t = 118.558 and h = 3.17456e-05, the error test failed repeatedly or with |h| = hmin.
2024-04-13 07:05:50.552 - amici.swig_wrappers - ERROR - [model1_data1][FORWARD_FAILURE] AMICI forward simulation failed at t = 118.558: AMICI failed to integrate the forward problem
2024-04-13 07:05:52.247 - amici.swig_wrappers - DEBUG - [model1_data1][CVODES:CVode:ERR_FAILURE] AMICI ERROR: in module CVODES in function CVode : At t = 145.535 and h = 3.75048e-05, the error test failed repeatedly or with |h| = hmin.
2024-04-13 07:05:52.248 - amici.swig_wrappers - ERROR - [model1_data1][FORWARD_FAILURE] AMICI forward simulation failed at t = 145.535: AMICI failed to integrate the forward problem
2024-04-13 07:05:52.359 - amici.swig_wrappers - DEBUG - [model1_data1][CVODES:CVode:ERR_FAILURE] AMICI ERROR: in module CVODES in function CVode : At t = 89.0026 and h = 1.9011e-05, the error test failed repeatedly or with |h| = hmin.
2024-04-13 07:05:52.359 - amici.swig_wrappers - ERROR - [model1_data1][FORWARD_FAILURE] AMICI forward simulation failed at t = 89.0026: AMICI failed to integrate the forward problem
2024-04-13 07:05:53.412 - amici.swig_wrappers - DEBUG - [model1_data1][CVODES:CVode:ERR_FAILURE] AMICI ERROR: in module CVODES in function CVode : At t = 145.64 and h = 2.57177e-05, the error test failed repeatedly or with |h| = hmin.
2024-04-13 07:05:53.413 - amici.swig_wrappers - ERROR - [model1_data1][FORWARD_FAILURE] AMICI forward simulation failed at t = 145.64: AMICI failed to integrate the forward problem
2024-04-13 07:05:53.585 - amici.swig_wrappers - DEBUG - [model1_data1][CVODES:CVode:ERR_FAILURE] AMICI ERROR: in module CVODES in function CVode : At t = 89.0276 and h = 1.57706e-05, the error test failed repeatedly or with |h| = hmin.
2024-04-13 07:05:53.586 - amici.swig_wrappers - ERROR - [model1_data1][FORWARD_FAILURE] AMICI forward simulation failed at t = 89.0276: AMICI failed to integrate the forward problem
2024-04-13 07:06:01.725 - amici.swig_wrappers - DEBUG - [model1_data1][CVODES:CVode:ERR_FAILURE] AMICI ERROR: in module CVODES in function CVode : At t = 233.475 and h = 3.28005e-05, the error test failed repeatedly or with |h| = hmin.
2024-04-13 07:06:01.726 - amici.swig_wrappers - ERROR - [model1_data1][FORWARD_FAILURE] AMICI forward simulation failed at t = 233.475: AMICI failed to integrate the forward problem
2024-04-13 07:06:03.633 - amici.swig_wrappers - DEBUG - [model1_data1][CVODES:CVode:ERR_FAILURE] AMICI ERROR: in module CVODES in function CVode : At t = 186.726 and h = 2.40078e-05, the error test failed repeatedly or with |h| = hmin.
2024-04-13 07:06:03.634 - amici.swig_wrappers - ERROR - [model1_data1][FORWARD_FAILURE] AMICI forward simulation failed at t = 186.726: AMICI failed to integrate the forward problem
2024-04-13 07:06:03.730 - amici.swig_wrappers - DEBUG - [model1_data1][CVODES:CVode:ERR_FAILURE] AMICI ERROR: in module CVODES in function CVode : At t = 213.482 and h = 2.79395e-05, the error test failed repeatedly or with |h| = hmin.
2024-04-13 07:06:03.731 - amici.swig_wrappers - ERROR - [model1_data1][FORWARD_FAILURE] AMICI forward simulation failed at t = 213.482: AMICI failed to integrate the forward problem
2024-04-13 07:06:03.780 - amici.swig_wrappers - DEBUG - [model1_data1][CVODES:CVode:ERR_FAILURE] AMICI ERROR: in module CVODES in function CVode : At t = 177.944 and h = 3.63799e-05, the error test failed repeatedly or with |h| = hmin.
2024-04-13 07:06:03.781 - amici.swig_wrappers - ERROR - [model1_data1][FORWARD_FAILURE] AMICI forward simulation failed at t = 177.944: AMICI failed to integrate the forward problem
2024-04-13 07:06:04.064 - amici.swig_wrappers - DEBUG - [model1_data1][CVODES:CVode:ERR_FAILURE] AMICI ERROR: in module CVODES in function CVode : At t = 127.817 and h = 1.47061e-05, the error test failed repeatedly or with |h| = hmin.
2024-04-13 07:06:04.065 - amici.swig_wrappers - ERROR - [model1_data1][FORWARD_FAILURE] AMICI forward simulation failed at t = 127.817: AMICI failed to integrate the forward problem
2024-04-13 07:06:04.106 - amici.swig_wrappers - DEBUG - [model1_data1][CVODES:CVode:ERR_FAILURE] AMICI ERROR: in module CVODES in function CVode : At t = 141.412 and h = 1.93279e-05, the error test failed repeatedly or with |h| = hmin.
2024-04-13 07:06:04.107 - amici.swig_wrappers - ERROR - [model1_data1][FORWARD_FAILURE] AMICI forward simulation failed at t = 141.412: AMICI failed to integrate the forward problem
2024-04-13 07:06:04.159 - amici.swig_wrappers - DEBUG - [model1_data1][CVODES:CVode:ERR_FAILURE] AMICI ERROR: in module CVODES in function CVode : At t = 204.819 and h = 1.94935e-05, the error test failed repeatedly or with |h| = hmin.
2024-04-13 07:06:04.160 - amici.swig_wrappers - ERROR - [model1_data1][FORWARD_FAILURE] AMICI forward simulation failed at t = 204.819: AMICI failed to integrate the forward problem
2024-04-13 07:06:04.208 - amici.swig_wrappers - DEBUG - [model1_data1][CVODES:CVode:ERR_FAILURE] AMICI ERROR: in module CVODES in function CVode : At t = 181.591 and h = 2.12755e-05, the error test failed repeatedly or with |h| = hmin.
2024-04-13 07:06:04.209 - amici.swig_wrappers - ERROR - [model1_data1][FORWARD_FAILURE] AMICI forward simulation failed at t = 181.591: AMICI failed to integrate the forward problem
2024-04-13 07:06:04.347 - amici.swig_wrappers - DEBUG - [model1_data1][CVODES:CVode:ERR_FAILURE] AMICI ERROR: in module CVODES in function CVode : At t = 150.949 and h = 2.02872e-05, the error test failed repeatedly or with |h| = hmin.
2024-04-13 07:06:04.348 - amici.swig_wrappers - ERROR - [model1_data1][FORWARD_FAILURE] AMICI forward simulation failed at t = 150.949: AMICI failed to integrate the forward problem
2024-04-13 07:06:04.444 - amici.swig_wrappers - DEBUG - [model1_data1][CVODES:CVode:ERR_FAILURE] AMICI ERROR: in module CVODES in function CVode : At t = 190.843 and h = 2.06892e-05, the error test failed repeatedly or with |h| = hmin.
2024-04-13 07:06:04.445 - amici.swig_wrappers - ERROR - [model1_data1][FORWARD_FAILURE] AMICI forward simulation failed at t = 190.843: AMICI failed to integrate the forward problem
2024-04-13 07:06:04.535 - amici.swig_wrappers - DEBUG - [model1_data1][CVODES:CVode:ERR_FAILURE] AMICI ERROR: in module CVODES in function CVode : At t = 188.354 and h = 2.0812e-05, the error test failed repeatedly or with |h| = hmin.
2024-04-13 07:06:04.536 - amici.swig_wrappers - ERROR - [model1_data1][FORWARD_FAILURE] AMICI forward simulation failed at t = 188.354: AMICI failed to integrate the forward problem
2024-04-13 07:06:04.585 - amici.swig_wrappers - DEBUG - [model1_data1][CVODES:CVode:ERR_FAILURE] AMICI ERROR: in module CVODES in function CVode : At t = 154.683 and h = 2.13243e-05, the error test failed repeatedly or with |h| = hmin.
2024-04-13 07:06:04.586 - amici.swig_wrappers - ERROR - [model1_data1][FORWARD_FAILURE] AMICI forward simulation failed at t = 154.683: AMICI failed to integrate the forward problem
2024-04-13 07:06:04.637 - amici.swig_wrappers - DEBUG - [model1_data1][CVODES:CVode:ERR_FAILURE] AMICI ERROR: in module CVODES in function CVode : At t = 165.298 and h = 2.11304e-05, the error test failed repeatedly or with |h| = hmin.
2024-04-13 07:06:04.637 - amici.swig_wrappers - ERROR - [model1_data1][FORWARD_FAILURE] AMICI forward simulation failed at t = 165.298: AMICI failed to integrate the forward problem
2024-04-13 07:06:04.740 - amici.swig_wrappers - DEBUG - [model1_data1][CVODES:CVode:ERR_FAILURE] AMICI ERROR: in module CVODES in function CVode : At t = 147.878 and h = 2.0837e-05, the error test failed repeatedly or with |h| = hmin.
2024-04-13 07:06:04.741 - amici.swig_wrappers - ERROR - [model1_data1][FORWARD_FAILURE] AMICI forward simulation failed at t = 147.878: AMICI failed to integrate the forward problem
2024-04-13 07:06:04.889 - amici.swig_wrappers - DEBUG - [model1_data1][CVODES:CVode:ERR_FAILURE] AMICI ERROR: in module CVODES in function CVode : At t = 137.643 and h = 2.1062e-05, the error test failed repeatedly or with |h| = hmin.
2024-04-13 07:06:04.890 - amici.swig_wrappers - ERROR - [model1_data1][FORWARD_FAILURE] AMICI forward simulation failed at t = 137.643: AMICI failed to integrate the forward problem
2024-04-13 07:06:05.229 - amici.swig_wrappers - DEBUG - [model1_data1][CVODES:CVode:ERR_FAILURE] AMICI ERROR: in module CVODES in function CVode : At t = 147.829 and h = 2.11503e-05, the error test failed repeatedly or with |h| = hmin.
2024-04-13 07:06:05.230 - amici.swig_wrappers - ERROR - [model1_data1][FORWARD_FAILURE] AMICI forward simulation failed at t = 147.829: AMICI failed to integrate the forward problem
2024-04-13 07:06:05.275 - amici.swig_wrappers - DEBUG - [model1_data1][CVODES:CVode:ERR_FAILURE] AMICI ERROR: in module CVODES in function CVode : At t = 170.28 and h = 2.09535e-05, the error test failed repeatedly or with |h| = hmin.
2024-04-13 07:06:05.276 - amici.swig_wrappers - ERROR - [model1_data1][FORWARD_FAILURE] AMICI forward simulation failed at t = 170.28: AMICI failed to integrate the forward problem
2024-04-13 07:06:05.365 - amici.swig_wrappers - DEBUG - [model1_data1][CVODES:CVode:ERR_FAILURE] AMICI ERROR: in module CVODES in function CVode : At t = 168.3 and h = 2.18868e-05, the error test failed repeatedly or with |h| = hmin.
2024-04-13 07:06:05.366 - amici.swig_wrappers - ERROR - [model1_data1][FORWARD_FAILURE] AMICI forward simulation failed at t = 168.3: AMICI failed to integrate the forward problem
2024-04-13 07:06:05.517 - amici.swig_wrappers - DEBUG - [model1_data1][CVODES:CVode:ERR_FAILURE] AMICI ERROR: in module CVODES in function CVode : At t = 164.799 and h = 2.17005e-05, the error test failed repeatedly or with |h| = hmin.
2024-04-13 07:06:05.517 - amici.swig_wrappers - ERROR - [model1_data1][FORWARD_FAILURE] AMICI forward simulation failed at t = 164.799: AMICI failed to integrate the forward problem
2024-04-13 07:06:05.555 - amici.swig_wrappers - DEBUG - [model1_data1][CVODES:CVode:ERR_FAILURE] AMICI ERROR: in module CVODES in function CVode : At t = 154.373 and h = 2.11787e-05, the error test failed repeatedly or with |h| = hmin.
2024-04-13 07:06:05.556 - amici.swig_wrappers - ERROR - [model1_data1][FORWARD_FAILURE] AMICI forward simulation failed at t = 154.373: AMICI failed to integrate the forward problem
2024-04-13 07:06:05.601 - amici.swig_wrappers - DEBUG - [model1_data1][CVODES:CVode:ERR_FAILURE] AMICI ERROR: in module CVODES in function CVode : At t = 150.864 and h = 2.05608e-05, the error test failed repeatedly or with |h| = hmin.
2024-04-13 07:06:05.602 - amici.swig_wrappers - ERROR - [model1_data1][FORWARD_FAILURE] AMICI forward simulation failed at t = 150.864: AMICI failed to integrate the forward problem
2024-04-13 07:06:05.686 - amici.swig_wrappers - DEBUG - [model1_data1][CVODES:CVode:ERR_FAILURE] AMICI ERROR: in module CVODES in function CVode : At t = 168.657 and h = 2.0906e-05, the error test failed repeatedly or with |h| = hmin.
2024-04-13 07:06:05.687 - amici.swig_wrappers - ERROR - [model1_data1][FORWARD_FAILURE] AMICI forward simulation failed at t = 168.657: AMICI failed to integrate the forward problem
2024-04-13 07:06:05.731 - amici.swig_wrappers - DEBUG - [model1_data1][CVODES:CVode:ERR_FAILURE] AMICI ERROR: in module CVODES in function CVode : At t = 182.034 and h = 2.1187e-05, the error test failed repeatedly or with |h| = hmin.
2024-04-13 07:06:05.731 - amici.swig_wrappers - ERROR - [model1_data1][FORWARD_FAILURE] AMICI forward simulation failed at t = 182.034: AMICI failed to integrate the forward problem
2024-04-13 07:06:05.772 - amici.swig_wrappers - DEBUG - [model1_data1][CVODES:CVode:ERR_FAILURE] AMICI ERROR: in module CVODES in function CVode : At t = 127.909 and h = 2.08038e-05, the error test failed repeatedly or with |h| = hmin.
2024-04-13 07:06:05.773 - amici.swig_wrappers - ERROR - [model1_data1][FORWARD_FAILURE] AMICI forward simulation failed at t = 127.909: AMICI failed to integrate the forward problem
2024-04-13 07:06:05.814 - amici.swig_wrappers - DEBUG - [model1_data1][CVODES:CVode:ERR_FAILURE] AMICI ERROR: in module CVODES in function CVode : At t = 165.204 and h = 2.12924e-05, the error test failed repeatedly or with |h| = hmin.
2024-04-13 07:06:05.814 - amici.swig_wrappers - ERROR - [model1_data1][FORWARD_FAILURE] AMICI forward simulation failed at t = 165.204: AMICI failed to integrate the forward problem
2024-04-13 07:06:05.901 - amici.swig_wrappers - DEBUG - [model1_data1][CVODES:CVode:ERR_FAILURE] AMICI ERROR: in module CVODES in function CVode : At t = 176.914 and h = 2.09662e-05, the error test failed repeatedly or with |h| = hmin.
2024-04-13 07:06:05.901 - amici.swig_wrappers - ERROR - [model1_data1][FORWARD_FAILURE] AMICI forward simulation failed at t = 176.914: AMICI failed to integrate the forward problem
2024-04-13 07:06:05.944 - amici.swig_wrappers - DEBUG - [model1_data1][CVODES:CVode:ERR_FAILURE] AMICI ERROR: in module CVODES in function CVode : At t = 190.951 and h = 2.07152e-05, the error test failed repeatedly or with |h| = hmin.
2024-04-13 07:06:05.945 - amici.swig_wrappers - ERROR - [model1_data1][FORWARD_FAILURE] AMICI forward simulation failed at t = 190.951: AMICI failed to integrate the forward problem
2024-04-13 07:06:05.974 - amici.swig_wrappers - DEBUG - [model1_data1][CVODES:CVode:ERR_FAILURE] AMICI ERROR: in module CVODES in function CVode : At t = 24.446 and h = 4.63623e-06, the error test failed repeatedly or with |h| = hmin.
2024-04-13 07:06:05.974 - amici.swig_wrappers - ERROR - [model1_data1][FORWARD_FAILURE] AMICI forward simulation failed at t = 24.446: AMICI failed to integrate the forward problem
[23]:
print("History type: ", type(result.optimize_result.list[0].history))
# print("Function value trace of best run: ", result.optimize_result.list[0].history.get_fval_trace())

fig, ax = plt.subplots(1, 2)
visualize.waterfall(result, ax=ax[0])
visualize.optimizer_history(result, ax=ax[1])
fig.set_size_inches((15, 5))
History type:  <class 'pypesto.history.amici.Hdf5AmiciHistory'>
../_images/example_store_48_1.png

For the HDF5 history, it is possible to load the history from file, and to plot it, together with the optimization result.

[24]:
# load the history
result_loaded_w_history = pypesto.store.read_result(fn_hdf5)

fig, ax = plt.subplots(1, 2)
visualize.waterfall(result_loaded_w_history, ax=ax[0])
visualize.optimizer_history(result_loaded_w_history, ax=ax[1])
fig.set_size_inches((15, 5))
/home/docs/checkouts/readthedocs.org/user_builds/pypesto/envs/v0.5.0/lib/python3.11/site-packages/pypesto/store/read_from_hdf5.py:304: UserWarning: You are loading a problem. This problem is not to be used without a separately created objective.
  result.problem = pypesto_problem_reader.read()
Loading the profiling result failed. It is highly likely that no profiling result exists within /tmp/tmp7n0r56_k.hdf5.
Loading the sampling result failed. It is highly likely that no sampling result exists within /tmp/tmp7n0r56_k.hdf5.
../_images/example_store_50_3.png
[25]:
# close the temporary file
f_hdf5.close()