b9fc4e3a1b9dc019640164b57d49ecba56364bfa,src/main.py,,validate,#,85

Before Change


def validate(filePath):
	"validate NN"
	// load training data
	loader = DataLoader(filePath, Model.batchSize, Model.imgSize, Model.maxTextLen)

	// create TF model
	model = Model(loader.charList, useBeamSearch)

	// save characters of model for inference mode
	open(fnCharList, "w").write(str().join(loader.charList))

After Change


			dist = editdistance.eval(recognized[i], batch.gtTexts[i])
			numErr += dist
			numTotal += len(batch.gtTexts[i])
			print("[OK]" if dist==0 else "[ERR:%d]" % dist,""" + batch.gtTexts[i] + """, "->", """ + recognized[i] + """)
	
	// print validation result
	charErrorRate = numErr / numTotal
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: githubharald/SimpleHTR
Commit Name: b9fc4e3a1b9dc019640164b57d49ecba56364bfa
Time: 2018-08-16
Author: harald_scheidl@hotmail.com
File Name: src/main.py
Class Name:
Method Name: validate


Project Name: jadore801120/attention-is-all-you-need-pytorch
Commit Name: 15b19130a9162feb9153a2f38c5c8b0af02c6a1d
Time: 2018-08-21
Author: yhhuang@nlg.csie.ntu.edu.tw
File Name: train.py
Class Name:
Method Name: main


Project Name: gpleiss/efficient_densenet_pytorch
Commit Name: b0a156d87b736d90c3e27933e8e4d0114bd5ef36
Time: 2019-01-27
Author: gpleiss@gmail.com
File Name: demo.py
Class Name:
Method Name: train