附上y=2x-b拟合的简单的代码. import numpy as np x = np.asarray([2,1,3,5,6]); y = np.zeros((1,5)); learning_rate=0.1; w=5; for i in range(len(x)): y[0][i]= func(x[i]); def func(x): return 2*x -6; def forward(w,x): return w*x -6; def backward(w,x,y): pred_y = w*x…