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

Class Prelu

lib/activations.py:62–72  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

60 return f1 * x + f2 * abs(x)
61
62class Prelu(object):
63
64 def __init__(self):
65 pass
66
67 def __call__(self, x, leak):
68 if x.ndim == 4:
69 leak = leak.dimshuffle('x', 0, 'x', 'x')
70 f1 = 0.5 * (1 + leak)
71 f2 = 0.5 * (1 - leak)
72 return f1 * x + f2 * abs(x)
73
74class Tanh(object):
75

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected