cudamat/cudamat — pull request #23 by untom (2013-11-05 14:48:03+00:00)
Title: Added function to calculate the L1 regularization penalty.

This function can be used to calculate the L1 penalty update when training a Neural Net. It's much faster than doing:

l1_penalty = alpha * np.sign(w)
dw += np.where(alpha > np.abs(w), X, l1_penalty)

Since it's very focused on machine-learning application my guess was that this goes into learn.py instead of cudamat.py.

(I'm not too happy about the functionname BTW, let me know if you have a better name)