예제 #1
0
파일: elemwise.py 프로젝트: kawasakin/foo
 def _bprop(self,dZ,Z,X):
     if dZ is None:
         return None
     S = sm.sign(X)
     S = sm.maximum(-self.slope,S)  # where X<0 dZ*slope, otherwise dZ*1
     return dZ*abs(S)
예제 #2
0
 def _bprop(self, dZ, Z):
     return dZ * sm.sign(
         Z) if dZ is not None else None  # sign(Z) will be 0 or +1, never -1
예제 #3
0
파일: elemwise.py 프로젝트: kawasakin/foo
    def _bprop(self,dZ,Z):  return dZ*sm.sign(Z)   if dZ is not None else None   # sign(Z) will be 0 or +1, never -1


class rectify(relu):
예제 #4
0
 def _bprop(self, dZ, Z, X):
     if dZ is None:
         return None
     S = sm.sign(X)
     S = sm.maximum(-self.slope, S)  # where X<0 dZ*slope, otherwise dZ*1
     return dZ * abs(S)