Python 如何将Theano标志warn.sum\u div\u dimsuffle\u bug设置为False
我使用theano软件包来寻找sigmoid函数的导数,使用交叉熵作为代价。这是我的代码:Python 如何将Theano标志warn.sum\u div\u dimsuffle\u bug设置为False,python,warnings,theano,Python,Warnings,Theano,我使用theano软件包来寻找sigmoid函数的导数,使用交叉熵作为代价。这是我的代码: 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([vari
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
但是它在警告时给了我一个错误,说它没有被识别为变量。试试看
from theano import config
config.warn.sum_div_dimshuffle_bug = False
这对我很有效还有其他方法可以更改此处解释的无标志:。例如,使用环境变量THEANO\u FLAGS=warn.sum\u div\u dimsuffle\u bug=False。