Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import numpy as np;
- from matplotlib import pyplot
- X = np.arange(-15,15,0.1)
- def ReLU(X):
- return np.maximum(0,X)
- Y = ReLU(X);
- pyplot.plot(X, Y)
- def Sigmoid(X):
- return 1/(1+np.exp(-X))
- R = Sigmoid(X);
- pyplot.plot(X, R)
- def Softmax(X):
- ulamek_1 = np.exp(X)
- ulamek_2 = np.sum(np.exp(X))
- return ulamek_1/ulamek_2
- def Tanh(X):
- ulamek_1 = np.exp(X)-np.exp(-X)
- ulamek_2 = np.exp(X)+np.exp(-X)
- return ulamek_1/ulamek_2
- S = Tanh(X)
- pyplot.plot(X, S)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement