######################## ## PLOT WEIGHTS ######################## #L1Dat = None #arborIdx = np.arange(0,4) arborIdx = None i_frame = -1 # index, not actual frame number, -1 for last margin = 2 #pixels plotColor = True showPlot = False savePlot = True saveName = output_dir+'analysis/'+weights_chk[:-4]+'.png' weight_list = pw.plotWeights(weightChkDat,L1Dat,arborIdx,i_frame,margin,plotColor,showPlot,savePlot,saveName) #plotColor = True #showPlot = True #savePlot = True #saveName = output_dir+'analysis/'+weights_chk[:-4]+'_sorted.png' # #sorted_weight_list = pw.plotSortedWeights(weight_list,L1Dat,plotColor,showPlot,savePlot,saveName) # ######################## ## CLOSE FILESTREAMS ######################## #input_activityFile.close() #l1_activityFile.close() #err_activityFile.close()
#(L1Struct,L1Hdr) = pv.get_pvp_data(l1_activityFile,progressPeriod,lastFrame,startFrame,skipFrames) # Gar Method # divide the L2 norm of the residual by the L2 of the input to the # residiual (i.e the image) to get % error #TODO: pass param for error method, there are 3 that I know of. Gar method, pSNR, SNR #print('Err:') #(errStruct,errHdr) = pv.get_pvp_data(err_activityFile,progressPeriod,lastFrame,startFrame,skipFrames) #Recon error? # ABS gives distance from 0. # Averaging over the 512x512 array gives err per frame #plt.plot(np.average(np.average(np.abs(err_outStruct["values"]),2),2)) #plt.show() print('Weights:') (weightStruct,weightsHdr) = pv.get_pvp_data(weightsFile,progressPeriod,lastFrame,startFrame,skipFrames) #l1_activityFile.close() #err_activityFile.close() weightsFile.close() i_arbor = 0 i_frame = 1 # index, not actual frame number margin = 2 #pixels showPlot = True savePlot = True saveName = output_dir+'analysis/'+weights[:-4]+'_'+str(i_frame).zfill(5)+'.png' weight_mat = pw.plotWeights(weightStruct,i_arbor,i_frame,margin,showPlot,savePlot,saveName)
# divide the L2 norm of the residual by the L2 of the input to the # residiual (i.e the image) to get % error #TODO: pass param for error method, there are 3 that I know of. Gar method, pSNR, SNR #print('Err:') #(errStruct,errHdr) = pv.get_pvp_data(err_activityFile,progressPeriod,lastFrame,startFrame,skipFrames) #Recon error? # ABS gives distance from 0. # Averaging over the 512x512 array gives err per frame #plt.plot(np.average(np.average(np.abs(err_outStruct["values"]),2),2)) #plt.show() print('Weights:') (weightStruct, weightsHdr) = pv.get_pvp_data(weightsFile, progressPeriod, lastFrame, startFrame, skipFrames) #l1_activityFile.close() #err_activityFile.close() weightsFile.close() i_arbor = 0 i_frame = 1 # index, not actual frame number margin = 2 #pixels showPlot = True savePlot = True saveName = output_dir + 'analysis/' + weights[:-4] + '_' + str(i_frame).zfill( 5) + '.png' weight_mat = pw.plotWeights(weightStruct, i_arbor, i_frame, margin, showPlot, savePlot, saveName)
#percErr = pe.plotPercErr(inputDat,reconDat,showPlot,savePlot,'./percTest.png') ######################## ## PLOT WEIGHTS ######################## #L1Dat = None #arborIdx = np.arange(0,4) arborIdx = None i_frame = -1 # index, not actual frame number, -1 for last margin = 2 #pixels plotColor = True showPlot = False savePlot = True saveName = output_dir + 'analysis/' + weights_chk[:-4] + '.png' weight_list = pw.plotWeights(weightChkDat, L1Dat, arborIdx, i_frame, margin, plotColor, showPlot, savePlot, saveName) #plotColor = True #showPlot = True #savePlot = True #saveName = output_dir+'analysis/'+weights_chk[:-4]+'_sorted.png' # #sorted_weight_list = pw.plotSortedWeights(weight_list,L1Dat,plotColor,showPlot,savePlot,saveName) # ######################## ## CLOSE FILESTREAMS ######################## #input_activityFile.close() #l1_activityFile.close() #err_activityFile.close()