예제 #1
0
    def __init__(self, s0, nOutput, weight=None, bias=None):
        Node.__init__(self)
          # n should be forwarded/evaluated
        self.w = weight
        self.b = bias
        self.input.append(self.w)
        self.input.append(s0)
        self.input.append(self.b)
        s0.output.append(self)
        if self.w: self.w.output.append(self)
        if self.b: self.b.output.append(self)


        self._neurons = nOutput
예제 #2
0
파일: Variable.py 프로젝트: javimdr/PyHotAD
 def __init__(self, s):
     Node.__init__(self)
     self.value = np.matrix(s)
     self.input.append(self)
예제 #3
0
파일: Sub.py 프로젝트: javimdr/PyHotAD
 def __init__(self, s0, s1):
     Node.__init__(self)
     self.input.append(s0)
     self.input.append(s1)
     s0.output.append(self)
     s1.output.append(self)
예제 #4
0
 def backward(self):
     Node.backward(self)
     self.w.backward()
     self.b.backward()
예제 #5
0
파일: Weight.py 프로젝트: javimdr/PyHotAD
 def __init__(self, sr, sc):
     Node.__init__(self)
     self.value = np.matrix(np.random.randn(sr, sc) / np.sqrt(sc))
     self.input.append(self)
예제 #6
0
 def __init__(self, y, l):
     Node.__init__(self)
     self.input.append(y)
     self.input.append(l)
     y.output.append(self)
     l.output.append(self)
예제 #7
0
파일: Sigmoid.py 프로젝트: javimdr/PyHotAD
 def __init__(self, n0):
     Node.__init__(self)
     self.input.append(n0)
     n0.output.append(self)