TF的密集层中的参数kl_use_exact
试图在张量流概率中使用密集的层创建贝叶斯神经网络。我的问题是,当我们将参数kl_use_exact设置为false时,我们没有考虑先前的函数。我试图查看密集体类的源代码(_make_kl_divergence_penalty函数),而我更困惑的是,我没有使用kl_use_exact。
Trying to create a Bayesian neural network using DenseVariational layer in Tensorflow probability. My question is when we set the parameter kl_use_exact to False does by that we are not taking the prior function into consideration. I tried to look at the source code of the DenseVariational class (_make_kl_divergence_penalty function) and I'm more confused then before, I didn't get the use of kl_use_exact.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
kl_use_exact
指定变异后和先验之间的KL-Divergence的计算方法。false
:KL将被近似。true
:使用实际的KL值。但是,当时可以将其设置为true
,并且仅当分布之间的KL-Divergence以TensorFlow探行性注册。kl_use_exact
specifies the calculation method of KL-Divergence between variational posterior and prior.False
: KL will be approximated.True
: Uses the actual KL value. However it can be setTrue
if and only if the KL-Divergence between the distributions are registered in TensorFlow-Probability.