Removal of forward_val from transforms

It appears from #4129 that forward_val is being removed from StickBreaking and other transforms. It concerns me that this could break the code of users who have made use of this feature. I have found it useful for generating a prior approximating an empirical distribution in the simplex, e.g. variates produced by simulation. These can be transformed into Euclidean space and approximated by a multivariate normal distribution, which is then transformed back into the simplex as a prior. Deriving forward_val from forward (and backward_val from backward) seems quite trivial. At the minimum, there should be a fairly extended period of deprecation warnings.

@Helmut I meant opening a separate GitHub issue not here on the Discourse (and I still suggest that)

Now, regardless of the Deprecation changes that we might want to add, note that you can use the forward method to replace the forward_val. The forward is a Aesara symbolic expression, whereas the forward_val was a Numpy equivalent. You can compile the Aesara forward to be callable just like the forward_val used to be. With something like (coding from memory):


import aesara
import aesara.tensor as at
from pymc3.distributions.transforms import StickBreaking

inp = at.vector()
out = StickBreaking().forward(None, inp)
forward_val = aesara.function([inp], out)  # compile

forward_val(np.array([0,0,0]))  # should work like the old forward_val

Also note that the forward_val was an internal library helper that is no longer needed after the next large version release. There are many other internal changes going on, so somethings might not even get deprecated (but there will be an update guide explaining the major changes)

OK, this looks good. Thanks.