Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/jquery-ui/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 如何将Theano标志warn.sum\u div\u dimsuffle\u bug设置为False_Python_Warnings_Theano - Fatal编程技术网

Python 如何将Theano标志warn.sum\u div\u dimsuffle\u bug设置为False

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

我使用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([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。