Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/rushter/MLAlgorithms
/ _penalty
Method
_penalty
mla/neuralnet/regularizers.py:34–35 ·
view source on GitHub ↗
(self, weights)
Source
from the content-addressed store, hash-verified
32
""
"Linear combination of L1 and L2 penalties."
""
33
34
def
_penalty(self, weights):
35
return
0.5 * self.C * weights**2 + (1.0 - self.C) * np.abs(weights)
Callers
nothing calls this directly
Calls
no outgoing calls
Tested by
no test coverage detected