Does PYMC convert dtypes of dims when sampling?

I am getting a warning that results in extremely poor sampling results. The warning message is:

DeprecationWarning: NumPy will stop allowing conversion of out-of-bound Python integers to integer arrays. The conversion of 30352 to int8 will fail in the future.

Is PYMC converting my dim to an int8? Can I stop it from doing so?

That’s just a new warning from the newest release of numpy that we haven’t had time to change yet. I think your sampling performance issues are completely unrelated. You can either ignore/suppress the warning or install the previous version of numpy if you are worried.

Thank you for the quick response @ricardoV94. Can I just ask a quick follow-up. In my likelihood designation, I do not get that error for the following:

pm.StudentT(‘likelihood’, nu=nu, mu=a0+a[ x ], sigma=ySigma, observed=y)

However when I redefine sigma to have a shape of the number of categories in x and redefine my likelihood as

pm.StudentT(‘likelihood’, nu=nu, mu=a0+a[ x ], sigma=ySigma[ x ], observed=y)

That is when I get the above warning. Even though, I was indexing a[ x ] with my first likelihood. Do you have any idea why that may be the case?

It’s a different model and the inputs now have a different relationship that is handled different in a way that triggers that numpy warning.

It’s still nothing to be worried about. We have a GitHub issue that you can track to see when it gets solved: Numpy deprecation warning when converting python integers · Issue #146 · pymc-devs/pytensor · GitHub

1 Like

I understand now, thank you. You are correct that the poor sampling was unrelated to the warning message. Thank you again for you help.