Code
Hub
Trending
Workspaces
Connect
Indexed graphs
Engine
MCP
copy
Index your code
hub
/
github.com/Newmu/dcgan_code
/ gradient_regularize
Method
gradient_regularize
lib/updates.py:35–38 ·
view source on GitHub ↗
(self, p, g)
Source
from the content-addressed store, hash-verified
33
return
(p/T.sqrt(T.sum(T.sqr(p))))*T.sqrt(nrows)
34
35
def
gradient_regularize(self, p, g):
36
g += p * self.l2
37
g += T.sgn(p) * self.l1
38
return
g
39
40
def
weight_regularize(self, p):
41
p = self.max_norm(p, self.maxnorm)
Callers
7
__call__
Method · 0.80
__call__
Method · 0.80
__call__
Method · 0.80
__call__
Method · 0.80
__call__
Method · 0.80
__call__
Method · 0.80
__call__
Method · 0.80
Calls
no outgoing calls
Tested by
no test coverage detected