|
21 | 21 | "\n", |
22 | 22 | "To begin, we will import a model using [PEtab](https://petab.readthedocs.io). For this demonstration, we will utilize the [Benchmark Collection](https://github.com/Benchmarking-Initiative/Benchmark-Models-PEtab), which provides a diverse set of models. For more information on importing PEtab models, refer to the corresponding [PEtab notebook](https://amici.readthedocs.io/en/latest/petab.html).\n", |
23 | 23 | "\n", |
24 | | - "In this tutorial, we will import the Böhm model from the Benchmark Collection. Using [amici.petab_import](https://amici.readthedocs.io/en/latest/generated/amici.petab_import.html#amici.petab_import.import_petab_problem), we will load the PEtab problem. To create a [JAXProblem](https://amici.readthedocs.io/en/latest/generated/amici.jax.html#amici.jax.JAXProblem) instead of a standard AMICI model, we set the `jax` parameter to `True`.\n" |
| 24 | + "In this tutorial, we will import the Böhm model from the Benchmark Collection. Using [amici.importers.petab.PetabImporter](https://amici.readthedocs.io/en/latest/generated/amici.importers.petab.html#amici.importers.petab.PetabImporter), we will load the PEtab problem. To create a [JAXProblem](https://amici.readthedocs.io/en/latest/generated/amici.sim.jax.html#amici.sim.jax.JAXProblem) instead of a standard AMICI model, we set the `jax` parameter to `True`.\n" |
25 | 25 | ] |
26 | 26 | }, |
27 | 27 | { |
|
65 | 65 | "source": [ |
66 | 66 | "## Simulation\n", |
67 | 67 | "\n", |
68 | | - "We can now run efficient simulation using [amici.jax.run_simulations]((https://amici.readthedocs.io/en/latest/generated/amici.jax.html#amici.jax.run_simulations)." |
| 68 | + "We can now run efficient simulation using [amici.sim.jax.run_simulations]((https://amici.readthedocs.io/en/latest/generated/amici.sim.jax.html#amici.sim.jax.run_simulations)." |
69 | 69 | ] |
70 | 70 | }, |
71 | 71 | { |
|
75 | 75 | "metadata": {}, |
76 | 76 | "outputs": [], |
77 | 77 | "source": [ |
78 | | - "from amici.jax import run_simulations\n", |
| 78 | + "from amici.sim.jax import run_simulations\n", |
79 | 79 | "\n", |
80 | 80 | "# Run simulations and compute the log-likelihood\n", |
81 | 81 | "llh, results = run_simulations(jax_problem)" |
|
249 | 249 | "source": [ |
250 | 250 | "The root cause of this error lies in the fact that, to enable autodiff, direct modifications of attributes are not allowed in [equinox](https://docs.kidger.site/equinox/), which AMICI utilizes under the hood. Consequently, attributes of instances like `JAXModel` or `JAXProblem` cannot be updated directly — this is the price we have to pay for autodiff.\n", |
251 | 251 | "\n", |
252 | | - "However, `JAXProblem` provides a convenient method called [update_parameters](https://amici.readthedocs.io/en/latest/generated/amici.jax.html#amici.jax.JAXProblem.update_parameters). The caveat is that this method creates a new JAXProblem instance instead of modifying the existing one." |
| 252 | + "However, `JAXProblem` provides a convenient method called [update_parameters](https://amici.readthedocs.io/en/latest/generated/amici.sim.jax.html#amici.sim.jax.JAXProblem.update_parameters). The caveat is that this method creates a new JAXProblem instance instead of modifying the existing one." |
253 | 253 | ] |
254 | 254 | }, |
255 | 255 | { |
|
386 | 386 | "import diffrax\n", |
387 | 387 | "import jax.numpy as jnp\n", |
388 | 388 | "import optimistix\n", |
389 | | - "from amici.jax import ReturnValue\n", |
| 389 | + "from amici.sim.jax import ReturnValue\n", |
390 | 390 | "\n", |
391 | 391 | "# Define the simulation condition\n", |
392 | 392 | "experiment_condition = \"_petab_experiment_condition___default__\"\n", |
|
0 commit comments