Skip to content

Commit

Permalink
fix class params in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
himkwtn committed Sep 11, 2024
1 parent 6209cad commit 3d9b187
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pysindy/optimizers/stable_linear_sr3.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ def _create_var_and_part_cost(
2 * self.relax_coeff_nu
)
penalty = self._calculate_penalty(
self.thresholder, np.ravel(self.reg_weight_lam), xi
self.regularizer, np.ravel(self.reg_weight_lam), xi
)
return xi, cost + penalty

Expand Down
4 changes: 2 additions & 2 deletions test/test_feature_library.py
Original file line number Diff line number Diff line change
Expand Up @@ -701,15 +701,15 @@ def test_sindypi_library(data_lorenz):
function_names=library_function_names,
include_bias=True,
)
sindy_opt = SINDyPI(threshold=0.1, thresholder="l1")
sindy_opt = SINDyPI(reg_weight_lam=0.1, regularizer="l1")
model = SINDy(
optimizer=sindy_opt,
feature_library=sindy_library,
)
model.fit(x, t=t)
assert np.shape(sindy_opt.coef_) == (40, 40)

sindy_opt = SINDyPI(threshold=1, thresholder="l1", model_subset=[3])
sindy_opt = SINDyPI(reg_weight_lam=1, regularizer="l1", model_subset=[3])
model = SINDy(
optimizer=sindy_opt,
feature_library=sindy_library,
Expand Down

0 comments on commit 3d9b187

Please sign in to comment.