def _temporal_phase3(htm, updateSegments): 'Phase 3, p42' for cell in htm.cells: if cell.learning: for synapseStates in updateSegments[cell]: Segment.adapt_up(synapseStates) updateSegments.reset(cell) elif not cell.predicting and cell.predicted: for synapseStates in updateSegments[cell]: Segment.adapt_down(synapseStates) updateSegments.reset(cell) return updateSegments
def testAdaptation(self): seg = Segment() #for now, just don't crash seg.adapt_up([]) seg.adapt_down([])