Skip to content

Commit ee5151a

Browse files
committed
corrected notebook parallelization mistakes
1 parent f0c1757 commit ee5151a

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

examples/4_performance_analysis.ipynb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@
133133
"\t\t\tfor method,mname in tqdm(methods):\n",
134134
"\t\t\t\t#best_params, best_rmse = optimize(method, x, dt, dxdt_truth=dxdt_truth, metric='rmse')\n",
135135
"\t\t\t\t#best_params, best_ec = optimize(method, x, dt, dxdt_truth=dxdt_truth, metric='error_correlation')\n",
136-
"\t\t\t\tbest_params, best_score = optimize(method, x, dt, tvgamma=tvgamma,\n",
136+
"\t\t\t\tbest_params, best_score = optimize(method, x, dt, tvgamma=tvgamma, parallel=False,\n",
137137
"\t\t\t\t\t\tsearch_space_updates=({'order':{2,3}} if (method in [tvrdiff, robustdiff] and sim != triangle) else {})) # because convex-based with order 1 tends to hack the cost function\n",
138138
"\t\t\t\tx_hat, dxdt_hat = method(x, dt, **best_params)\n",
139139
"\t\n",
@@ -194,7 +194,8 @@
194194
"\tjobs += [{'dt':0.01, 'cutoff_frequency':3, 'noise_type':'normal', 'noise_params':[0, 0.1],\n",
195195
"\t\t\t'noise_scale':1, 'outliers':False, 'random_seed':random_seed} for cutoff_frequency in cutoff_frequencies] # 5\n",
196196
"\n",
197-
"with Pool as pool: pool.map(lambda kwargs: main_loop(**kwargs), jobs)"
197+
"def run(kwargs): main_loop(**kwargs)\n",
198+
"with Pool() as pool: pool.map(run, jobs)"
198199
]
199200
},
200201
{

0 commit comments

Comments
 (0)