jinns 0.8.9__tar.gz → 0.8.10__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 (118) hide show
  1. {jinns-0.8.9 → jinns-0.8.10}/PKG-INFO +1 -1
  2. {jinns-0.8.9 → jinns-0.8.10}/doc/source/index.rst +4 -0
  3. {jinns-0.8.9 → jinns-0.8.10}/jinns/loss/_LossODE.py +1 -0
  4. {jinns-0.8.9 → jinns-0.8.10}/jinns.egg-info/PKG-INFO +1 -1
  5. {jinns-0.8.9 → jinns-0.8.10}/tests/conftest.py +8 -0
  6. {jinns-0.8.9 → jinns-0.8.10}/tests/runtests.sh +4 -4
  7. {jinns-0.8.9 → jinns-0.8.10}/tests/solver_tests/test_rar_algorithm.py +61 -39
  8. {jinns-0.8.9 → jinns-0.8.10}/.gitignore +0 -0
  9. {jinns-0.8.9 → jinns-0.8.10}/.gitlab-ci.yml +0 -0
  10. {jinns-0.8.9 → jinns-0.8.10}/.pre-commit-config.yaml +0 -0
  11. {jinns-0.8.9 → jinns-0.8.10}/LICENSE +0 -0
  12. {jinns-0.8.9 → jinns-0.8.10}/Notebooks/ODE/1D_Generalized_Lotka_Volterra.ipynb +0 -0
  13. {jinns-0.8.9 → jinns-0.8.10}/Notebooks/ODE/1D_Generalized_Lotka_Volterra_seq2seq.ipynb +0 -0
  14. {jinns-0.8.9 → jinns-0.8.10}/Notebooks/ODE/sbinn_data/glucose.dat +0 -0
  15. {jinns-0.8.9 → jinns-0.8.10}/Notebooks/ODE/sbinn_data/meal.dat +0 -0
  16. {jinns-0.8.9 → jinns-0.8.10}/Notebooks/ODE/systems_biology_informed_neural_network.ipynb +0 -0
  17. {jinns-0.8.9 → jinns-0.8.10}/Notebooks/PDE/1D_non_stationary_Burger.ipynb +0 -0
  18. {jinns-0.8.9 → jinns-0.8.10}/Notebooks/PDE/1D_non_stationary_Fisher_KPP_Bounded_Domain.ipynb +0 -0
  19. {jinns-0.8.9 → jinns-0.8.10}/Notebooks/PDE/2D_Heat_inverse_problem.ipynb +0 -0
  20. {jinns-0.8.9 → jinns-0.8.10}/Notebooks/PDE/2D_Navier_Stokes_PipeFlow.ipynb +0 -0
  21. {jinns-0.8.9 → jinns-0.8.10}/Notebooks/PDE/2D_Navier_Stokes_PipeFlow_Metamodel_hyperpinn.ipynb +0 -0
  22. {jinns-0.8.9 → jinns-0.8.10}/Notebooks/PDE/2D_Navier_Stokes_PipeFlow_SoftConstraints.ipynb +0 -0
  23. {jinns-0.8.9 → jinns-0.8.10}/Notebooks/PDE/2D_Poisson_inverse_problem.ipynb +0 -0
  24. {jinns-0.8.9 → jinns-0.8.10}/Notebooks/PDE/2D_non_stationary_OU.ipynb +0 -0
  25. {jinns-0.8.9 → jinns-0.8.10}/Notebooks/PDE/2d_nonstatio_ou_standardsampling.png +0 -0
  26. {jinns-0.8.9 → jinns-0.8.10}/Notebooks/PDE/OU_1D_nonstatio_solution_grid.npy +0 -0
  27. {jinns-0.8.9 → jinns-0.8.10}/Notebooks/PDE/Reaction_Diffusion_2D_heterogenous_model.ipynb +0 -0
  28. {jinns-0.8.9 → jinns-0.8.10}/Notebooks/PDE/Reaction_Diffusion_2D_homogeneous_metamodel_hyperpinn_diffrax.ipynb +0 -0
  29. {jinns-0.8.9 → jinns-0.8.10}/Notebooks/PDE/burger_solution_grid.npy +0 -0
  30. {jinns-0.8.9 → jinns-0.8.10}/Notebooks/PDE/imperfect_modeling_sobolev_reg.ipynb +0 -0
  31. {jinns-0.8.9 → jinns-0.8.10}/Notebooks/SPDE/SpectralPINN_SPDE_Matern_finite_diff.ipynb +0 -0
  32. {jinns-0.8.9 → jinns-0.8.10}/Notebooks/Tutorials/implementing_your_own_PDE_problem.ipynb +0 -0
  33. {jinns-0.8.9 → jinns-0.8.10}/Notebooks/Tutorials/introducing_validation_loss.ipynb +0 -0
  34. {jinns-0.8.9 → jinns-0.8.10}/Notebooks/Tutorials/load_save_model.ipynb +0 -0
  35. {jinns-0.8.9 → jinns-0.8.10}/README.md +0 -0
  36. {jinns-0.8.9 → jinns-0.8.10}/doc/Makefile +0 -0
  37. {jinns-0.8.9 → jinns-0.8.10}/doc/source/boundary_conditions.rst +0 -0
  38. {jinns-0.8.9 → jinns-0.8.10}/doc/source/conf.py +0 -0
  39. {jinns-0.8.9 → jinns-0.8.10}/doc/source/data.rst +0 -0
  40. {jinns-0.8.9 → jinns-0.8.10}/doc/source/dynamic_loss.rst +0 -0
  41. {jinns-0.8.9 → jinns-0.8.10}/doc/source/experimental.rst +0 -0
  42. {jinns-0.8.9 → jinns-0.8.10}/doc/source/fokker_planck.qmd +0 -0
  43. {jinns-0.8.9 → jinns-0.8.10}/doc/source/loss.rst +0 -0
  44. {jinns-0.8.9 → jinns-0.8.10}/doc/source/loss_ode.rst +0 -0
  45. {jinns-0.8.9 → jinns-0.8.10}/doc/source/loss_pde.rst +0 -0
  46. {jinns-0.8.9 → jinns-0.8.10}/doc/source/losses.rst +0 -0
  47. {jinns-0.8.9 → jinns-0.8.10}/doc/source/math_pinn.qmd +0 -0
  48. {jinns-0.8.9 → jinns-0.8.10}/doc/source/operators.rst +0 -0
  49. {jinns-0.8.9 → jinns-0.8.10}/doc/source/param_estim_pinn.qmd +0 -0
  50. {jinns-0.8.9 → jinns-0.8.10}/doc/source/rar.rst +0 -0
  51. {jinns-0.8.9 → jinns-0.8.10}/doc/source/seq2seq.rst +0 -0
  52. {jinns-0.8.9 → jinns-0.8.10}/doc/source/solve.rst +0 -0
  53. {jinns-0.8.9 → jinns-0.8.10}/doc/source/solver.rst +0 -0
  54. {jinns-0.8.9 → jinns-0.8.10}/doc/source/utils.rst +0 -0
  55. {jinns-0.8.9 → jinns-0.8.10}/doc/source/validation.rst +0 -0
  56. {jinns-0.8.9 → jinns-0.8.10}/jinns/__init__.py +0 -0
  57. {jinns-0.8.9 → jinns-0.8.10}/jinns/data/_DataGenerators.py +0 -0
  58. {jinns-0.8.9 → jinns-0.8.10}/jinns/data/__init__.py +0 -0
  59. {jinns-0.8.9 → jinns-0.8.10}/jinns/data/_display.py +0 -0
  60. {jinns-0.8.9 → jinns-0.8.10}/jinns/experimental/__init__.py +0 -0
  61. {jinns-0.8.9 → jinns-0.8.10}/jinns/experimental/_diffrax_solver.py +0 -0
  62. {jinns-0.8.9 → jinns-0.8.10}/jinns/experimental/_sinuspinn.py +0 -0
  63. {jinns-0.8.9 → jinns-0.8.10}/jinns/experimental/_spectralpinn.py +0 -0
  64. {jinns-0.8.9 → jinns-0.8.10}/jinns/loss/_DynamicLoss.py +0 -0
  65. {jinns-0.8.9 → jinns-0.8.10}/jinns/loss/_DynamicLossAbstract.py +0 -0
  66. {jinns-0.8.9 → jinns-0.8.10}/jinns/loss/_LossPDE.py +0 -0
  67. {jinns-0.8.9 → jinns-0.8.10}/jinns/loss/_Losses.py +0 -0
  68. {jinns-0.8.9 → jinns-0.8.10}/jinns/loss/__init__.py +0 -0
  69. {jinns-0.8.9 → jinns-0.8.10}/jinns/loss/_boundary_conditions.py +0 -0
  70. {jinns-0.8.9 → jinns-0.8.10}/jinns/loss/_operators.py +0 -0
  71. {jinns-0.8.9 → jinns-0.8.10}/jinns/solver/__init__.py +0 -0
  72. {jinns-0.8.9 → jinns-0.8.10}/jinns/solver/_rar.py +0 -0
  73. {jinns-0.8.9 → jinns-0.8.10}/jinns/solver/_seq2seq.py +0 -0
  74. {jinns-0.8.9 → jinns-0.8.10}/jinns/solver/_solve.py +0 -0
  75. {jinns-0.8.9 → jinns-0.8.10}/jinns/utils/__init__.py +0 -0
  76. {jinns-0.8.9 → jinns-0.8.10}/jinns/utils/_containers.py +0 -0
  77. {jinns-0.8.9 → jinns-0.8.10}/jinns/utils/_hyperpinn.py +0 -0
  78. {jinns-0.8.9 → jinns-0.8.10}/jinns/utils/_optim.py +0 -0
  79. {jinns-0.8.9 → jinns-0.8.10}/jinns/utils/_pinn.py +0 -0
  80. {jinns-0.8.9 → jinns-0.8.10}/jinns/utils/_save_load.py +0 -0
  81. {jinns-0.8.9 → jinns-0.8.10}/jinns/utils/_spinn.py +0 -0
  82. {jinns-0.8.9 → jinns-0.8.10}/jinns/utils/_utils.py +0 -0
  83. {jinns-0.8.9 → jinns-0.8.10}/jinns/utils/_utils_uspinn.py +0 -0
  84. {jinns-0.8.9 → jinns-0.8.10}/jinns/validation/__init__.py +0 -0
  85. {jinns-0.8.9 → jinns-0.8.10}/jinns/validation/_validation.py +0 -0
  86. {jinns-0.8.9 → jinns-0.8.10}/jinns.egg-info/SOURCES.txt +0 -0
  87. {jinns-0.8.9 → jinns-0.8.10}/jinns.egg-info/dependency_links.txt +0 -0
  88. {jinns-0.8.9 → jinns-0.8.10}/jinns.egg-info/requires.txt +0 -0
  89. {jinns-0.8.9 → jinns-0.8.10}/jinns.egg-info/top_level.txt +0 -0
  90. {jinns-0.8.9 → jinns-0.8.10}/pyproject.toml +0 -0
  91. {jinns-0.8.9 → jinns-0.8.10}/setup.cfg +0 -0
  92. {jinns-0.8.9 → jinns-0.8.10}/tests/dataGenerator_tests/test_CubicMeshPDENonStatio.py +0 -0
  93. {jinns-0.8.9 → jinns-0.8.10}/tests/dataGenerator_tests/test_CubicMeshPDEStatio.py +0 -0
  94. {jinns-0.8.9 → jinns-0.8.10}/tests/dataGenerator_tests/test_DataGeneratorODE.py +0 -0
  95. {jinns-0.8.9 → jinns-0.8.10}/tests/dataGenerator_tests/test_DataGeneratorParameter.py +0 -0
  96. {jinns-0.8.9 → jinns-0.8.10}/tests/save_load_tests/test_saving_loading_hyperpinn.py +0 -0
  97. {jinns-0.8.9 → jinns-0.8.10}/tests/save_load_tests/test_saving_loading_pinn.py +0 -0
  98. {jinns-0.8.9 → jinns-0.8.10}/tests/save_load_tests/test_saving_loading_spinn.py +0 -0
  99. {jinns-0.8.9 → jinns-0.8.10}/tests/sharding_tests/test_Burger_x32_multiple_shardings.py +0 -0
  100. {jinns-0.8.9 → jinns-0.8.10}/tests/sharding_tests/test_imperfect_sobolev_x32_multiple_shardings.py +0 -0
  101. {jinns-0.8.9 → jinns-0.8.10}/tests/solver_tests/test_Burger_x32.py +0 -0
  102. {jinns-0.8.9 → jinns-0.8.10}/tests/solver_tests/test_Burger_x64.py +0 -0
  103. {jinns-0.8.9 → jinns-0.8.10}/tests/solver_tests/test_Fisher_x32.py +0 -0
  104. {jinns-0.8.9 → jinns-0.8.10}/tests/solver_tests/test_Fisher_x64.py +0 -0
  105. {jinns-0.8.9 → jinns-0.8.10}/tests/solver_tests/test_GLV_x32.py +0 -0
  106. {jinns-0.8.9 → jinns-0.8.10}/tests/solver_tests/test_GLV_x64.py +0 -0
  107. {jinns-0.8.9 → jinns-0.8.10}/tests/solver_tests/test_NSPipeFlow_x32.py +0 -0
  108. {jinns-0.8.9 → jinns-0.8.10}/tests/solver_tests/test_NSPipeFlow_x64.py +0 -0
  109. {jinns-0.8.9 → jinns-0.8.10}/tests/solver_tests/test_OU2D_x32.py +0 -0
  110. {jinns-0.8.9 → jinns-0.8.10}/tests/solver_tests/test_imperfect_sobolev_x32.py +0 -0
  111. {jinns-0.8.9 → jinns-0.8.10}/tests/solver_tests_spinn/test_Burger_x32.py +0 -0
  112. {jinns-0.8.9 → jinns-0.8.10}/tests/solver_tests_spinn/test_Fisher_x32.py +0 -0
  113. {jinns-0.8.9 → jinns-0.8.10}/tests/solver_tests_spinn/test_NSPipeFlow_x32_spinn.py +0 -0
  114. {jinns-0.8.9 → jinns-0.8.10}/tests/solver_tests_spinn/test_OU2D_x32.py +0 -0
  115. {jinns-0.8.9 → jinns-0.8.10}/tests/solver_tests_spinn/test_ReactionDiffusion_nonhomo_x64.py +0 -0
  116. {jinns-0.8.9 → jinns-0.8.10}/tests/utils_tests/test_hyperpinns.py +0 -0
  117. {jinns-0.8.9 → jinns-0.8.10}/tests/utils_tests/test_pinn.py +0 -0
  118. {jinns-0.8.9 → jinns-0.8.10}/tests/utils_tests/test_spinn.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: jinns
3
- Version: 0.8.9
3
+ Version: 0.8.10
4
4
  Summary: Physics Informed Neural Network with JAX
5
5
  Author-email: Hugo Gangloff <hugo.gangloff@inrae.fr>, Nicolas Jouvin <nicolas.jouvin@inrae.fr>
6
6
  Maintainer-email: Hugo Gangloff <hugo.gangloff@inrae.fr>, Nicolas Jouvin <nicolas.jouvin@inrae.fr>
@@ -8,6 +8,10 @@ Welcome to jinn's documentation!
8
8
 
9
9
  Changelog:
10
10
 
11
+ * v0.8.10:
12
+
13
+ - Merge `[!44] <https://gitlab.com/mia_jinns/jinns/-/merge_requests/44>`_
14
+
11
15
  * v0.8.9:
12
16
 
13
17
  - Merge `[!41] <https://gitlab.com/mia_jinns/jinns/-/merge_requests/41>`_
@@ -237,6 +237,7 @@ class LossODE:
237
237
  "u": self.u,
238
238
  "dynamic_loss": self.dynamic_loss,
239
239
  "obs_slice": self.obs_slice,
240
+ "derivative_keys": self.derivative_keys,
240
241
  }
241
242
  return (children, aux_data)
242
243
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: jinns
3
- Version: 0.8.9
3
+ Version: 0.8.10
4
4
  Summary: Physics Informed Neural Network with JAX
5
5
  Author-email: Hugo Gangloff <hugo.gangloff@inrae.fr>, Nicolas Jouvin <nicolas.jouvin@inrae.fr>
6
6
  Maintainer-email: Hugo Gangloff <hugo.gangloff@inrae.fr>, Nicolas Jouvin <nicolas.jouvin@inrae.fr>
@@ -15,6 +15,14 @@ def pytest_addoption(parser):
15
15
  help="whether to run test scripts on GPU",
16
16
  )
17
17
 
18
+ parser.addoption(
19
+ "--all_tests",
20
+ action="store_true",
21
+ default=False,
22
+ help="whether to run all tests (can be long so should not be called "
23
+ "often especially on CI/CD)",
24
+ )
25
+
18
26
 
19
27
  def pytest_configure(config):
20
28
  gpu = config.getoption("--gpu")
@@ -1,5 +1,5 @@
1
1
  #!/bin/bash
2
- pytest dataGenerator_tests/*
2
+ pytest -s dataGenerator_tests/*
3
3
  status=$?
4
4
  if [ $status -ne 0 ]; then
5
5
  exit $status
@@ -14,15 +14,15 @@ status=$?
14
14
  if [ $status -ne 0 ]; then
15
15
  exit $status
16
16
  fi
17
- pytest solver_tests/*
17
+ pytest -s solver_tests/*
18
18
  status=$?
19
19
  if [ $status -ne 0 ]; then
20
20
  exit $status
21
21
  fi
22
- pytest solver_tests_spinn/*
22
+ pytest -s solver_tests_spinn/*
23
23
  status=$?
24
24
  if [ $status -ne 0 ]; then
25
25
  exit $status
26
26
  fi
27
- pytest utils_tests/*
27
+ pytest -s utils_tests/*
28
28
  exit $?
@@ -139,6 +139,11 @@ def get_datagenerator_rar(start_iter, update_every):
139
139
  return train_data, rar_parameters
140
140
 
141
141
 
142
+ @pytest.fixture
143
+ def all_tests(pytestconfig):
144
+ return pytestconfig.getoption("all_tests")
145
+
146
+
142
147
  def test_data_proba_shape_before_solve():
143
148
  train_data, rar_parameters = get_datagenerator_rar(1, 1)
144
149
  assert (train_data.p_times != 0).sum() == train_data.nt_start
@@ -159,43 +164,60 @@ def control_shape_after_solve_with_rar(start_iter, update_every):
159
164
  ) * rar_parameters["selected_sample_size_omega"]
160
165
 
161
166
 
162
- def test_rar_with_various_combination_of_start_and_update_values():
163
- start_iter_list = [0, 3]
164
- update_every_list = [1, 3]
165
- for start_iter in start_iter_list:
166
- for update_every in update_every_list:
167
- with pytest.warns(UserWarning):
168
- control_shape_after_solve_with_rar(start_iter, update_every)
169
-
170
-
171
- def test_rar_error_with_SPINN():
172
-
173
- train_data, rar_parameters = get_datagenerator_rar(0, 1)
174
- # ensure same batch size in time & space for SPINN
175
- train_data.temporal_batch_size = train_data.omega_batch_size
176
- d = 3
177
- r = 256
178
- eqx_list = [
179
- [eqx.nn.Linear, 1, 128],
180
- [jax.nn.tanh],
181
- [eqx.nn.Linear, 128, 128],
182
- [jax.nn.tanh],
183
- [eqx.nn.Linear, 128, 128],
184
- [jax.nn.tanh],
185
- [eqx.nn.Linear, 128, r],
186
- ]
187
- key = jax.random.PRNGKey(12345)
188
- key, subkey = random.split(key)
189
- u = jinns.utils.create_SPINN(subkey, d, r, eqx_list, "nonstatio_PDE")
190
- init_nn_params = u.init_params()
191
-
192
- # update loss and params
193
- init_params["nn_params"] = init_nn_params
194
- loss.u = u
195
- train_data.temporal_batch_size = train_data.omega_batch_size
196
- # expect error
197
- with pytest.raises(NotImplementedError) as e_info, pytest.warns(UserWarning):
198
- tx = optax.adamw(learning_rate=1e-3)
199
- jinns.solve(
200
- init_params=init_params, data=train_data, optimizer=tx, loss=loss, n_iter=2
167
+ def test_rar_with_various_combination_of_start_and_update_values(all_tests):
168
+ # long test run only if --all_tests
169
+ if all_tests:
170
+ start_iter_list = [0, 3]
171
+ update_every_list = [1, 3]
172
+ for start_iter in start_iter_list:
173
+ for update_every in update_every_list:
174
+ with pytest.warns(UserWarning):
175
+ control_shape_after_solve_with_rar(start_iter, update_every)
176
+ else:
177
+ print(
178
+ "\ntest_rar_with_various_combination_of_start_and_update_values "
179
+ "has been skipped due to missing --all_tests option\n"
180
+ )
181
+
182
+
183
+ def test_rar_error_with_SPINN(all_tests):
184
+ # long test run only if --all_tests
185
+ if all_tests:
186
+ train_data, rar_parameters = get_datagenerator_rar(0, 1)
187
+ # ensure same batch size in time & space for SPINN
188
+ train_data.temporal_batch_size = train_data.omega_batch_size
189
+ d = 3
190
+ r = 256
191
+ eqx_list = [
192
+ [eqx.nn.Linear, 1, 128],
193
+ [jax.nn.tanh],
194
+ [eqx.nn.Linear, 128, 128],
195
+ [jax.nn.tanh],
196
+ [eqx.nn.Linear, 128, 128],
197
+ [jax.nn.tanh],
198
+ [eqx.nn.Linear, 128, r],
199
+ ]
200
+ key = jax.random.PRNGKey(12345)
201
+ key, subkey = random.split(key)
202
+ u = jinns.utils.create_SPINN(subkey, d, r, eqx_list, "nonstatio_PDE")
203
+ init_nn_params = u.init_params()
204
+
205
+ # update loss and params
206
+ init_params["nn_params"] = init_nn_params
207
+ loss.u = u
208
+ train_data.temporal_batch_size = train_data.omega_batch_size
209
+ # expect error
210
+ with pytest.raises(NotImplementedError) as e_info, pytest.warns(UserWarning):
211
+ tx = optax.adamw(learning_rate=1e-3)
212
+ jinns.solve(
213
+ init_params=init_params,
214
+ data=train_data,
215
+ optimizer=tx,
216
+ loss=loss,
217
+ n_iter=2,
218
+ )
219
+ else:
220
+ print(
221
+ "\ntest_rar_error_with_SPINN has been skipped due not missing "
222
+ "--all_tests option\n"
201
223
  )
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes