0
我正在使用theano程序包來查找使用交叉熵作爲成本的sigmoid函數的導數。這是我的代碼:如何將Theano標誌warn.sum_div_dimshuffle_bug設置爲False
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
但它給了我一個警告錯誤,說它不被認爲是一個變量。
還有其他的方式來改變Theano標誌說明如下:http://www.deeplearning.net/software/theano/library/config.html。例如,使用環境變量THEANO_FLAGS = warn.sum_div_dimshuffle_bug = False。 – nouiz