基于张量流的贝叶斯监督深度学习
aboleth的Python项目详细描述
一个简单的框架 {EM1} $ Bayes EME>深度学习和高斯过程近似[1] 随机梯度变分bayes推论[2]。
功能
aboleth的一些功能:
为什么?
ABOLETH的目的是提供一套高性能、轻量化的 贝叶斯神经网络和近似(深)高斯的构造 处理计算图。我们的目标是minimal抽象 TensorFlow,因此您仍然可以将计算图的一部分分配给 不同的硬件,使用自己的数据源/队列,并管理自己的 会话等
下面是一个用一个 网络权值的隐层和正态先验/后验分布:
importtensorflowastfimportabolethasab# Define the network, ">>" implements function composition,# the InputLayer gives a kwarg for this network, and# allows us to specify the number of samples for stochastic# gradient variational Bayes.net=(ab.InputLayer(name="X",n_samples=5)>>ab.DenseVariational(output_dim=100)>>ab.Activation(tf.nn.relu)>>ab.DenseVariational(output_dim=1))X_=tf.placeholder(tf.float,shape=(None,D))Y_=tf.placeholder(tf.float,shape=(None,1))# Build the network, nn, and the parameter regularization, klnn,kl=net(X=X_)# Define the likelihood modellikelihood=tf.distributions.Bernoulli(logits=nn).log_prob(Y_)# Build the final loss function to use with TensorFlow trainloss=ab.elbo(likelihood,kl,N)# Now your TensorFlow training code here!...
目前,Aboleth的重点是监督任务,但这是 如果对此感兴趣,可在后续版本中进行更改 能力。
安装
note:aboleth是一个python 3库。一些功能 其中取决于python 3中的特性。对不起的。
要想快速启动和运行,您可以使用pip并从 PyPI:
$ pip install aboleth
为了在您的体系结构上获得最佳性能,我们建议安装 TensorFlow from sources。
或者,安装demos:
$ pip install aboleth[demos]
要在开发模式下安装开发所需的软件包,我们建议 从github克隆存储库:
$ git clone git@github.com:data61/aboleth.git
然后在克隆到的目录中,发出以下命令:
$ pip install -e .[dev]
开始
请参阅quick start guide开始,然后 有关更深入的指南,请查看我们的tutorials。 有关更多信息,请参见demos文件夹 使用aboleth创建和训练算法的示例。
完整的项目文档可以在readthedocs上找到。
参考文献
[1] | (1, 2) Cutajar, K. Bonilla, E. Michiardi, P. Filippone, M. Random Feature Expansions for Deep Gaussian Processes. In ICML, 2017. |
[2] | (1, 2) Kingma, D. P. and Welling, M. Auto-encoding variational Bayes. In ICLR, 2014. |
[3] | Hafner, D., Tran, D., Irpan, A., Lillicrap, T. and Davidson, J., 2018. Reliable Uncertainty Estimates in Deep Neural Networks using Noise Contrastive Priors. arXiv preprint arXiv:1807.09289. |
许可证
版权所有2017 CSIRO(数据61)
根据apache许可证2.0版(以下简称“许可证”)授权; 除非符合许可证,否则您不能使用此文件。 您可以在
http://www.apache.org/licenses/LICENSE-2.0
除非适用法律要求或书面同意,否则软件 根据许可证分发是按“原样”分发的, 无任何明示或默示的保证或条件。 有关管理权限的特定语言和 许可下的限制。