Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def Leaky(x):
- if(x > 0):
- return x
- else:
- return 0.01*x
- a = np.array([[-1,2],[-3,4]])
- np.where(a>0, a, 0.01*a)
- array([[-0.01, 2. ],
- [-0.03, 4. ]])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement