コストとして交差エントロピーを使用して、シグモイド関数の導関数を見つけるために theano パッケージを使用しています。これは私のコードです:
variable = tensor.dmatrix('variable')
y= tensor.nnet.softmax(tensor.dot(z,variable))
cost =tensor.sum( tensor.nnet.binary_crossentropy(y,y))
gp = tensor.grad(cost,variable)
dlogistic = function([variable],gp)
コードを実行すると、次のエラーが表示されます。
WARNING (theano.tensor.opt): WARNING: Your current code is fine,
but Theano versions between rev. 3bd9b789f5e8 (2010-06-16) and
cfc6322e5ad4 (2010-08-03) would have given an incorrect result.
To disable this warning, set the Theano flag warn.sum_div_dimshuffle_bug
to False.
しかし、私はそれを行う方法がわかりません。私はこれを試しました:
warn.sum_div_dimshuffle_bug= false
しかし、それは変数として認識されていないと言って、警告でエラーを出しています。