xiangze's sparse blog

機械学習、ベイズ統計、コンピュータビジョンと関連する数学について

BayesFlowについて

kerasのようにTensorflowの中にEdwardを取り込むという話もありましたが、BayesFlowという名前でtf.contribの中に取り込まれています。
https://www.tensorflow.org/api_docs/python/tf/contrib/bayesflow

今の所klpq(csiszar_divergence内のkl_forward), hmc, metropolis_hastings などがEdward由来のものらしいですが、そうでない物もあり興味深いです。が使用例はまだほとんどないようです。

内容

csiszar_divergence module: Csiszar f-Divergence and helpers.

(Csiszar) f-Divergenceは色々なdivergenceを包括する概念
amari_alphaをベースに色々なdivergenceが実装されている。期待値をとる前の核の部分(generator)の関数をTensorとして返すようになっている。
GANの変種に使えそう(使われている?)

参考

custom_grad module: Functions for specifying custom gradients.

勾配を独自に定義することができる?らしい。ある点xでの関数の値f(x)と導関数の値g(x)を与えるとそれに対応した関数を返してくれるらしい。

halton_sequence module: Support for low discrepancy Halton sequences.

ある種の擬似乱数の生成方法らしい 

hmc module: Hamiltonian Monte Carlo, a gradient-based MCMC algorithm.

Edward由来らしいハミルトンモンテカルロ

layers module: Probabilistic neural layers.

Edward(かcontrib.distribution)のdistribution(確率分布)のクロージャーが定義されている。分布関数のパラメータとして学習された変数を渡すことができて階層的なモデルが作れるらしい。階層ベイズモデルなどに使えるのだろうか。

metropolis_hastings module: Functions to create a Markov Chain Monte Carlo Metropolis step.

metropolis_hastings法 Edward由来のよう

monte_carlo module: Monte Carlo integration and helpers.

(普通の) Monte Carlo法とImportance Sampler( E_p[f(Z)] = E_q[f(Z) p(Z) / q(Z)] に分布qを代入する形)

*1:EdwardにはSGLDを用いたサンプリングがある