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

Class LeakyRectify

lib/activations.py:52–60  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

50 return T.clip((x + abs(x)) / 2.0, 0., self.clip)
51
52class LeakyRectify(object):
53
54 def __init__(self, leak=0.2):
55 self.leak = leak
56
57 def __call__(self, x):
58 f1 = 0.5 * (1 + self.leak)
59 f2 = 0.5 * (1 - self.leak)
60 return f1 * x + f2 * abs(x)
61
62class Prelu(object):
63

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected