masa-su / pixyz

A library for developing deep generative models in a more concise, intuitive and extendable way
https://pixyz.io
MIT License
489 stars 41 forks source link

hot-fix of methods of RelaxedDistribution as reparameterization trick #112

Closed ktaaaki closed 4 years ago

ktaaaki commented 4 years ago

以前の修正 #94 #108 でRelaxedBernoulliとRelaxedCategoricalの使用に問題が発生していたことが判明しました.

これらの挙動を以前と同様に戻しつつ,インターフェースなどの変更を小さく抑えるため,RelaxedDistribution.set_distをオーバーライドすることを提案します.

set_distの実装はDistributionBase, RelaxedBernoulli, RelaxedCategoricalで重複を含むので,より良い実装方法を検討中です.