Пример #1
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)
Пример #2
0
 def _fprop(self,X):
     return sm.maximum(self.slope*X,X) if X is not None else None
Пример #3
0
 def _fprop(self,X):
     if "disable_relu" in globals.flags:
         return X
     return sm.maximum(0,X) if X  is not None else None
Пример #4
0
 def _fprop(self, X):
     if "disable_relu" in globals.flags:
         return X
     return sm.maximum(0, X) if X is not None else None
Пример #5
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)
Пример #6
0
 def _fprop(self, X):
     return sm.maximum(self.slope * X, X) if X is not None else None