Skip to content

Commit 677bc4d

Browse files
committed
unindenting code in readme and fixed old method call syntax in example
1 parent 6332f6f commit 677bc4d

1 file changed

Lines changed: 12 additions & 12 deletions

File tree

README.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -122,30 +122,30 @@ So you can see more details about the API usage [there](https://pynumdiff.readth
122122

123123
* Basic Usage: you provide the parameters
124124
```python
125-
from pynumdiff.submodule import method
125+
from pynumdiff.submodule import method
126126

127-
x_hat, dxdt_hat = method(x, dt, params, options)
127+
x_hat, dxdt_hat = method(x, dt, param1=val1, param2=val2, ...)
128128
```
129129
* Intermediate usage: automated parameter selection through multi-objective optimization
130130
```python
131-
from pynumdiff.optimize import optimize
131+
from pynumdiff.optimize import optimize
132132

133-
params, val = optimize(method, x, dt, search_space={'param1':[options], 'param2':[options], ...},
133+
params, val = optimize(method, x, dt, search_space={'param1':[options], 'param2':[options], ...},
134134
tvgamma=tvgamma, # hyperparameter, defaults to None if dxdt_truth given
135135
dxdt_truth=None) # or give ground truth data, in which case tvgamma unused
136-
print('Optimal parameters: ', params)
137-
x_hat, dxdt_hat = method(x, dt, **params)
136+
print('Optimal parameters: ', params)
137+
x_hat, dxdt_hat = method(x, dt, **params)
138138
```
139139
* Advanced usage: automated parameter selection through multi-objective optimization using a user-defined cutoff frequency
140140
```python
141-
# cutoff_freq: estimate by (a) counting the number of true peaks per second in the data or (b) look at power spectra and choose cutoff
142-
log_gamma = -1.6*np.log(cutoff_frequency) -0.71*np.log(dt) - 5.1 # see: https://ieeexplore.ieee.org/abstract/document/9241009
143-
tvgamma = np.exp(log_gamma)
141+
# cutoff_freq: estimate by (a) counting the number of true peaks per second in the data or (b) look at power spectra and choose cutoff
142+
log_gamma = -1.6*np.log(cutoff_frequency) -0.71*np.log(dt) - 5.1 # see: https://ieeexplore.ieee.org/abstract/document/9241009
143+
tvgamma = np.exp(log_gamma)
144144

145-
params, val = optimize(method, x, dt, search_space={'param1':[options], 'param2':[options], ...},
145+
params, val = optimize(method, x, dt, search_space={'param1':[options], 'param2':[options], ...},
146146
tvgamma=tvgamma)
147-
print('Optimal parameters: ', params)
148-
x_hat, dxdt_hat = method(x, dt, **params)
147+
print('Optimal parameters: ', params)
148+
x_hat, dxdt_hat = method(x, dt, **params)
149149
```
150150

151151
### Notebook examples

0 commit comments

Comments
 (0)