深度学习入门
神经网络
感知机
单层感知机可以可以表示与门、或门、与非门
局限性:无法表示异或门,单层感知机无法分离非线性空间
通过组合与门、与非门、或门实现异或门
2层感知机(严格地说是激活函数使用了非线性的sigmoid函数的感知机)可以表示任意函数
激活函数
import numpy as np
import matplotlib.pylab as plt
def sigmoid(x):
return 1 / (1 + np.exp(-x))
def step_function(x):
return np.array(x > 0, dtype=np.int32)
x = np.arange(-5.0, 5.0, 0.1)
y1 = sigmoid(x)
y2 = step_function(x)
plt.plot(x, y1)
plt.plot(x, y2, 'k--')
plt.ylim(-0.1, 1.1) #指定y轴范围
plt.show()