Skip to content

Commit

Permalink
Fix non-determinism in basis expansion blocks
Browse files Browse the repository at this point in the history
Fixes #103

Signed-off-by: Kale Kundert <[email protected]>
  • Loading branch information
kalekundert committed Oct 31, 2024
1 parent a9487c2 commit 1ef554a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions escnn/nn/modules/basismanager/basisexpansion_blocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from escnn.kernels import KernelBasis, EmptyBasisException
from escnn.group import Representation
from escnn.nn.modules import utils
from escnn.nn.modules.utils import unique_ever_seen

from .basismanager import BasisManager
from .basisexpansion_singleblock import block_basisexpansion
Expand Down Expand Up @@ -62,8 +63,8 @@ def __init__(self,

# iterate through all different pairs of input/output representations
# and, for each of them, build a basis
for i_repr in set(in_reprs):
for o_repr in set(out_reprs):
for i_repr in unique_ever_seen(in_reprs):
for o_repr in unique_ever_seen(out_reprs):
reprs_names = (i_repr.name, o_repr.name)
try:

Expand Down
5 changes: 3 additions & 2 deletions escnn/nn/modules/basismanager/basissampler_blocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from .basismanager import BasisManager

from escnn.nn.modules.basismanager.basissampler_singleblock import block_basissampler
from escnn.nn.modules.utils import unique_ever_seen

from typing import Callable, Tuple, Dict, List, Iterable, Union
from collections import defaultdict
Expand Down Expand Up @@ -62,8 +63,8 @@ def __init__(self,

# iterate through all different pairs of input/output representations
# and, for each of them, build a basis
for i_repr in set(in_reprs):
for o_repr in set(out_reprs):
for i_repr in unique_ever_seen(in_reprs):
for o_repr in unique_ever_seen(out_reprs):
reprs_names = (i_repr.name, o_repr.name)
try:

Expand Down

0 comments on commit 1ef554a

Please sign in to comment.