TF的密集层中的参数kl_use_exact

发布于 2025-02-09 22:21:14 字数 149 浏览 3 评论 0原文

试图在张量流概率中使用密集的层创建贝叶斯神经网络。我的问题是,当我们将参数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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

情魔剑神 2025-02-16 22:21:15

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 set True if and only if the KL-Divergence between the distributions are registered in TensorFlow-Probability.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文