def basicTest(self):
<EOL>tm = BacktrackingTMCPP(numberOfCols=<NUM_LIT:10>, cellsPerColumn=<NUM_LIT:3>,<EOL>initialPerm=<NUM_LIT>, connectedPerm= <NUM_LIT>,<EOL>minThreshold=<NUM_LIT:2>, newSynapseCount=<NUM_LIT:5>,<EOL>permanenceInc=<NUM_LIT>, permanenceDec= <NUM_LIT>,<EOL>permanenceMax=<NUM_LIT:1>, globalDecay=<NUM_LIT>,<EOL>activationThreshold=<NUM_LIT:4>, doPooling=False,<EOL>segUpdateValidDuration=<NUM_LIT:5>, seed=SEED,<EOL>verbosity=VERBOSITY)<EOL>tm.retrieveLearningStates = True<EOL>tm.makeCells4Ephemeral = False<EOL>pickle.dump(tm, open("<STR_LIT>", "<STR_LIT:wb>"))<EOL>tm2 = pickle.load(open("<STR_LIT>"))<EOL>self.assertTrue(fdrutils.tmDiff2(tm, tm2, VERBOSITY, checkStates=False))<EOL>for i in range(<NUM_LIT:5>):<EOL><INDENT>x = numpy.zeros(tm.numberOfCols, dtype='<STR_LIT>')<EOL>_RGEN.initializeUInt32Array(x, <NUM_LIT:2>)<EOL>tm.learn(x)<EOL><DEDENT>tm.reset()<EOL>tm.makeCells4Ephemeral = False<EOL>pickle.dump(tm, open("<STR_LIT>", "<STR_LIT:wb>"))<EOL>tm2 = pickle.load(open("<STR_LIT>"))<EOL>self.assertTrue(fdrutils.tmDiff2(tm, tm2, VERBOSITY))<EOL>patterns = numpy.zeros((<NUM_LIT:4>, tm.numberOfCols), dtype='<STR_LIT>')<EOL>for i in range(<NUM_LIT:4>):<EOL><INDENT>_RGEN.initializeUInt32Array(patterns[i], <NUM_LIT:2>)<EOL><DEDENT>for i in range(<NUM_LIT:10>):<EOL><INDENT>x = numpy.zeros(tm.numberOfCols, dtype='<STR_LIT>')<EOL>_RGEN.initializeUInt32Array(x, <NUM_LIT:2>)<EOL>tm.infer(x)<EOL>if i > <NUM_LIT:0>:<EOL><INDENT>tm._checkPrediction(patterns)<EOL><DEDENT><DEDENT>
Basic test (creation, pickling, basic run of learning and inference)