diff --git a/escnn/group/groups/cyclicgroup.py b/escnn/group/groups/cyclicgroup.py index 57afff79..f6772ba7 100644 --- a/escnn/group/groups/cyclicgroup.py +++ b/escnn/group/groups/cyclicgroup.py @@ -46,7 +46,10 @@ def __init__(self, N: int): Args: N (int): order of the group - + + Attributes: + ~.rotation_order (int): the number of rotations, i.e. the order of the group + """ assert (isinstance(N, int) and N > 0), N @@ -54,7 +57,10 @@ def __init__(self, N: int): super(CyclicGroup, self).__init__("C%d" % N, False, True) self.N = N - + + # int: for consistency with the DihedralGroup, store the number of rotations also in this attribute + self.rotation_order = N + self._elements = [self.element(i) for i in range(N)] # self._elements_names = ['e'] + ['r%d' % i for i in range(1, N)] diff --git a/escnn/group/groups/o2group.py b/escnn/group/groups/o2group.py index bdf381c3..1f607721 100644 --- a/escnn/group/groups/o2group.py +++ b/escnn/group/groups/o2group.py @@ -84,6 +84,7 @@ def __init__(self, maximum_frequency: int = 6): Attributes: ~.reflection: the reflection element :math:`(j, \theta) = (1, 0.)` + ~.rotation_order (int): this is equal to ``-1``, which means the group contains an infinite number of rotations """ diff --git a/escnn/group/groups/so2group.py b/escnn/group/groups/so2group.py index a550b22e..4f68e3b0 100644 --- a/escnn/group/groups/so2group.py +++ b/escnn/group/groups/so2group.py @@ -52,6 +52,9 @@ def __init__(self, maximum_frequency: int = 6): Args: maximum_frequency (int, optional): the maximum frequency to consider when building the irreps of the group + Attributes: + ~.rotation_order (int): this is equal to ``-1``, which means the group contains an infinite number of rotations + """ assert (isinstance(maximum_frequency, int) and maximum_frequency >= 0) @@ -59,7 +62,8 @@ def __init__(self, maximum_frequency: int = 6): super(SO2, self).__init__("SO(2)", True, True) self._maximum_frequency = maximum_frequency - + self.rotation_order = -1 + self._identity = self.element(0.) self._build_representations()