Skip to content

Commit

Permalink
update objective to align with trapping-resolve
Browse files Browse the repository at this point in the history
  • Loading branch information
Jacob-Stevens-Haas committed Jun 2, 2024
1 parent 0254032 commit 70fbb67
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pysindy/optimizers/trapping_sr3.py
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,10 @@ def _objective(self, x, y, coef_sparse, A, PW, k):
"{0:5d} ... {1:8.3e} ... {2:8.3e} ... {3:8.2e}"
" ... {4:8.2e} ... {5:8.2e} ... {6:8.2e}".format(*row)
)
return R2 + stability_term + L1 + alpha_term + beta_term
if self.method == "global":
return 0.5 * np.sum(R2) + 0.5 * np.sum(A2) / self.eta + L1
else:
return R2 + stability_term + L1 + alpha_term + beta_term

def _update_coef_sparse_rs(
self, n_tgts, n_features, var_len, x_expanded, y, Pmatrix, A, coef_prev
Expand Down

0 comments on commit 70fbb67

Please sign in to comment.