pymc icon indicating copy to clipboard operation
pymc copied to clipboard

Remove NormalMixture comp_shape kwarg

Open ricardoV94 opened this issue 2 years ago • 8 comments

Description

This has no effect besides what shape already does

CC @lucianopaz do you remember why this existed? I imagine it had something to do with the old way that weight used to work.

ricardoV94 avatar Nov 02 '23 13:11 ricardoV94

@ricardoV94 Can you elaborate this issue more,I wish to contribute to this issue.

mohammed052 avatar Jan 09 '24 21:01 mohammed052

@ricardoV94, in version 3.x it used to be necessary to supply the component distribution shape. This could be used to do weird things like making multivariate mixture components out of scalar distributions (what I mean is that the shape of the support dimensions could effectively be changed). As far as I understand, this is no longer the case since version 4.x. Mixtures reshape their component batch dimensions so that they broadcast correctly with the mixture shape, and there is no way of changing the sport dimensions.

lucianopaz avatar Jan 10 '24 07:01 lucianopaz

Thanks for the context Luciano!

We may reintroduce something like that later down the road but for now seems safe to remove the useless kwarg

ricardoV94 avatar Jan 10 '24 07:01 ricardoV94

@mohammed052 sorry for the delay. If you are still interested, it's as simple as removing any mentions of comp_shape in https://github.com/pymc-devs/pymc/blob/2051d0b422a10ef0477cff0b3994ede4ec7c26ad/pymc/distributions/mixture.py#L496-L560

ricardoV94 avatar Jan 11 '24 15:01 ricardoV94

Thank you @ricardoV94 and @lucianopaz for explanation of the issue and its solution As I see, comp_shape is passed as parameter in new and dist functions So removing comp_shape from the argument list of these functions and removing size passed to Normal.dist parameter list must solve this issue Correct me if I am wrong,I am new to open source community

mohammed052 avatar Jan 11 '24 17:01 mohammed052

Yes, that's about it

ricardoV94 avatar Jan 11 '24 17:01 ricardoV94

If it's your first time, you may find this guide useful: https://www.pymc.io/projects/docs/en/latest/contributing/pr_tutorial.html

ricardoV94 avatar Jan 11 '24 17:01 ricardoV94

@ricardoV94 can you review the pull request I sent on 11th jan for closing this issue

mohammed052 avatar Jan 13 '24 17:01 mohammed052