Skip to content

Commit 21c3d38

Browse files
committed
updated notebooks
1 parent e9c1ef4 commit 21c3d38

3 files changed

Lines changed: 236 additions & 88 deletions

File tree

examples/2a_optimizing_parameters_with_dxdt_known.ipynb

Lines changed: 118 additions & 44 deletions
Large diffs are not rendered by default.

examples/2b_optimizing_parameters_with_dxdt_unknown.ipynb

Lines changed: 117 additions & 43 deletions
Large diffs are not rendered by default.

pynumdiff/optimize/_optimize.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ def optimize(func, x, dt, search_space={}, dxdt_truth=None, tvgamma=1e-2, paddin
160160
singleton_params = {k:v for k,v in params.items() if not isinstance(v, list)}
161161

162162
# The search space is the Cartesian product of all dimensions where multiple options are given
163-
search_space_types = {k:type(v[0]) for k,v in params.items() if isinstance(v, list)} # for converting back and forth from point
163+
search_space_types = {k:type(v[0]) for k,v in params.items() if isinstance(v, list)} # map param name -> type for converting to and frompoint
164164
if any(v not in [float, int, bool] for v in search_space_types.values()):
165165
raise ValueError("Optimization over categorical strings currently not supported")
166166
# If excluding string type, I can just cast ints and bools to floats, and we're good to go

0 commit comments

Comments
 (0)