代码 import numpy as np # 各种激活函数及导数 def sigmoid(x): return 1 / (1 + np.exp(-x)) def dsigmoid(y): return y * (1 - y) def tanh(x): return np.tanh(x) def dtanh(y): return 1.0 - y ** 2 def relu(y): tmp = y.copy() tmp[tmp < 0 xss=removed>= 0] = 1