In HTM.Java's real code, and in the NetworkConsistencyTest just written because of this issue - I store the previous predictions and use those to compare to the current active columns.
This QuickTest.py file was written a year ago before the time I had the "epiphany" about what I was doing wrong in the Network API with the inputs and output.
Sorry, I overlooked this. However the **current / real ** code doesn't have this oversight. I was hoping it did because that would account for the problems.
Even though I calculate the Anomaly after the call to TM.compute() - the Anomaly is being calculated on the previousPredictiveCells (converted to columns of course) which gets stored before the current call to TM.compute().
I will make the changes to QuickTest.py and QuickTest.Java (if they're there in that file) and then you can give it a "look-over" to see if they're correct.
Once again, HTM.Java stores the previous predictions and uses those in its Anomaly calculation here it is.