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

Class Maxout

lib/activations.py:22–34  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

20 return e_x / e_x.sum(axis=1, keepdims=True)
21
22class Maxout(object):
23
24 def __init__(self, n_pool=2):
25 self.n_pool = n_pool
26
27 def __call__(self, x):
28 if x.ndim == 2:
29 x = T.max([x[:, n::self.n_pool] for n in range(self.n_pool)], axis=0)
30 elif x.ndim == 4:
31 x = T.max([x[:, n::self.n_pool, :, :] for n in range(self.n_pool)], axis=0)
32 else:
33 raise NotImplementedError
34 return x
35
36class Rectify(object):
37

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected