Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proposal to enhance stopping criterion in sc.weight.fw.covariates #116

Open
PetraTschuchnig opened this issue Jan 7, 2024 · 1 comment

Comments

@PetraTschuchnig
Copy link
Contributor

When using the sc.weight.fw.covariates function, the stopping criterion is currently defined as follows: while (t < max.iter && (t < 2 || vals[t - 1] - vals[t] > min.decrease^2)) {...}. However, during optimization with covariates, vals can increase from one iteration to the next, causing the difference vals[t - 1] - vals[t] to become negative. This can prematurely terminate the optimization task even if there's actually a deterioration.
To prevent this issue, I suggest using the absolute difference abs(vals[t - 1] - vals[t]) as part of the stopping criterion, like so: while (t < max.iter && (t < 2 || abs(vals[t - 1] - vals[t]) > min.decrease^2)) {...}. If you find this change reasonable, I would be happy to push the changes to a fork and create a merge request.

@davidahirshberg
Copy link
Collaborator

davidahirshberg commented Jan 9, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants