import numpy as np import matplotlib as mpl import matplotlib.pyplot as plt import random #sigmoid函数定义def sigmoid(x): # print('sigmoid:',x,1.0 / (1+math.exp(-x))) return 1.0 / (1+ np.exp(-x))#模拟数据x = [-2,6,-2,7,-3,3,0,8,1,10,2,12,2,5,3,6,4,5,2,15,1,1