Fuction

  • Step-to-step Fuction

    • 1,0,1,0
  • Sigmoid Fuction
  • H(x)=1/(1+exp(-x))

Picture

  • Step-to-step Fuction
    Some Neural-Fuction Aboud Mathematics
  • Sigmoid Fuction
    Some Neural-Fuction Aboud Mathematics

Code

  • Step-to-step Fuction
import numpy as np
import matplotlib.pylab as plt
def step_fuction(x):

    # x_=[]
    # for i in x:
    #     if(i>0):
    #         x_.append(1)
    #     else:
    #         x_.append(0)
    # return x_
    return np.array(x>0,dtype=np.int)

x=np.arange(-5,5,0.1) # formation -5~5 andArithmetic sequence 0.1
y=step_fuction(x)
print(y)
plt.plot(x,y)
plt.ylim(-0.1,1.1)
plt.show()
  • Sigmoid Fuction Fuction
import numpy as np
import matplotlib.pylab as plt
def step_fuction(x):
    return 1/(1+np.exp(-x))
x=np.arange(-5,5,0.1) # formation -5~5 andArithmetic sequence 0.1
y=step_fuction(x)
print(y)
plt.plot(x,y)
plt.ylim(-0.1,1.1)
plt.show()