autoemulate 1.2.1__tar.gz → 2.0.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (126) hide show
  1. {autoemulate-1.2.1 → autoemulate-2.0.0}/PKG-INFO +5 -5
  2. {autoemulate-1.2.1 → autoemulate-2.0.0}/README.md +4 -4
  3. {autoemulate-1.2.1 → autoemulate-2.0.0}/autoemulate/core/plotting.py +56 -1
  4. autoemulate-2.0.0/autoemulate/simulations/__init__.py +22 -0
  5. {autoemulate-1.2.1 → autoemulate-2.0.0}/autoemulate/simulations/base.py +98 -1
  6. autoemulate-2.0.0/autoemulate/simulations/seir.py +110 -0
  7. {autoemulate-1.2.1 → autoemulate-2.0.0}/autoemulate.egg-info/PKG-INFO +5 -5
  8. {autoemulate-1.2.1 → autoemulate-2.0.0}/autoemulate.egg-info/SOURCES.txt +1 -0
  9. {autoemulate-1.2.1 → autoemulate-2.0.0}/pyproject.toml +1 -1
  10. autoemulate-1.2.1/autoemulate/simulations/__init__.py +0 -9
  11. {autoemulate-1.2.1 → autoemulate-2.0.0}/LICENSE +0 -0
  12. {autoemulate-1.2.1 → autoemulate-2.0.0}/autoemulate/__init__.py +0 -0
  13. {autoemulate-1.2.1 → autoemulate-2.0.0}/autoemulate/calibration/__init__.py +0 -0
  14. {autoemulate-1.2.1 → autoemulate-2.0.0}/autoemulate/calibration/base.py +0 -0
  15. {autoemulate-1.2.1 → autoemulate-2.0.0}/autoemulate/calibration/bayes.py +0 -0
  16. {autoemulate-1.2.1 → autoemulate-2.0.0}/autoemulate/calibration/history_matching.py +0 -0
  17. {autoemulate-1.2.1 → autoemulate-2.0.0}/autoemulate/calibration/history_matching_dashboard.py +0 -0
  18. {autoemulate-1.2.1 → autoemulate-2.0.0}/autoemulate/calibration/interval_excursion_set.py +0 -0
  19. {autoemulate-1.2.1 → autoemulate-2.0.0}/autoemulate/callbacks/early_stopping.py +0 -0
  20. {autoemulate-1.2.1 → autoemulate-2.0.0}/autoemulate/core/__init__.py +0 -0
  21. {autoemulate-1.2.1 → autoemulate-2.0.0}/autoemulate/core/compare.py +0 -0
  22. {autoemulate-1.2.1 → autoemulate-2.0.0}/autoemulate/core/device.py +0 -0
  23. {autoemulate-1.2.1 → autoemulate-2.0.0}/autoemulate/core/logging_config.py +0 -0
  24. {autoemulate-1.2.1 → autoemulate-2.0.0}/autoemulate/core/metrics.py +0 -0
  25. {autoemulate-1.2.1 → autoemulate-2.0.0}/autoemulate/core/model_selection.py +0 -0
  26. {autoemulate-1.2.1 → autoemulate-2.0.0}/autoemulate/core/reinitialize.py +0 -0
  27. {autoemulate-1.2.1 → autoemulate-2.0.0}/autoemulate/core/results.py +0 -0
  28. {autoemulate-1.2.1 → autoemulate-2.0.0}/autoemulate/core/save.py +0 -0
  29. {autoemulate-1.2.1 → autoemulate-2.0.0}/autoemulate/core/sensitivity_analysis.py +0 -0
  30. {autoemulate-1.2.1 → autoemulate-2.0.0}/autoemulate/core/tuner.py +0 -0
  31. {autoemulate-1.2.1 → autoemulate-2.0.0}/autoemulate/core/types.py +0 -0
  32. {autoemulate-1.2.1 → autoemulate-2.0.0}/autoemulate/data/utils.py +0 -0
  33. {autoemulate-1.2.1 → autoemulate-2.0.0}/autoemulate/datasets/__init__.py +0 -0
  34. {autoemulate-1.2.1 → autoemulate-2.0.0}/autoemulate/datasets/cardiac1/description.md +0 -0
  35. {autoemulate-1.2.1 → autoemulate-2.0.0}/autoemulate/datasets/cardiac1/processed/outputs.csv +0 -0
  36. {autoemulate-1.2.1 → autoemulate-2.0.0}/autoemulate/datasets/cardiac1/processed/parameters.csv +0 -0
  37. {autoemulate-1.2.1 → autoemulate-2.0.0}/autoemulate/datasets/cardiac1/raw/outputs.csv +0 -0
  38. {autoemulate-1.2.1 → autoemulate-2.0.0}/autoemulate/datasets/cardiac1/raw/parameters.csv +0 -0
  39. {autoemulate-1.2.1 → autoemulate-2.0.0}/autoemulate/datasets/cardiac2/description.md +0 -0
  40. {autoemulate-1.2.1 → autoemulate-2.0.0}/autoemulate/datasets/cardiac2/processed/outputs.csv +0 -0
  41. {autoemulate-1.2.1 → autoemulate-2.0.0}/autoemulate/datasets/cardiac2/processed/parameters.csv +0 -0
  42. {autoemulate-1.2.1 → autoemulate-2.0.0}/autoemulate/datasets/cardiac2/raw/outputs.csv +0 -0
  43. {autoemulate-1.2.1 → autoemulate-2.0.0}/autoemulate/datasets/cardiac2/raw/parameters.csv +0 -0
  44. {autoemulate-1.2.1 → autoemulate-2.0.0}/autoemulate/datasets/cardiac3/description.md +0 -0
  45. {autoemulate-1.2.1 → autoemulate-2.0.0}/autoemulate/datasets/cardiac3/processed/outputs.csv +0 -0
  46. {autoemulate-1.2.1 → autoemulate-2.0.0}/autoemulate/datasets/cardiac3/processed/parameters.csv +0 -0
  47. {autoemulate-1.2.1 → autoemulate-2.0.0}/autoemulate/datasets/cardiac3/raw/outputs.csv +0 -0
  48. {autoemulate-1.2.1 → autoemulate-2.0.0}/autoemulate/datasets/cardiac3/raw/parameters.csv +0 -0
  49. {autoemulate-1.2.1 → autoemulate-2.0.0}/autoemulate/datasets/cardiac4/description.md +0 -0
  50. {autoemulate-1.2.1 → autoemulate-2.0.0}/autoemulate/datasets/cardiac4/processed/outputs.csv +0 -0
  51. {autoemulate-1.2.1 → autoemulate-2.0.0}/autoemulate/datasets/cardiac4/processed/parameters.csv +0 -0
  52. {autoemulate-1.2.1 → autoemulate-2.0.0}/autoemulate/datasets/cardiac4/raw/outputs.csv +0 -0
  53. {autoemulate-1.2.1 → autoemulate-2.0.0}/autoemulate/datasets/cardiac4/raw/parameters.csv +0 -0
  54. {autoemulate-1.2.1 → autoemulate-2.0.0}/autoemulate/datasets/cardiac5/description.md +0 -0
  55. {autoemulate-1.2.1 → autoemulate-2.0.0}/autoemulate/datasets/cardiac5/processed/outputs.csv +0 -0
  56. {autoemulate-1.2.1 → autoemulate-2.0.0}/autoemulate/datasets/cardiac5/processed/parameters.csv +0 -0
  57. {autoemulate-1.2.1 → autoemulate-2.0.0}/autoemulate/datasets/cardiac5/raw/passive_mechanics/outputs.csv +0 -0
  58. {autoemulate-1.2.1 → autoemulate-2.0.0}/autoemulate/datasets/cardiac5/raw/passive_mechanics/parameters.csv +0 -0
  59. {autoemulate-1.2.1 → autoemulate-2.0.0}/autoemulate/datasets/cardiac5/raw/passive_mechanics.tar.xz +0 -0
  60. {autoemulate-1.2.1 → autoemulate-2.0.0}/autoemulate/datasets/cardiac6/description.md +0 -0
  61. {autoemulate-1.2.1 → autoemulate-2.0.0}/autoemulate/datasets/cardiac6/processed/outputs.csv +0 -0
  62. {autoemulate-1.2.1 → autoemulate-2.0.0}/autoemulate/datasets/cardiac6/processed/parameters.csv +0 -0
  63. {autoemulate-1.2.1 → autoemulate-2.0.0}/autoemulate/datasets/cardiac6/raw/outputs.csv +0 -0
  64. {autoemulate-1.2.1 → autoemulate-2.0.0}/autoemulate/datasets/cardiac6/raw/parameters.csv +0 -0
  65. {autoemulate-1.2.1 → autoemulate-2.0.0}/autoemulate/datasets/climate1/description.md +0 -0
  66. {autoemulate-1.2.1 → autoemulate-2.0.0}/autoemulate/datasets/climate1/processed/outputs.csv +0 -0
  67. {autoemulate-1.2.1 → autoemulate-2.0.0}/autoemulate/datasets/climate1/processed/parameters.csv +0 -0
  68. {autoemulate-1.2.1 → autoemulate-2.0.0}/autoemulate/datasets/climate1/raw/Holden2018.csv +0 -0
  69. {autoemulate-1.2.1 → autoemulate-2.0.0}/autoemulate/datasets/datasets.py +0 -0
  70. {autoemulate-1.2.1 → autoemulate-2.0.0}/autoemulate/datasets/engineering1/description.md +0 -0
  71. {autoemulate-1.2.1 → autoemulate-2.0.0}/autoemulate/datasets/engineering1/processed/outputs.csv +0 -0
  72. {autoemulate-1.2.1 → autoemulate-2.0.0}/autoemulate/datasets/engineering1/processed/parameters.csv +0 -0
  73. {autoemulate-1.2.1 → autoemulate-2.0.0}/autoemulate/datasets/engineering1/raw/Nervi_truss_datasets.zip +0 -0
  74. {autoemulate-1.2.1 → autoemulate-2.0.0}/autoemulate/datasets/engineering1/raw/datasets/Sobol_CSV_data_1000.csv +0 -0
  75. {autoemulate-1.2.1 → autoemulate-2.0.0}/autoemulate/datasets/reactiondiffusion1/processed/outputs.csv +0 -0
  76. {autoemulate-1.2.1 → autoemulate-2.0.0}/autoemulate/datasets/reactiondiffusion1/processed/parameters.csv +0 -0
  77. {autoemulate-1.2.1 → autoemulate-2.0.0}/autoemulate/emulators/__init__.py +0 -0
  78. {autoemulate-1.2.1 → autoemulate-2.0.0}/autoemulate/emulators/base.py +0 -0
  79. {autoemulate-1.2.1 → autoemulate-2.0.0}/autoemulate/emulators/ensemble.py +0 -0
  80. {autoemulate-1.2.1 → autoemulate-2.0.0}/autoemulate/emulators/gaussian_process/__init__.py +0 -0
  81. {autoemulate-1.2.1 → autoemulate-2.0.0}/autoemulate/emulators/gaussian_process/exact.py +0 -0
  82. {autoemulate-1.2.1 → autoemulate-2.0.0}/autoemulate/emulators/gaussian_process/kernel.py +0 -0
  83. {autoemulate-1.2.1 → autoemulate-2.0.0}/autoemulate/emulators/gaussian_process/mean.py +0 -0
  84. {autoemulate-1.2.1 → autoemulate-2.0.0}/autoemulate/emulators/gaussian_process/poly_mean.py +0 -0
  85. {autoemulate-1.2.1 → autoemulate-2.0.0}/autoemulate/emulators/gradient_boosting.py +0 -0
  86. {autoemulate-1.2.1 → autoemulate-2.0.0}/autoemulate/emulators/lightgbm.py +0 -0
  87. {autoemulate-1.2.1 → autoemulate-2.0.0}/autoemulate/emulators/nn/__init__.py +0 -0
  88. {autoemulate-1.2.1 → autoemulate-2.0.0}/autoemulate/emulators/nn/mlp.py +0 -0
  89. {autoemulate-1.2.1 → autoemulate-2.0.0}/autoemulate/emulators/polynomials.py +0 -0
  90. {autoemulate-1.2.1 → autoemulate-2.0.0}/autoemulate/emulators/radial_basis_functions.py +0 -0
  91. {autoemulate-1.2.1 → autoemulate-2.0.0}/autoemulate/emulators/random_forest.py +0 -0
  92. {autoemulate-1.2.1 → autoemulate-2.0.0}/autoemulate/emulators/registry.py +0 -0
  93. {autoemulate-1.2.1 → autoemulate-2.0.0}/autoemulate/emulators/svm.py +0 -0
  94. {autoemulate-1.2.1 → autoemulate-2.0.0}/autoemulate/emulators/transformed/__init__.py +0 -0
  95. {autoemulate-1.2.1 → autoemulate-2.0.0}/autoemulate/emulators/transformed/base.py +0 -0
  96. {autoemulate-1.2.1 → autoemulate-2.0.0}/autoemulate/emulators/transformed/delta_method.py +0 -0
  97. {autoemulate-1.2.1 → autoemulate-2.0.0}/autoemulate/experimental/data/gaussian.py +0 -0
  98. {autoemulate-1.2.1 → autoemulate-2.0.0}/autoemulate/experimental/data/spatiotemporal_dataset.py +0 -0
  99. {autoemulate-1.2.1 → autoemulate-2.0.0}/autoemulate/experimental/emulators/fno.py +0 -0
  100. {autoemulate-1.2.1 → autoemulate-2.0.0}/autoemulate/experimental/emulators/nn/gaussian_mlp.py +0 -0
  101. {autoemulate-1.2.1 → autoemulate-2.0.0}/autoemulate/experimental/emulators/nn/zoib.py +0 -0
  102. {autoemulate-1.2.1 → autoemulate-2.0.0}/autoemulate/experimental/emulators/spatiotemporal.py +0 -0
  103. {autoemulate-1.2.1 → autoemulate-2.0.0}/autoemulate/experimental/neural_processes/conditional_neural_process.py +0 -0
  104. {autoemulate-1.2.1 → autoemulate-2.0.0}/autoemulate/feature_generation/polynomial_features.py +0 -0
  105. {autoemulate-1.2.1 → autoemulate-2.0.0}/autoemulate/learners/__init__.py +0 -0
  106. {autoemulate-1.2.1 → autoemulate-2.0.0}/autoemulate/learners/base.py +0 -0
  107. {autoemulate-1.2.1 → autoemulate-2.0.0}/autoemulate/learners/membership.py +0 -0
  108. {autoemulate-1.2.1 → autoemulate-2.0.0}/autoemulate/learners/pool.py +0 -0
  109. {autoemulate-1.2.1 → autoemulate-2.0.0}/autoemulate/learners/stream.py +0 -0
  110. {autoemulate-1.2.1 → autoemulate-2.0.0}/autoemulate/simulations/advection_diffusion.py +0 -0
  111. {autoemulate-1.2.1 → autoemulate-2.0.0}/autoemulate/simulations/double_pendulum.py +0 -0
  112. {autoemulate-1.2.1 → autoemulate-2.0.0}/autoemulate/simulations/epidemic.py +0 -0
  113. {autoemulate-1.2.1 → autoemulate-2.0.0}/autoemulate/simulations/flow_problem.py +0 -0
  114. {autoemulate-1.2.1 → autoemulate-2.0.0}/autoemulate/simulations/projectile.py +0 -0
  115. {autoemulate-1.2.1 → autoemulate-2.0.0}/autoemulate/simulations/reaction_diffusion.py +0 -0
  116. {autoemulate-1.2.1 → autoemulate-2.0.0}/autoemulate/transforms/__init__.py +0 -0
  117. {autoemulate-1.2.1 → autoemulate-2.0.0}/autoemulate/transforms/base.py +0 -0
  118. {autoemulate-1.2.1 → autoemulate-2.0.0}/autoemulate/transforms/pca.py +0 -0
  119. {autoemulate-1.2.1 → autoemulate-2.0.0}/autoemulate/transforms/standardize.py +0 -0
  120. {autoemulate-1.2.1 → autoemulate-2.0.0}/autoemulate/transforms/utils.py +0 -0
  121. {autoemulate-1.2.1 → autoemulate-2.0.0}/autoemulate/transforms/vae.py +0 -0
  122. {autoemulate-1.2.1 → autoemulate-2.0.0}/autoemulate.egg-info/dependency_links.txt +0 -0
  123. {autoemulate-1.2.1 → autoemulate-2.0.0}/autoemulate.egg-info/not-zip-safe +0 -0
  124. {autoemulate-1.2.1 → autoemulate-2.0.0}/autoemulate.egg-info/requires.txt +0 -0
  125. {autoemulate-1.2.1 → autoemulate-2.0.0}/autoemulate.egg-info/top_level.txt +0 -0
  126. {autoemulate-1.2.1 → autoemulate-2.0.0}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: autoemulate
3
- Version: 1.2.1
3
+ Version: 2.0.0
4
4
  Summary: A python package for semi-automated emulation
5
5
  Author: AutoEmulate contributors (see our GitHub page)
6
6
  License-Expression: MIT
@@ -73,13 +73,9 @@ Dynamic: license-file
73
73
  [![Documentation](https://img.shields.io/badge/documentation-blue)](https://alan-turing-institute.github.io/autoemulate/)
74
74
  [![Github Stats](https://img.shields.io/badge/repostats-orange)](https://github.com/alan-turing-institute/autoemulate/blob/github-repo-stats/alan-turing-institute/autoemulate/latest-report/report.pdf)
75
75
 
76
-
77
76
  <!-- SPHINX-START -->
78
77
  Simulations of physical systems are often slow and need lots of compute, which makes them unpractical for real-world applications like digital twins, or when they have to run thousands of times for sensitivity analyses. The goal of `AutoEmulate` is to make it easy to replace simulations with fast, accurate emulators. To do this, `AutoEmulate` automatically fits and compares various emulators, ranging from simple models like Radial Basis Functions and Second Order Polynomials to more complex models like Support Vector Machines and Gaussian Processes to find the best emulator for a simulation.
79
78
 
80
- >[!WARNING]
81
- >Although AutoEmulate is currently on version 1.x, we are not following semantic versioning at the moment. The convention for V1 is that breaking and major changes will be made between minor version (1.1 -> 1.2). Bug fixes will be made in patch versions (1.1.1 -> 1.1.2). We plan to implement true semantic versioning in v2 of the package. We recommend pinning the minor version of AutoEmulate if using downstream and carefully reading release notes.
82
-
83
79
  ## Documentation
84
80
 
85
81
  You can find the project documentation [here](https://alan-turing-institute.github.io/autoemulate/), including [installation](https://alan-turing-institute.github.io/autoemulate/installation.html).
@@ -139,6 +135,10 @@ You can find the project documentation [here](https://alan-turing-institute.gith
139
135
  <td align="center" valign="top" width="14.28%"><a href="https://github.com/vchhabra-turing"><img src="https://avatars.githubusercontent.com/u/140401853?v=4?s=100" width="100px;" alt="vchhabra-turing"/><br /><sub><b>vchhabra-turing</b></sub></a><br /><a href="#ideas-vchhabra-turing" title="Ideas, Planning, & Feedback">🤔</a></td>
140
136
  <td align="center" valign="top" width="14.28%"><a href="https://github.com/era-23"><img src="https://avatars.githubusercontent.com/u/115151590?v=4?s=100" width="100px;" alt="Ethan Attwood"/><br /><sub><b>Ethan Attwood</b></sub></a><br /><a href="#bug-era-23" title="Bug reports">🐛</a></td>
141
137
  <td align="center" valign="top" width="14.28%"><a href="https://github.com/TheCSGuy25"><img src="https://avatars.githubusercontent.com/u/87066683?v=4?s=100" width="100px;" alt="__aar0n__.py"/><br /><sub><b>__aar0n__.py</b></sub></a><br /><a href="#code-TheCSGuy25" title="Code">💻</a></td>
138
+ <td align="center" valign="top" width="14.28%"><a href="https://github.com/SyedHaider2084"><img src="https://avatars.githubusercontent.com/u/227389830?v=4?s=100" width="100px;" alt="SyedHaider2084"/><br /><sub><b>SyedHaider2084</b></sub></a><br /><a href="#code-SyedHaider2084" title="Code">💻</a></td>
139
+ </tr>
140
+ <tr>
141
+ <td align="center" valign="top" width="14.28%"><a href="https://www.linkedin.com/in/lcm98/"><img src="https://avatars.githubusercontent.com/u/102757707?v=4?s=100" width="100px;" alt="Loh Chun Mun"/><br /><sub><b>Loh Chun Mun</b></sub></a><br /><a href="#doc-cmsamaaa" title="Documentation">📖</a> <a href="#code-cmsamaaa" title="Code">💻</a></td>
142
142
  </tr>
143
143
  </tbody>
144
144
  </table>
@@ -7,13 +7,9 @@
7
7
  [![Documentation](https://img.shields.io/badge/documentation-blue)](https://alan-turing-institute.github.io/autoemulate/)
8
8
  [![Github Stats](https://img.shields.io/badge/repostats-orange)](https://github.com/alan-turing-institute/autoemulate/blob/github-repo-stats/alan-turing-institute/autoemulate/latest-report/report.pdf)
9
9
 
10
-
11
10
  <!-- SPHINX-START -->
12
11
  Simulations of physical systems are often slow and need lots of compute, which makes them unpractical for real-world applications like digital twins, or when they have to run thousands of times for sensitivity analyses. The goal of `AutoEmulate` is to make it easy to replace simulations with fast, accurate emulators. To do this, `AutoEmulate` automatically fits and compares various emulators, ranging from simple models like Radial Basis Functions and Second Order Polynomials to more complex models like Support Vector Machines and Gaussian Processes to find the best emulator for a simulation.
13
12
 
14
- >[!WARNING]
15
- >Although AutoEmulate is currently on version 1.x, we are not following semantic versioning at the moment. The convention for V1 is that breaking and major changes will be made between minor version (1.1 -> 1.2). Bug fixes will be made in patch versions (1.1.1 -> 1.1.2). We plan to implement true semantic versioning in v2 of the package. We recommend pinning the minor version of AutoEmulate if using downstream and carefully reading release notes.
16
-
17
13
  ## Documentation
18
14
 
19
15
  You can find the project documentation [here](https://alan-turing-institute.github.io/autoemulate/), including [installation](https://alan-turing-institute.github.io/autoemulate/installation.html).
@@ -73,6 +69,10 @@ You can find the project documentation [here](https://alan-turing-institute.gith
73
69
  <td align="center" valign="top" width="14.28%"><a href="https://github.com/vchhabra-turing"><img src="https://avatars.githubusercontent.com/u/140401853?v=4?s=100" width="100px;" alt="vchhabra-turing"/><br /><sub><b>vchhabra-turing</b></sub></a><br /><a href="#ideas-vchhabra-turing" title="Ideas, Planning, & Feedback">🤔</a></td>
74
70
  <td align="center" valign="top" width="14.28%"><a href="https://github.com/era-23"><img src="https://avatars.githubusercontent.com/u/115151590?v=4?s=100" width="100px;" alt="Ethan Attwood"/><br /><sub><b>Ethan Attwood</b></sub></a><br /><a href="#bug-era-23" title="Bug reports">🐛</a></td>
75
71
  <td align="center" valign="top" width="14.28%"><a href="https://github.com/TheCSGuy25"><img src="https://avatars.githubusercontent.com/u/87066683?v=4?s=100" width="100px;" alt="__aar0n__.py"/><br /><sub><b>__aar0n__.py</b></sub></a><br /><a href="#code-TheCSGuy25" title="Code">💻</a></td>
72
+ <td align="center" valign="top" width="14.28%"><a href="https://github.com/SyedHaider2084"><img src="https://avatars.githubusercontent.com/u/227389830?v=4?s=100" width="100px;" alt="SyedHaider2084"/><br /><sub><b>SyedHaider2084</b></sub></a><br /><a href="#code-SyedHaider2084" title="Code">💻</a></td>
73
+ </tr>
74
+ <tr>
75
+ <td align="center" valign="top" width="14.28%"><a href="https://www.linkedin.com/in/lcm98/"><img src="https://avatars.githubusercontent.com/u/102757707?v=4?s=100" width="100px;" alt="Loh Chun Mun"/><br /><sub><b>Loh Chun Mun</b></sub></a><br /><a href="#doc-cmsamaaa" title="Documentation">📖</a> <a href="#code-cmsamaaa" title="Code">💻</a></td>
76
76
  </tr>
77
77
  </tbody>
78
78
  </table>
@@ -8,7 +8,7 @@ from matplotlib.axes import Axes
8
8
  from matplotlib.figure import Figure
9
9
 
10
10
  from autoemulate.core.types import DistributionLike, GaussianLike, NumpyLike, TensorLike
11
- from autoemulate.emulators.base import Emulator
11
+ from autoemulate.emulators.base import Emulator, PyTorchBackend
12
12
 
13
13
 
14
14
  def display_figure(fig: Figure):
@@ -601,3 +601,58 @@ def plot_calibration_from_distributions(
601
601
  ax.legend()
602
602
 
603
603
  return fig, ax
604
+
605
+
606
+ def plot_loss(
607
+ model: PyTorchBackend,
608
+ title: str | None = None,
609
+ figsize: tuple[int, int] | None = None,
610
+ ):
611
+ """
612
+ Plot the per-epoch training loss for a model using the PyTorch backend.
613
+
614
+ This function visualizes the training loss curve stored in the model's
615
+ ``loss_history`` attribute. The model must also provide an ``epochs``
616
+ attribute. If either attribute is missing, an ``AttributeError`` is raised.
617
+
618
+ Parameters
619
+ ----------
620
+ model : PyTorchBackend
621
+ A model instance using the PyTorch backend. It must provide both
622
+ ``loss_history`` and ``epochs`` attributes.
623
+ title : str, optional
624
+ Title for the plot. If ``None``, no title is added.
625
+ figsize : tuple of int, optional
626
+ Size of the figure as ``(width, height)`` in inches. Defaults to
627
+ ``(6, 6)`` if not provided.
628
+
629
+ Returns
630
+ -------
631
+ fig : matplotlib.figure.Figure
632
+ The created matplotlib Figure object.
633
+ ax : matplotlib.axes.Axes
634
+ The Axes on which the loss curve is plotted.
635
+
636
+ Raises
637
+ ------
638
+ AttributeError
639
+ If the model does not provide ``loss_history`` or ``epochs``.
640
+ """
641
+ if not hasattr(model, "loss_history"):
642
+ msg = "Emulator does not have a Loss history"
643
+ raise AttributeError(msg)
644
+
645
+ history = model.loss_history
646
+
647
+ if figsize is None:
648
+ figsize = (6, 6)
649
+
650
+ fig, ax = plt.subplots(figsize=figsize)
651
+ ax.plot(range(1, len(history) + 1), history)
652
+ ax.set_xlabel("Epochs")
653
+ ax.set_ylabel("Train Loss")
654
+
655
+ if title:
656
+ ax.set_title(title)
657
+
658
+ return fig, ax
@@ -0,0 +1,22 @@
1
+ from .epidemic import Epidemic
2
+ from .flow_problem import FlowProblem
3
+ from .projectile import Projectile, ProjectileMultioutput
4
+ from .seir import SEIRSimulator
5
+
6
+ ALL_SIMULATORS = [
7
+ Epidemic,
8
+ SEIRSimulator,
9
+ FlowProblem,
10
+ Projectile,
11
+ ProjectileMultioutput,
12
+ ]
13
+
14
+ __all__ = [
15
+ "Epidemic",
16
+ "FlowProblem",
17
+ "Projectile",
18
+ "ProjectileMultioutput",
19
+ "SEIRSimulator",
20
+ ]
21
+
22
+ SIMULATOR_REGISTRY = dict(zip(__all__, ALL_SIMULATORS, strict=False))
@@ -5,8 +5,9 @@ import torch
5
5
  from scipy.stats import qmc
6
6
  from tqdm import tqdm
7
7
 
8
+ from autoemulate.core.device import TorchDeviceMixin
8
9
  from autoemulate.core.logging_config import get_configured_logger
9
- from autoemulate.core.types import TensorLike
10
+ from autoemulate.core.types import DeviceLike, TensorLike
10
11
  from autoemulate.data.utils import ValidationMixin, set_random_seed
11
12
 
12
13
  logger = logging.getLogger("autoemulate")
@@ -362,3 +363,99 @@ class Simulator(ABC, ValidationMixin):
362
363
  output_dict[output_name] = self.results_tensor[:, i]
363
364
 
364
365
  return output_dict
366
+
367
+
368
+ class TorchSimulator(Simulator, TorchDeviceMixin):
369
+ """
370
+ Simulator that runs computations on a specified torch device.
371
+
372
+ This subclass extends :class:`Simulator` with the :class:`TorchDeviceMixin`
373
+ so that simulators implemented in PyTorch (e.g., ``torchcor``) can run on
374
+ CPU or accelerator hardware. Inputs are moved to ``self.device`` before the
375
+ forward pass and the resulting tensors are kept on the same device.
376
+ """
377
+
378
+ def __init__(
379
+ self,
380
+ parameters_range: dict[str, tuple[float, float]],
381
+ output_names: list[str],
382
+ log_level: str = "progress_bar",
383
+ device: DeviceLike | None = None,
384
+ ):
385
+ Simulator.__init__(self, parameters_range, output_names, log_level)
386
+ TorchDeviceMixin.__init__(self, device=device)
387
+
388
+ def sample_inputs(
389
+ self, n_samples: int, random_seed: int | None = None, method: str = "lhs"
390
+ ) -> TensorLike:
391
+ """
392
+ Sample inputs and move them to the simulator's device.
393
+
394
+ Parameters
395
+ ----------
396
+ n_samples: int
397
+ Number of samples to generate.
398
+ random_seed: int | None
399
+ Optional random seed to make sampling reproducible.
400
+ method: str
401
+ Sampling method, one of ``"lhs"`` or ``"sobol"``.
402
+
403
+ Returns
404
+ -------
405
+ TensorLike
406
+ Sampled inputs located on ``self.device``.
407
+ """
408
+ samples = super().sample_inputs(
409
+ n_samples, random_seed=random_seed, method=method
410
+ )
411
+ (samples_device,) = self._move_tensors_to_device(samples)
412
+ return samples_device
413
+
414
+ def forward(self, x: TensorLike, allow_failures: bool = True) -> TensorLike | None:
415
+ """
416
+ Run a single simulation on the configured device.
417
+
418
+ Parameters
419
+ ----------
420
+ x: TensorLike
421
+ Input tensor with shape ``(n_samples, in_dim)``.
422
+ allow_failures: bool
423
+ When True, failures return ``None`` instead of raising.
424
+
425
+ Returns
426
+ -------
427
+ TensorLike | None
428
+ Simulation result on ``self.device`` or ``None`` on failure.
429
+ """
430
+ (x_device,) = self._move_tensors_to_device(x)
431
+ y = super().forward(x_device, allow_failures=allow_failures)
432
+ if isinstance(y, torch.Tensor):
433
+ return y.to(self.device)
434
+ return y
435
+
436
+ def forward_batch(
437
+ self, x: TensorLike, allow_failures: bool = True
438
+ ) -> tuple[TensorLike, TensorLike]:
439
+ """
440
+ Run a batch of simulations with device management.
441
+
442
+ Parameters
443
+ ----------
444
+ x: TensorLike
445
+ Batch of inputs with shape ``(batch_size, in_dim)``.
446
+ allow_failures: bool
447
+ Whether to skip failures (True) or raise immediately (False).
448
+
449
+ Returns
450
+ -------
451
+ tuple[TensorLike, TensorLike]
452
+ Tuple of ``(results, valid_inputs)`` residing on ``self.device``.
453
+ """
454
+ (x_device,) = self._move_tensors_to_device(x)
455
+ results, valid_inputs = super().forward_batch(
456
+ x_device, allow_failures=allow_failures
457
+ )
458
+ results = results.to(self.device)
459
+ self.results_tensor = results
460
+ valid_inputs = valid_inputs.to(self.device)
461
+ return results, valid_inputs
@@ -0,0 +1,110 @@
1
+ from __future__ import annotations
2
+
3
+ import numpy as np
4
+ import torch
5
+ from scipy.integrate import solve_ivp
6
+
7
+ from autoemulate.core.types import NumpyLike, TensorLike
8
+ from autoemulate.simulations.base import Simulator
9
+
10
+
11
+ def simulate_seir_epidemic(
12
+ x: NumpyLike,
13
+ N: int = 1000,
14
+ I0: int = 1,
15
+ E0: int = 0,
16
+ ) -> float:
17
+ """
18
+ Simulate an epidemic using the SEIR model.
19
+
20
+ Parameters
21
+ ----------
22
+ x : NumpyLike
23
+ SEIR parameters [beta, gamma, sigma].
24
+ N : int
25
+ Total population.
26
+ I0 : int
27
+ Initial infected.
28
+ E0 : int
29
+ Initial exposed.
30
+
31
+ Returns
32
+ -------
33
+ peak_infection_rate : float
34
+ Peak infection fraction I_max / N.
35
+ """
36
+ if len(x) != 3:
37
+ raise ValueError(f"Expected 3 parameters [beta, gamma, sigma], got {len(x)}")
38
+
39
+ beta, gamma, sigma = x
40
+
41
+ S0 = N - I0 - E0
42
+ R0 = 0
43
+ t_span = (0.0, 160.0)
44
+ y0 = [S0, E0, I0, R0]
45
+
46
+ def seir_model(t, y, N, beta, gamma, sigma): # noqa: ARG001
47
+ S, E, I, R = y # noqa: E741
48
+ dSdt = -beta * S * I / N
49
+ dEdt = beta * S * I / N - sigma * E
50
+ dIdt = sigma * E - gamma * I
51
+ dRdt = gamma * I
52
+ return [dSdt, dEdt, dIdt, dRdt]
53
+
54
+ t_eval = np.linspace(t_span[0], t_span[1], 160)
55
+ sol = solve_ivp(
56
+ seir_model,
57
+ t_span,
58
+ y0,
59
+ args=(N, beta, gamma, sigma),
60
+ t_eval=t_eval,
61
+ vectorized=False,
62
+ )
63
+
64
+ _, E, I, R = sol.y # noqa: E741
65
+ I_max = np.max(I)
66
+
67
+ return float(I_max) / float(N)
68
+
69
+
70
+ class SEIRSimulator(Simulator):
71
+ """Simulator of infectious disease spread using the SEIR model."""
72
+
73
+ def __init__(
74
+ self,
75
+ parameters_range=None,
76
+ output_names=None,
77
+ log_level: str = "progress_bar",
78
+ ):
79
+ if parameters_range is None:
80
+ parameters_range = {
81
+ "beta": (0.1, 0.5),
82
+ "gamma": (0.01, 0.2),
83
+ "sigma": (0.05, 0.3),
84
+ }
85
+ if output_names is None:
86
+ output_names = ["infection_rate"]
87
+
88
+ super().__init__(parameters_range, output_names, log_level)
89
+
90
+ def _forward(self, x: TensorLike) -> TensorLike:
91
+ """
92
+ Simulate the epidemic using the SEIR model.
93
+
94
+ Parameters
95
+ ----------
96
+ x : TensorLike
97
+ Input parameter values [beta, gamma, sigma].
98
+
99
+ Returns
100
+ -------
101
+ TensorLike
102
+ Peak infection rate (fraction of population).
103
+ """
104
+ if x.shape[0] != 1:
105
+ raise ValueError(
106
+ f"SEIRSimulator._forward expects a single input, got {x.shape[0]}"
107
+ )
108
+
109
+ y = simulate_seir_epidemic(x.cpu().numpy()[0])
110
+ return torch.tensor([y], dtype=torch.float32).view(-1, 1)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: autoemulate
3
- Version: 1.2.1
3
+ Version: 2.0.0
4
4
  Summary: A python package for semi-automated emulation
5
5
  Author: AutoEmulate contributors (see our GitHub page)
6
6
  License-Expression: MIT
@@ -73,13 +73,9 @@ Dynamic: license-file
73
73
  [![Documentation](https://img.shields.io/badge/documentation-blue)](https://alan-turing-institute.github.io/autoemulate/)
74
74
  [![Github Stats](https://img.shields.io/badge/repostats-orange)](https://github.com/alan-turing-institute/autoemulate/blob/github-repo-stats/alan-turing-institute/autoemulate/latest-report/report.pdf)
75
75
 
76
-
77
76
  <!-- SPHINX-START -->
78
77
  Simulations of physical systems are often slow and need lots of compute, which makes them unpractical for real-world applications like digital twins, or when they have to run thousands of times for sensitivity analyses. The goal of `AutoEmulate` is to make it easy to replace simulations with fast, accurate emulators. To do this, `AutoEmulate` automatically fits and compares various emulators, ranging from simple models like Radial Basis Functions and Second Order Polynomials to more complex models like Support Vector Machines and Gaussian Processes to find the best emulator for a simulation.
79
78
 
80
- >[!WARNING]
81
- >Although AutoEmulate is currently on version 1.x, we are not following semantic versioning at the moment. The convention for V1 is that breaking and major changes will be made between minor version (1.1 -> 1.2). Bug fixes will be made in patch versions (1.1.1 -> 1.1.2). We plan to implement true semantic versioning in v2 of the package. We recommend pinning the minor version of AutoEmulate if using downstream and carefully reading release notes.
82
-
83
79
  ## Documentation
84
80
 
85
81
  You can find the project documentation [here](https://alan-turing-institute.github.io/autoemulate/), including [installation](https://alan-turing-institute.github.io/autoemulate/installation.html).
@@ -139,6 +135,10 @@ You can find the project documentation [here](https://alan-turing-institute.gith
139
135
  <td align="center" valign="top" width="14.28%"><a href="https://github.com/vchhabra-turing"><img src="https://avatars.githubusercontent.com/u/140401853?v=4?s=100" width="100px;" alt="vchhabra-turing"/><br /><sub><b>vchhabra-turing</b></sub></a><br /><a href="#ideas-vchhabra-turing" title="Ideas, Planning, & Feedback">🤔</a></td>
140
136
  <td align="center" valign="top" width="14.28%"><a href="https://github.com/era-23"><img src="https://avatars.githubusercontent.com/u/115151590?v=4?s=100" width="100px;" alt="Ethan Attwood"/><br /><sub><b>Ethan Attwood</b></sub></a><br /><a href="#bug-era-23" title="Bug reports">🐛</a></td>
141
137
  <td align="center" valign="top" width="14.28%"><a href="https://github.com/TheCSGuy25"><img src="https://avatars.githubusercontent.com/u/87066683?v=4?s=100" width="100px;" alt="__aar0n__.py"/><br /><sub><b>__aar0n__.py</b></sub></a><br /><a href="#code-TheCSGuy25" title="Code">💻</a></td>
138
+ <td align="center" valign="top" width="14.28%"><a href="https://github.com/SyedHaider2084"><img src="https://avatars.githubusercontent.com/u/227389830?v=4?s=100" width="100px;" alt="SyedHaider2084"/><br /><sub><b>SyedHaider2084</b></sub></a><br /><a href="#code-SyedHaider2084" title="Code">💻</a></td>
139
+ </tr>
140
+ <tr>
141
+ <td align="center" valign="top" width="14.28%"><a href="https://www.linkedin.com/in/lcm98/"><img src="https://avatars.githubusercontent.com/u/102757707?v=4?s=100" width="100px;" alt="Loh Chun Mun"/><br /><sub><b>Loh Chun Mun</b></sub></a><br /><a href="#doc-cmsamaaa" title="Documentation">📖</a> <a href="#code-cmsamaaa" title="Code">💻</a></td>
142
142
  </tr>
143
143
  </tbody>
144
144
  </table>
@@ -114,6 +114,7 @@ autoemulate/simulations/epidemic.py
114
114
  autoemulate/simulations/flow_problem.py
115
115
  autoemulate/simulations/projectile.py
116
116
  autoemulate/simulations/reaction_diffusion.py
117
+ autoemulate/simulations/seir.py
117
118
  autoemulate/transforms/__init__.py
118
119
  autoemulate/transforms/base.py
119
120
  autoemulate/transforms/pca.py
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "autoemulate"
3
- version = "1.2.1"
3
+ version = "2.0.0"
4
4
  description = "A python package for semi-automated emulation"
5
5
  license = "MIT"
6
6
  authors = [{ name = "AutoEmulate contributors (see our GitHub page)" }]
@@ -1,9 +0,0 @@
1
- from .epidemic import Epidemic
2
- from .flow_problem import FlowProblem
3
- from .projectile import Projectile, ProjectileMultioutput
4
-
5
- ALL_SIMULATORS = [Epidemic, FlowProblem, Projectile, ProjectileMultioutput]
6
-
7
- __all__ = ["Epidemic", "FlowProblem", "Projectile", "ProjectileMultioutput"]
8
-
9
- SIMULATOR_REGISTRY = dict(zip(__all__, ALL_SIMULATORS, strict=False))
File without changes
File without changes