Implement DimShuffle lifting optimization for RandomVariables
This optimization does *not* preserve equality between the numeric
results of the untransformed and transformed graphs when the RNGs and seeds are
equal. The reason is that the underlying sampler methods themselves are not
implemented in Theano, so we cannot apply the requisite DimShuffle-like
operations to the intermediate samples used to generate multiple replications
and/or independent variates.
For example, sampling a normal of size (3, 2) requires a draw of size (3, 2)
from a standard normal and we can't transpose that (3, 2) array. If we could,
then we would be able to maintain numerical equality between graphs.
正在显示
请
注册
或者
登录
后发表评论