april-tools / cirkit

a python framework to build, learn and reason about probabilistic circuits and tensor networks
https://cirkit-docs.readthedocs.io/en/latest/
GNU General Public License v3.0
71 stars 1 forks source link

Height dimension should come before the width dimension #84

Closed loreloc closed 4 months ago

loreloc commented 1 year ago

It's the convention used by PyTorch, e.g., https://pytorch.org/docs/stable/generated/torch.nn.Conv2d.html

Make sure that every shape tuple for images (e.g., the implementation of QuadTree) follows the channel-height-width convention $(C,H,W)$.

lkct commented 1 year ago

there shouldn't be width or height. QG and QT are square. we should only pass in one "size"

arranger1044 commented 1 year ago

Well, we might have (sub)images in the future with different height and width.

lkct commented 1 year ago

Well, we might have (sub)images in the future with different height and width.

Then we should overhaul the implementation. It's not supported currently

arranger1044 commented 1 year ago

what's missing? RGs such as PD/QG/RND are agnostic to the image being a square

lkct commented 1 year ago

not sure. I haven't looked into the three RG implementations in detail. I just saw there's assert width==height.

the three need to be further refactored anyway

arranger1044 commented 1 year ago

to see why it is not actually a theoretical limitation, see the appendix of Antonio M's TPM paper there are examples of QG/PD on rectangular images