mfinzi / equivariant-MLP

A library for programmatically generating equivariant layers through constraint solving
MIT License
251 stars 21 forks source link

Subdirect (pairing) product - Finding the equivariant basis for symmetry pairs #17

Closed Danfoa closed 2 years ago

Danfoa commented 2 years ago

Hi,

I am building an equivariant architecture where the input and output spaces of one of the layers have symmetry groups G1 and G2 where G1, G2 ⊆ O(n) and |G1| == |G2|. The key property of my application is that equivariance is only desired between pairs of input/output group actions, rather than between a direct product of all input/output actions.

That is, for the linear mapping U1 -> U2 the symmetry constraints should be built only from unique pairs of G1 and G2, where each group action is associated only with one pair. By avoiding the Group Direct Product, we achieve a lower number of constraints and a larger number of resultant equivariant bases (trainable parameters).

I have played quite a bit with the internals of EMLP, but I haven't found yet a nice way of introducing this subproduct. From Eq. 8 on the paper, I realize that this should not be difficult, however, I have been unable to familiarize myself with your code structure.

I will try to solve this in the coming days, and if desired I can submit a pull request. For the time being, if you have any advice or insight it would be more than helpful.

mfinzi commented 2 years ago

Hi @Danfoa,

Probably the easiest way would be to create a function that maps the two groups to a new group where you would specify (a faithful representation of) the generators as a function of the other two groups or their generators. Here is one example for how direct products groups can be implemented this way, and presumably the subdirect product could be implemented similarly. Then you could make representations of that group as you see fit. If that doesn't allow you to do what you want let me know and I can have a look into it.