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

Method __call__

lib/inits.py:81–89  ·  view source on GitHub ↗
(self, shape, name=None)

Source from the content-addressed store, hash-verified

79 self.scale = scale
80
81 def __call__(self, shape, name=None):
82 if shape[0] != shape[1]:
83 w = np.zeros(shape)
84 o_idxs = np.arange(shape[0])
85 i_idxs = np.random.permutation(np.tile(np.arange(shape[1]), shape[0]/shape[1]+1))[:shape[0]]
86 w[o_idxs, i_idxs] = self.scale
87 else:
88 w = np.identity(shape[0]) * self.scale
89 return sharedX(w, name=name)
90
91class ReluInit(object):
92

Callers

nothing calls this directly

Calls 1

sharedXFunction · 0.90

Tested by

no test coverage detected