print "Done init" est = np.zeros((testDataObj.numImages)) gt = np.zeros((testDataObj.numImages)) #Allocate tensorflow object #This will build the graph tfObj = Supervised(params, trainDataObj.inputShape) assert(testDataObj.numImages % params["batchSize"] == 0) for i in range(testDataObj.numImages/params["batchSize"]): print i*params["batchSize"], "out of", testDataObj.numImages (inImage, inGt) = testDataObj.getData(params["batchSize"]) outVals = tfObj.evalModel(inImage, inGt = inGt, plot=False) tfObj.timestep += 1 v = np.argmax(outVals, axis=1) startIdx = i*batch endIdx = startIdx + params["batchSize"] est[startIdx:endIdx] = v gt[startIdx:endIdx] = inGt print "Done run" tfObj.closeSess() numCorrect = len(np.nonzero(est == gt)[0]) print "Accuracy: ", float(numCorrect)/testDataObj.numImages
'displayPeriod': 100, #Batch size 'batchSize': 4, #Learning rate for optimizer 'learningRate': 1e-4, 'numClasses': 10, 'epsilon': 1e-8, 'regularizer': 'none', 'regWeight': .3, #####ISTA PARAMS###### 'VStrideY': 2, 'VStrideX': 2, 'patchSizeX': 12, 'patchSizeY': 12, 'numV': 256, #####New encode parapms##### 'maxPool': True, #Controls max or avg pool 'preTrain': False, } #Allocate tensorflow object #This will build the graph tfObj = Supervised(params, trainDataObj) print("Done init") tfObj.runModel(trainDataObj, testDataObj=testDataObj, numTest=256) print("Done run") tfObj.closeSess()