MCPcopy Create free account
hub / github.com/Newmu/dcgan_code / l2norm

Function l2norm

lib/ops.py:17–18  ·  view source on GitHub ↗
(x, axis=1, e=1e-8, keepdims=True)

Source from the content-addressed store, hash-verified

15 return x/l2norm(x, axis=axis, e=e, keepdims=keepdims)
16
17def l2norm(x, axis=1, e=1e-8, keepdims=True):
18 return T.sqrt(T.sum(T.sqr(x), axis=axis, keepdims=keepdims) + e)
19
20def cosine(x, y):
21 d = T.dot(x, y.T)

Callers 3

l2_normMethod · 0.90
l2normalizeFunction · 0.85
cosineFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected