ML-From-Scratch icon indicating copy to clipboard operation
ML-From-Scratch copied to clipboard

l1 regularization

Open forcoogle opened this issue 5 years ago • 2 comments

Shouldn't class l1_regularization() be defined as self.alpha * np.linalg.norm(w, 1) instead of self.alpha * np.linalg.norm(w)?

forcoogle avatar Sep 20 '19 21:09 forcoogle

i think so too

cpy18727 avatar May 07 '20 04:05 cpy18727

Yes, I was looking at that for way too long. It should def be np.linalg.norm(w, 1) for the L1-norm or Manhattan distance, the default is the L2-norm (Frobenius).

klintan avatar Oct 26 '22 05:10 klintan