def __init__(self, region, srcPos, pos): """ Construct a new Column for the given parent region at source row/column position srcPos and column grid position pos. @param region the parent Region this Column belongs to. @param srcPos a tuple (srcX,srcY) of this Column's 'center' position in terms of the proximal-synapse input space. @param pos a tuple(x,y) of this Column's position within the Region's column grid. """ self.region = region #parent region self.cells = [Cell(self, i) for i in xrange(region.cellsPerCol)] #Sequence cells self.isActive = False #whether or not this Column is currently active. #The list of potential synapses and their permanence values. self.proximalSegment = Segment(region.segActiveThreshold) #The boost value for column c as computed during learning. # used to increase the overlap value for inactive columns. self.boost = 1.0 #A sliding average representing how often column c has been active # after inhibition (e.g. over the last 1000 iterations). self.activeDutyCycle = 1.0 #A sliding average representing how often column c has had # significant overlap (i.e. greater than minOverlap) with its inputs # (e.g. over the last 1000 iterations). self.overlapDutyCycle = 1.0 self.overlap = 0 #the last computed input overlap for the Column. self.ix = srcPos[0] #'input' row and col self.iy = srcPos[1] self.cx = pos[0] #'column grid' row and col self.cy = pos[1]
def createSegment(self, learningCells): """ Create a new segment for this Cell. The new segment will initially connect to at most newSynapseCount synapses randomly selected from the set of cells that were in the learning state at t-1 (specified by the learningCells parameter). @param learningCells: the set of available learning cells to add to the segment. @return the segment that was just created. """ newSegment = Segment(self.column.region.segActiveThreshold) newSegment.createSynapsesToLearningCells(learningCells) self.segments.append(newSegment) return newSegment