prediction = T.argmax(T.nnet.softmax(w2.dot(T.tanh(w1.dot(x)))));
cost = ((prediction - y)**2).sum();
dw1 = T.grad(cost, w1);
DW1 = dw1.eval({ w1 : W1, x: DATA, y : LABELS });
我收到错误:
UnusedInputError: theano.function was asked to create a function computing
outputs given certain inputs, but the provided input variable at index 1
is not part of the computational graph needed to compute the outputs: y.
这太荒谬了。 y
绝对是计算图的一部分。
为什么Theano这样做?