Skip to content

Commit

Permalink
fix:More robust normalization.
Browse files Browse the repository at this point in the history
  • Loading branch information
antononcube committed Nov 22, 2021
1 parent b2c6475 commit e4e1d05
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion NonNegativeMatrixFactorization.m
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ Mathematica is (C) Copyright 1988-2013 Wolfram Research, Inc.
Block[{d, S, SI},
d = Table[Norm[H[[i]]], {i, Length[H]}];
S = DiagonalMatrix[d];
SI = DiagonalMatrix[1 / d];
SI = DiagonalMatrix[Map[If[# != 0, 1 / #, 0]&, d]];
{W.S, SI.H}
];

Expand Down

0 comments on commit e4e1d05

Please sign in to comment.