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 = initwb_reg
        self.s = np.zeros(self.cn)
Ejemplo n.º 2
0
 def __init__(self, ci, cn, transf, max_iter, delta):
     Layer.__init__(self, ci, cn, cn, {'w': (cn, ci), 'b': cn})
     self.max_iter = max_iter
     self.delta = delta
     self.transf = transf
     self.outs = []
     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)
     self.initf = None
     self.s = np.zeros(self.cn)
Ejemplo n.º 3
0
 def __init__(self, ci, cn, transf, max_iter, delta):
     Layer.__init__(self, ci, cn, cn, {'w': (cn, ci), 'b': cn})
     self.max_iter = max_iter
     self.delta = delta
     self.transf = transf
     self.outs = []
     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)
     self.initf = None
     self.s = np.zeros(self.cn)