learn_dl icon indicating copy to clipboard operation
learn_dl copied to clipboard

error

Open 18463105800 opened this issue 7 years ago • 2 comments

When I used the fc.py to train the MINIST,it happened a error: File "D:\pycharm\project\fc.py", line 107, in calc_gradient ) * (label - self.layers[-1].output) ValueError: operands could not be broadcast together with shapes (10,) (10,300)

18463105800 avatar Oct 01 '17 11:10 18463105800

I found that if the label is (10,1) can do subtraction

zwww7766 avatar Oct 26 '17 18:10 zwww7766

function backward should be modified: self.W_grad = np.array(mat(delta_array).T * mat(self.input))

I suggest you change the list format of the data(train and test) to an array type. np.array(data)

FlyingCat-fa avatar Aug 03 '18 07:08 FlyingCat-fa