Pytensor question using nnet.softmax()

I have updated some code I have used since theano and aesara, but I can’t get it to work with pytensor.

prior to pytensor I have implemented softmax with the following
p_ = pm.Deterministic(‘p_’, at.nnet.softmax(s))

However, updating it for use with pytensor
p_ = pm.Deterministic(‘p_’, pt.nnet.softmax(s))

I get the following: AttributeError: module ‘pytensor.tensor’ has no attribute ‘nnet’

Wondering if there is more to converting code from aesara to pytensor than just importing the new packages and using them in a perfectly analogous way to previously using aesara?

  • Thanks

Softmax should be in pm.math (so pm.math.softmax()). That is just an alias to the functionality in pytensor.tensor.special.softmax(). So you can use pt.special.softmax() if that’s easier.

great. Thanks.