@classmethod<EOL><INDENT>def read(cls, proto):<DEDENT>
tm = object.__new__(cls)<EOL>tm.columnDimensions = tuple(proto.columnDimensions)<EOL>tm.cellsPerColumn = int(proto.cellsPerColumn)<EOL>tm.activationThreshold = int(proto.activationThreshold)<EOL>tm.initialPermanence = round(proto.initialPermanence, EPSILON_ROUND)<EOL>tm.connectedPermanence = round(proto.connectedPermanence, EPSILON_ROUND)<EOL>tm.minThreshold = int(proto.minThreshold)<EOL>tm.maxNewSynapseCount = int(proto.maxNewSynapseCount)<EOL>tm.permanenceIncrement = round(proto.permanenceIncrement, EPSILON_ROUND)<EOL>tm.permanenceDecrement = round(proto.permanenceDecrement, EPSILON_ROUND)<EOL>tm.predictedSegmentDecrement = round(proto.predictedSegmentDecrement,<EOL>EPSILON_ROUND)<EOL>tm.maxSegmentsPerCell = int(proto.maxSegmentsPerCell)<EOL>tm.maxSynapsesPerSegment = int(proto.maxSynapsesPerSegment)<EOL>tm.connections = Connections.read(proto.connections)<EOL>tm._random = Random()<EOL>tm._random.read(proto.random)<EOL>tm.activeCells = [int(x) for x in proto.activeCells]<EOL>tm.winnerCells = [int(x) for x in proto.winnerCells]<EOL>flatListLength = tm.connections.segmentFlatListLength()<EOL>tm.numActiveConnectedSynapsesForSegment = [<NUM_LIT:0>] * flatListLength<EOL>tm.numActivePotentialSynapsesForSegment = [<NUM_LIT:0>] * flatListLength<EOL>tm.lastUsedIterationForSegment = [<NUM_LIT:0>] * flatListLength<EOL>tm.activeSegments = []<EOL>tm.matchingSegments = []<EOL>for protoSegment in proto.activeSegments:<EOL><INDENT>tm.activeSegments.append(<EOL>tm.connections.getSegment(protoSegment.cell,<EOL>protoSegment.idxOnCell))<EOL><DEDENT>for protoSegment in proto.matchingSegments:<EOL><INDENT>tm.matchingSegments.append(<EOL>tm.connections.getSegment(protoSegment.cell,<EOL>protoSegment.idxOnCell))<EOL><DEDENT>for protoSegment in proto.numActivePotentialSynapsesForSegment:<EOL><INDENT>segment = tm.connections.getSegment(protoSegment.cell,<EOL>protoSegment.idxOnCell)<EOL>tm.numActivePotentialSynapsesForSegment[segment.flatIdx] = (<EOL>int(protoSegment.number))<EOL><DEDENT>tm.iteration = long(proto.iteration)<EOL>for protoSegment in proto.lastUsedIterationForSegment:<EOL><INDENT>segment = tm.connections.getSegment(protoSegment.cell,<EOL>protoSegment.idxOnCell)<EOL>tm.lastUsedIterationForSegment[segment.flatIdx] = (<EOL>long(protoSegment.number))<EOL><DEDENT>return tm<EOL>
Reads deserialized data from proto object.

:param proto: (DynamicStructBuilder) Proto object

:returns: (:class:TemporalMemory) TemporalMemory instance