robust-pca icon indicating copy to clipboard operation
robust-pca copied to clipboard

Error in L1-norm implementation

Open ZeinBarhoum opened this issue 1 year ago • 0 comments

There is a difference between the implementation of the L1-norm used (numpy norm with order 1), with the definition of L1-norm in the original paper. In the paper, the L1-norm of a matrix is defined as the sum of absolute values of all the elements (seeing the matrix as a long vector), which is different than numpy norm function. The following images show that.

original paper: image

numpy: image

This affects the value of mu in the following piece of code: self.mu = np.prod(self.D.shape) / (4 * np.linalg.norm(self.D, ord=1))

The matrix should be flattened before applying the numpy norm function in order to follow the paper.

ZeinBarhoum avatar May 19 '23 22:05 ZeinBarhoum