Alignment in dimension of matrices

守給你的承諾、 提交于 2019-12-25 01:56:11

问题


I tried to run this code with my data but I obtained this error:

"ValueError: shapes (3,126) and (3,126) not aligned: 126 (dim 1) != 3 (dim 0)"

I'm doing the neural network and I don't want to use libraries which are suitable for Neural Network like TensorFlow.

X = pd.read_excel(r"C:\\users\Hasan\Desktop\ANN\x.xlsx")
y = pd.read_excel(r"C:\\users\Hasan\Desktop\ANN\y.xlsx")
xPredicted = pd.read_excel(r"C:\\users\Hasan\Desktop\ANN\xpredict.xlsx")

self.W1 = np.random.randn(self.inputSize, self.hiddenSize)
self.W2 = np.random.randn(self.hiddenSize, self.outputSize)
self.z = np.dot(X, self.W1) 
self.z2 = self.sigmoid(self.z) # activation function
self.z3 = np.dot(self.z2, self.W2) 
o = self.sigmoid(self.z3) # final activation function

ValueError: shapes (3,126) and (3,126) not aligned: 126 (dim 1) != 3 (dim 0)

来源:https://stackoverflow.com/questions/56197904/alignment-in-dimension-of-matrices

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!