Skip to content

Commit 875337a

Browse files
committed
efficiency global minor changes
1 parent 76a3759 commit 875337a

File tree

5 files changed

+44
-70
lines changed

5 files changed

+44
-70
lines changed

docs/docs/notebooks/guides/efficiency_global.md

Lines changed: 9 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ import matplotlib.pyplot as plt
2828
np.random.seed(21)
2929
```
3030

31+
/Users/dimitriskyriakopoulos/Documents/ath/Effector/Code/eff-env/lib/python3.10/site-packages/tqdm/auto.py:21: TqdmWarning: IProgress not found. Please update jupyter and ipywidgets. See https://ipywidgets.readthedocs.io/en/stable/user_install.html
32+
from .autonotebook import tqdm as notebook_tqdm
33+
34+
3135

3236
```python
3337
def return_predict(t):
@@ -47,7 +51,7 @@ def return_jacobian(t):
4751

4852

4953
```python
50-
def measure_time(method_name, features):
54+
def measure_time(method_name, features, model, N, M, D, repetitions, K, model_jac=None,):
5155
fit_time_list, eval_time_list = [], []
5256
X = np.random.uniform(-1, 1, (N, D))
5357
xx = np.linspace(-1, 1, M)
@@ -144,7 +148,7 @@ for N in vec:
144148
model = return_predict(t)
145149
model_jac = return_jacobian(t)
146150
for method_name in method_names:
147-
time_dict[method_name].append(measure_time(method_name, features))
151+
time_dict[method_name].append(measure_time(method_name, features, model, N, M, D, repetitions, K, model_jac=model_jac))
148152
```
149153

150154

@@ -184,7 +188,7 @@ for N in vec:
184188
model = return_predict(t)
185189
model_jac = return_jacobian(t)
186190
for method_name in method_names:
187-
time_dict[method_name].append(measure_time(method_name, features))
191+
time_dict[method_name].append(measure_time(method_name, features, model, N, M, D, repetitions, K, model_jac=model_jac))
188192
```
189193

190194

@@ -249,7 +253,7 @@ for t in vec:
249253
model = return_predict(t)
250254
model_jac = return_jacobian(t)
251255
for method_name in method_names:
252-
time_dict[method_name].append(measure_time(method_name, features))
256+
time_dict[method_name].append(measure_time(method_name, features, model, N, M, D, repetitions, K, model_jac=model_jac))
253257
```
254258

255259

@@ -300,7 +304,7 @@ for t in vec:
300304
model = return_predict(t)
301305
model_jac = return_jacobian(t)
302306
for method_name in method_names:
303-
time_dict[method_name].append(measure_time(method_name, features))
307+
time_dict[method_name].append(measure_time(method_name, features, model, N, M, D, repetitions, K, model_jac=model_jac))
304308
```
305309

306310

@@ -346,18 +350,3 @@ Adding the two parts, we have the total runtime:
346350
| **PDP / d-PDP** | $(c_1 + c_2) N + 2 t_f$ | $D (c_1 + c_2) N + 2 D t_f$ |
347351
| **ALE** | $2 t_f$ | $2 D t_f$ |
348352
| **RHALE** | $t_f$ | $t_f$ |
349-
350-
351-
```python
352-
353-
```
354-
355-
356-
```python
357-
358-
```
359-
360-
361-
```python
362-
363-
```
-3.43 KB
Loading
-3.07 KB
Loading
-2.5 KB
Loading

notebooks/guides/efficiency_global.ipynb

Lines changed: 35 additions & 50 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)