MCPcopy
hub / github.com/junyanz/iGAN / def_comp_mask

Method def_comp_mask

lib/HOGNet.py:20–30  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

18 self._comp_mask = self.def_comp_mask()
19
20 def def_comp_mask(self):
21 BS = self.BS
22 print('COMPILING')
23 t = time()
24 m = T.tensor4()
25 bf_w = np.ones((1, 1, 2 * BS, 2 * BS))
26 bf = sharedX(floatX(bf_w))
27 m_b = dnn_conv(m, bf, subsample=(BS, BS), border_mode=(BS / 2, BS / 2))
28 _comp_mask = theano.function(inputs=[m], outputs=m_b)
29 print('%.2f seconds to compile [compMask] functions' % (time() - t))
30 return _comp_mask
31
32 def comp_mask(self, masks):
33 masks = np.asarray(self._comp_mask(masks))

Callers 1

__init__Method · 0.95

Calls 2

sharedXFunction · 0.90
floatXFunction · 0.90

Tested by

no test coverage detected