@@ -81,6 +81,7 @@ def __init__(self,
8181 self .activationThreshold = activationThreshold
8282 self .maxSynapsesPerSegment = maxSynapsesPerSegment
8383 self .maxSegmentsPerCell = maxSegmentsPerCell
84+ self .bumpPhases = None # Place holder
8485
8586 self .rng = Random (seed )
8687
@@ -690,7 +691,7 @@ def __init__(self,
690691 self .cellCoordinateOffsets = cellCoordinateOffsets
691692
692693 # Phase is measured as a number in the range [0.0, 1.0)
693- self .activePhases = np .empty ((0 ,2 ), dtype = "float" )
694+ self .bumpPhases = np .empty ((0 ,2 ), dtype = "float" )
694695 self .cellsForActivePhases = np .empty (0 , dtype = "int" )
695696 self .phaseDisplacement = np .empty ((0 ,2 ), dtype = "float" )
696697
@@ -703,12 +704,12 @@ def reset(self):
703704 Clear the active cells.
704705 """
705706 super (Superficial2DLocationModule , self ).reset ()
706- self .activePhases = np .empty ((0 ,2 ), dtype = "float" )
707+ self .bumpPhases = np .empty ((0 ,2 ), dtype = "float" )
707708 self .phaseDisplacement = np .empty ((0 ,2 ), dtype = "float" )
708709
709710 def _computeActiveCells (self ):
710711 # Round each coordinate to the nearest cell.
711- activeCellCoordinates = np .floor (self .activePhases * self .cellDimensions ).astype ("int" )
712+ activeCellCoordinates = np .floor (self .bumpPhases * self .cellDimensions ).astype ("int" )
712713
713714 # Convert coordinates to cell numbers.
714715 self .cellsForActivePhases = (np .ravel_multi_index (activeCellCoordinates .T , self .cellDimensions ))
@@ -718,11 +719,11 @@ def activateRandomLocation(self):
718719 """
719720 Set the location to a random point.
720721 """
721- self .activePhases = np .array ([np .random .random (2 )])
722+ self .bumpPhases = np .array ([np .random .random (2 )])
722723 if self .anchoringMethod == "discrete" :
723724 # Need to place the phase in the middle of a cell
724- self .activePhases = np .floor (
725- self .activePhases * self .cellDimensions )/ self .cellDimensions
725+ self .bumpPhases = np .floor (
726+ self .bumpPhases * self .cellDimensions )/ self .cellDimensions
726727 self ._computeActiveCells ()
727728
728729 def _movementComputeDelta (self , displacement ):
@@ -735,7 +736,7 @@ def _movementComputeDelta(self, displacement):
735736 phaseDisplacement = (np .matmul (self .rotationMatrix , displacement ) * self .phasesPerUnitDistance )
736737
737738 # Shift the active coordinates.
738- np .add (self .activePhases , phaseDisplacement , out = self .activePhases )
739+ np .add (self .bumpPhases , phaseDisplacement , out = self .bumpPhases )
739740
740741 return phaseDisplacement
741742
@@ -757,7 +758,7 @@ def _sensoryComputeInferenceMode(self, anchorInput):
757758 inactivated = np .setdiff1d (self .activeCells , sensorySupportedCells , assume_unique = True )
758759 inactivatedIndices = np .in1d (self .cellsForActivePhases , inactivated , assume_unique = True ).nonzero ()[0 ]
759760 if inactivatedIndices .size > 0 :
760- self .activePhases = np .delete (self .activePhases , inactivatedIndices , axis = 0 )
761+ self .bumpPhases = np .delete (self .bumpPhases , inactivatedIndices , axis = 0 )
761762
762763 activated = np .setdiff1d (sensorySupportedCells , self .activeCells , assume_unique = True )
763764
@@ -774,11 +775,11 @@ def _sensoryComputeInferenceMode(self, anchorInput):
774775 for jOffset in self .cellCoordinateOffsets ]
775776 )
776777 if "corners" in self .anchoringMethod :
777- self .activePhases = activatedCoords // self .cellDimensions
778+ self .bumpPhases = activatedCoords // self .cellDimensions
778779
779780 else :
780781 if activatedCoords .size > 0 :
781- self .activePhases = np .append (self .activePhases ,activatedCoords // self .cellDimensions , axis = 0 )
782+ self .bumpPhases = np .append (self .bumpPhases ,activatedCoords // self .cellDimensions , axis = 0 )
782783
783784 self ._computeActiveCells ()
784785 self .activeSegments = activeSegments
0 commit comments