Skip to content

Update NMF.#54

Closed
sinshu wants to merge 1 commit intomainfrom
better-nmf2
Closed

Update NMF.#54
sinshu wants to merge 1 commit intomainfrom
better-nmf2

Conversation

@sinshu
Copy link
Copy Markdown
Owner

@sinshu sinshu commented Mar 21, 2026

No description provided.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2b0c5b5ed3

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +246 to +248
if (bestIndex < 0 || bestImprovement <= CoordinateUpdateTolerance)
{
break;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Remove the absolute improvement cutoff from coordinate descent

UpdateByGreedyCoordinateDescent compares bestImprovement against a fixed 1e-12, but that quantity is in squared-error units. If the same NMF problem is scaled down (for example, V, W, and H all multiplied by about 1e-7 in a balanced way), the relative residual is unchanged while every candidate step's improvement shrinks below this threshold, so Update becomes a no-op on otherwise valid low-magnitude inputs. This makes convergence depend on the units of the data rather than the geometry of the factorization.

Useful? React with 👍 / 👎.

Comment on lines +218 to +221
var denominator = fgram[index, index];
if (denominator <= CoordinateDenominatorTolerance)
{
continue;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Avoid skipping coordinates based on absolute Gram scale

The denominator <= 1e-12 guard breaks the usual W -> cW, H -> H/c invariance of NMF. For a valid warm start with very small W columns and compensating large H rows, gram[i,i] falls below this cutoff and the corresponding H coordinates are never updated, while the same factorization at a different scale updates normally. In practice that can stall one half of the alternating step purely because the factors were rescaled, not because the optimization reached a stationary point.

Useful? React with 👍 / 👎.

@sinshu sinshu closed this Mar 21, 2026
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.

1 participant