import numpy as np
import math
#三行为三组数据
x = np.array([[1,4,3,3,2,2,3],[85,76,89,64,55,98,73],[2,2,3,3,1,2,3]])#x2 = np.array([100, 76, 89, 64, 55, 98, 73])#x3 = np.array([2, 2, 3, 3, 1, 2, 3])
t = np.array([])
y = np.array([])
sg = np.zeros(12)
w = np.ones(100)
w = w.reshape(10,10)
alp =0.01
eps =10e-5
e0 = e1 = e2 =3
n = np.zeros(10)
b = np.zeros(10)#求解 n4-n7 :for i inrange(4,8):for j inrange(1,4):
n[i]+= x[j-1,0]* w[i, j]#加上启动函数后求解:n8 -n9for i inrange(4,8):for j inrange(1,3):
b[i]=(1/(1+math.exp(x[i-1,j-1])))*n[i]for i inrange(8,10):for j inrange(4,9):
n[i]+= w[i,j]*b[j]for i inrange(20):
sg1 =(y[i]-t[i])*(1/(1+math.exp(x[i])))*(1-((1/(1+math.exp(x[i])))))*n4
print(n[i])
import numpy as np
n = np.ones(10)
w = np.ones(100)
w = w.reshape(10,10)
x = np.array([[1,4,3,3,2,2,3],[85,76,89,64,55,98,73],[2,2,3,3,1,2,3]])for i inrange(4,8):for j inrange(1,3):
n[i]+= w[i,j]*x[j,0]print(n[i])