Skip to content

Commit

Permalink
ENH: Introduced better LV parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
yb6599 committed Feb 21, 2024
1 parent fa78b92 commit bfdc1a5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
9 changes: 5 additions & 4 deletions src/gen_experiments/odes.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from functools import partial
from typing import Callable

import matplotlib.pyplot as plt
Expand All @@ -14,9 +15,9 @@
from .utils import (
FullSINDyTrialData,
SINDyTrialData,
_make_model,
coeff_metrics,
integration_metrics,
make_model,
simulate_test_data,
unionize_coeff_matrices,
)
Expand Down Expand Up @@ -59,7 +60,7 @@ def forcing(t, x):


p_duff = [0.2, 0.05, 1]
p_lotka = [1, 10]
p_lotka = [5, 1]
p_ross = [0.2, 0.2, 5.7]
p_hopf = [-0.05, 1, 1]

Expand All @@ -73,7 +74,7 @@ def forcing(t, x):
],
},
"lv": {
"rhsfunc": ps.utils.odes.lotka,
"rhsfunc": partial(ps.utils.odes.lotka, p=p_lotka),
"input_features": ["x", "y"],
"coeff_true": [
{"x": p_lotka[0], "x y": -p_lotka[1]},
Expand Down Expand Up @@ -181,7 +182,7 @@ def run(
nonnegative=nonnegative,
**sim_params,
)
model = _make_model(input_features, dt, diff_params, feat_params, opt_params)
model = make_model(input_features, dt, diff_params, feat_params, opt_params)

This comment has been minimized.

Copy link
@yb6599

yb6599 Feb 21, 2024

Author Collaborator

Hey @Jacob-Stevens-Haas , I noticed experiments not running because of naming error for make_model function since it was _make_model. This commit also makes that small change in odes and pdes.

This comment has been minimized.

Copy link
@Jacob-Stevens-Haas

Jacob-Stevens-Haas Feb 22, 2024

Owner

That's my fault - I wanted to export it for another project, and I thought I had safely changed all calls to make_model. See #18

Also, let's avoid changing the main branch directly, instead making a PR? I'm going to make a branch protection rule in the future.


model.fit(x_train)
coeff_true, coefficients, feature_names = unionize_coeff_matrices(model, coeff_true)
Expand Down
4 changes: 2 additions & 2 deletions src/gen_experiments/pdes.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
from .utils import (
FullSINDyTrialData,
SINDyTrialData,
_make_model,
coeff_metrics,
integration_metrics,
make_model,
simulate_test_data,
unionize_coeff_matrices,
)
Expand Down Expand Up @@ -171,7 +171,7 @@ def run(
dt=time_args[0],
t_end=time_args[1],
)
model = _make_model(input_features, dt, diff_params, feat_params, opt_params)
model = make_model(input_features, dt, diff_params, feat_params, opt_params)

model.fit(x_train, t=t_train)
coeff_true, coefficients, feature_names = unionize_coeff_matrices(model, coeff_true)
Expand Down

0 comments on commit bfdc1a5

Please sign in to comment.