Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/node.js/35.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 在Tensorflow中,稠密层的偏移可以设置为零吗?_Python_Tensorflow_Machine Learning - Fatal编程技术网

Python 在Tensorflow中,稠密层的偏移可以设置为零吗?

Python 在Tensorflow中,稠密层的偏移可以设置为零吗?,python,tensorflow,machine-learning,Python,Tensorflow,Machine Learning,我正在尝试实现一个神经网络,其中我只需要输入的核乘法。Tensorflow中的稠密层也增加了偏差,我试图将其设置为零。从文档中可以使用的唯一变量是bias\u regularizer。所以我试着做了以下几点: def置零(uu): 返回np.0(21,) out1=tf.layers.dense(输入=码字,单位=21,激活=无,偏差正则化器=零) 但我仍然看到偏差值不是零。是否有其他方法可以实现此目的?请参阅的文档,您可以使用选项use_bias=False来完全消除偏差: out1 = t

我正在尝试实现一个神经网络,其中我只需要输入的核乘法。Tensorflow中的稠密层也增加了偏差,我试图将其设置为零。从文档中可以使用的唯一变量是
bias\u regularizer
。所以我试着做了以下几点:

def置零(uu):
返回np.0(21,)
out1=tf.layers.dense(输入=码字,单位=21,激活=无,偏差正则化器=零)
但我仍然看到偏差值不是零。是否有其他方法可以实现此目的?

请参阅的文档,您可以使用选项
use_bias=False
来完全消除偏差:

out1 = tf.layers.dense(inputs=codeword, units=21, activation=None, use_bias=False)