使用模型输出作为 TensorFlow 概率中的条件概率分布

Use a model output as a conditional probability distribution in TensorFlow probability

我正在 TensorFlow 概率中实现贝叶斯网络来模拟不同 ML 模型之间的交互。我们假设模型构建为 TensorFlow Estimators。给定输入数据的 class 的条件概率然后由估计器简单地建模。

TensorFlow probability 中有没有一种方法可以包装估计量,以便我可以将其视为分布?

我们与 Estimators API 的直接互操作方式不多,但您可能想看看 tfp.layers,其中包含 Keras Layers 其输出是 TFP Distribution 对象。有一堆预定义的层和一个 DistributionLambda 层,你可以用它来构建和输出你自己的 Distribution 实例,比如 Keras Sequential 的最后一层模型。有一些 colabs 有漂亮的例子 here (regression) and here (variational autoencoder).

希望对您有所帮助!