ML-From-Scratch
ML-From-Scratch copied to clipboard
l1 regularization
Shouldn't class l1_regularization()
be defined as self.alpha * np.linalg.norm(w, 1)
instead of self.alpha * np.linalg.norm(w)
?
i think so too
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).