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

New stop condition: use component relative change #83

Merged
merged 1 commit into from
Aug 22, 2023

Conversation

youdongguo
Copy link
Contributor

Previously, convergence was achieved when |W[i, j]-preW[i, j]|<=tol for all i, j.

Running NMF on 10*X (where X is the data matrix ) would increase the number of iterations compared to NMF on X. Now, ||W[:, j]-preW[:, j]||/||W[:, j]+preW[:, j]||<=tol for all j is the new convergence criterion, which is relative difference rather absolute difference and thus, it is scale invariant.

This might be a breaking change but it is unclear.

This new criterion is more similar to the the stop condition in sklearn.decomposition.NMF

Previously, convergence was achieved when
`|W[i, j]-preW[i, j]|<=tol for all i, j`.
Running NMF on `10*X`  (where `X` is the data matrix )
would increase the number of iterations compared to NMF on `X`.
Now, `||W[:, j]-preW[:, j]||/||W[:, j]+preW[:, j]||<=tol for all j`
is the new convergence criterion, which is relative difference
rather absolute difference and thus, it is scale invariant.
Copy link
Collaborator

@timholy timholy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll plan to merge this by the end of this week, unless objections arise. So everyone knows, @youdongguo and I collaborate and he and I discussed this in advance; I think this is an important change (I think the old criterion makes no sense at all), but anyone who cares should come to their own conclusion.

Personally, the only part I'm unsure about is whether this qualifies as breaking. Is changing a convergence criterion (which could change the number of iterations and thus both the time needed and quality of a solution) "breaking"? I'm not alone in wrestling with this, e.g., https://dev.to/turnerj/should-behavioural-changes-be-considered-breaking-changes-under-semver-2d5n#comment-b6jd.

If we do decide it's breaking, it's a little funny to release 2.0 so shortly after 1.0. But if that's what we need to do, that's fine, as version numbers are cheap.

@timholy timholy merged commit 6e29f4d into JuliaStats:master Aug 22, 2023
5 checks passed
timholy added a commit that referenced this pull request Jul 14, 2024
The `verbose=true` option was broken in #83, but it wasn't detected
because it was never tested.
@timholy timholy mentioned this pull request Jul 14, 2024
timholy added a commit that referenced this pull request Jul 14, 2024
The `verbose=true` option was broken in #83, but it wasn't detected
because it was never tested.
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

Successfully merging this pull request may close these issues.

2 participants