Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ build: Changes to the build process or tools.
### Test

- Updated optimization tests to reflect line search changes
- Updated unit tests to reflect changes to synthetic data functions

### Build

Expand All @@ -40,16 +41,15 @@ build: Changes to the build process or tools.
- Simplified CONTRIBUTING
- Updated docs to include API changes

# Refactor
### Refactor

- Changed model API by moving module `model.py` into `core`
- Changed plotting API (instead of `jenn.utils.plot.something()` it is now `jenn.plot_something()`)
- Moved all plotting functions into their own modules inside `post_processsing`
- Renamed all plotting algorithms and tweaked signatures
- Modified convergence history plotting to control log-scale of each axis
- Modified contour plotting to allow index selection of which inputs and outputs to plot
- Added function to plot histogram of prediction error
- Updated goodness of fit summary plot to also include prediction error distribution
- Changed API by moving module `model.py` into `core`
- Changed API by moving module `synthetic.py` into `synthetic_data` (synthetic functions are now modules not classes)
- Changed API by moving module `plot` into `post_processing`
- _Instead of `jenn.utils.plot.something()` it is now `jenn.plot_something()`_
- _Modified signature and tweaked almost all plotting functions (adjusted notebooks accordingly)_
- _Added plotting function to display histogram of prediction error (and added it to goodness of fit summary plots)_
- Changed name of `utils` to `utilities` and added `_sample.py` and `_finite_difference.py` modules

## v1.0.8 (2024-06-26)

Expand Down
69 changes: 37 additions & 32 deletions docs/examples/.ipynb_checkpoints/demo_1_sinusoid-checkpoint.ipynb

Large diffs are not rendered by default.

102 changes: 48 additions & 54 deletions docs/examples/.ipynb_checkpoints/demo_2_rastrigin-checkpoint.ipynb

Large diffs are not rendered by default.

175 changes: 47 additions & 128 deletions docs/examples/.ipynb_checkpoints/demo_4_rosenbrock-checkpoint.ipynb

Large diffs are not rendered by default.

67 changes: 36 additions & 31 deletions docs/examples/demo_1_sinusoid.ipynb

Large diffs are not rendered by default.

100 changes: 47 additions & 53 deletions docs/examples/demo_2_rastrigin.ipynb

Large diffs are not rendered by default.

118 changes: 58 additions & 60 deletions docs/examples/demo_4_rosenbrock.ipynb

Large diffs are not rendered by default.

Binary file modified docs/examples/sbo_contours.pdf
Binary file not shown.
Binary file modified docs/examples/sbo_convergence.pdf
Binary file not shown.
5 changes: 4 additions & 1 deletion docs/source/sections/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@ This section describes the main API users are expected to interact with.
.. automodule:: jenn
:members:

.. automodule:: jenn.synthetic
.. automodule:: jenn.synthetic_data
:members:

.. automodule:: jenn.utilities
:members:

Core API
Expand Down
19 changes: 11 additions & 8 deletions notebooks/noisy_partials.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -65,26 +65,29 @@
"source": [
"def generate_training_data(step_size: float = 1e-6, seed: int = 123):\n",
" \"\"\"Generate training data using finite difference.\"\"\"\n",
" test_function = jenn.synthetic.Rastrigin\n",
" lb = (-1.0, -1.0)\n",
" ub = (1.5, 1.5)\n",
" X_train, Y_train, J_train = test_function.sample(\n",
" X_train, Y_train, J_train = jenn.utilities.sample(\n",
" f=jenn.synthetic_data.rastrigin.compute,\n",
" f_prime=jenn.synthetic_data.rastrigin.compute_partials,\n",
" m_random=100,\n",
" m_levels=0,\n",
" lb=lb,\n",
" ub=ub,\n",
" dx=None,\n",
" random_state=seed,\n",
" ) # analytical partials\n",
" X_train_FD, Y_train_FD, J_train_FD = test_function.sample(\n",
" X_train_FD, Y_train_FD, J_train_FD = jenn.utilities.sample(\n",
" f=jenn.synthetic_data.rastrigin.compute,\n",
" m_random=100,\n",
" m_levels=0,\n",
" lb=lb,\n",
" ub=ub,\n",
" dx=step_size,\n",
" dx=step_size, # triggers finite difference\n",
" random_state=seed,\n",
" ) # finite difference\n",
" X_test, Y_test, J_test = test_function.sample(\n",
" )\n",
" X_test, Y_test, J_test = jenn.utilities.sample(\n",
" f=jenn.synthetic_data.rastrigin.compute,\n",
" f_prime=jenn.synthetic_data.rastrigin.compute_partials,\n",
" m_random=0,\n",
" m_levels=10,\n",
" lb=lb,\n",
Expand Down Expand Up @@ -162,7 +165,7 @@
},
"outputs": [],
"source": [
"model, r2 = fit_rastrigin(step_size=None, gamma=1.0)"
"model, r2 = fit_rastrigin(gamma=1.0)"
]
},
{
Expand Down
6 changes: 3 additions & 3 deletions src/jenn/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Copyright (C) 2018 Steven H. Berguin
# This work is licensed under the MIT License.

from . import core, synthetic, utils # TODO: remove
from . import core, synthetic_data, utilities
from .core.model import NeuralNet
from .post_processing import (
metrics,
Expand All @@ -29,6 +29,6 @@
"plot_histogram",
"plot_residual_by_predicted",
"plot_sensitivity_profiles",
"synthetic",
"utils",
"synthetic_data",
"utilities",
]
Loading