def __init__(self, ci, cn, transf):
Layer.__init__(self, ci, cn, cn, {'w': (cn, ci), 'b': cn})
self.transf = transf
if not hasattr(transf, 'out_minmax'):
test = np.asfarry([-1e100, -100, -10, -1, 0, 1, 10, 100, 1e100])
val = self.transf(test)
self.out_minmax = np.array([val.min(), val.max()] * self.co)
else:
self.out_minmax = np.asfarray([transf.out_minmax] * self.co)
# default init function
self.initf = init.initwb_reg
#self.initf = init.initwb_nw
self.s = np.zeros(self.cn)
评论列表
文章目录