dd=[]
for recordth in range(len(x1)):
X2=x1[recordth,:]
print("第",recordth+1,"筆=",X2)
X2len=len(X2)
for filterth in range(len(filters)):
filter=filters[filterth,:]
for i in range(0,X2len):
start=i-2
end=i+3
if i==0 :
window[0]=X2[0]
window[1]=X2[0]
window[2]=X2[0]
window[3]=X2[1]
window[4]=X2[2]
elif i==1 :
window[0]=X2[0]
window[1]=X2[0]
window[2]=X2[1]
window[3]=X2[2]
window[4]=X2[3]
elif i==X2len-2:
window[0]=X2[X2len-4]
window[1]=X2[X2len-3]
window[2]=X2[X2len-2]
window[3]=X2[X2len-1]
window[4]=X2[X2len-1]
elif i==X2len-1:
window[0]=X2[X2len-3]
window[1]=X2[X2len-2]
window[2]=X2[X2len-1]
window[3]=X2[X2len-1]
window[4]=X2[X2len-1]
else:
window=X2[start:end]
total=np.dot(filter,window)
feature=relu(total)
# feature我不清楚你的格式,但我猜你這樣改就可以了。
dd.append(feature)
print(dd)