122 tprintf(
"YMiddle: Proto=%g, Delta=%g, Var=%g, Dist=%g\n",
129 tprintf(
"Height: Proto=%g, Delta=%g, Var=%g, Dist=%g\n",
136 tprintf(
"Width: Proto=%g, Delta=%g, Var=%g\n",
144 tprintf(
"Total Dist=%g, scaled=%g, sigmoid=%g, penalty=%g\n",
149 if (Match < BestMatch)
183 NormAdj = NormAdj * NormAdj * NormAdj;
185 NormAdj = NormAdj * NormAdj;
188 return (1.0 / (1.0 + NormAdj));
210 for (i = 0, TotalMatch = 0.0; i < NumParams; i++) {
211 ParamMatch = (Feature->
Params[i] -
Mean(Proto, i)) /
214 fprintf (File,
" %6.1f", ParamMatch);
217 TotalMatch += ParamMatch * ParamMatch;
219 fprintf (File,
" --> %6.1f (%4.2f)\n",
255 const int kMaxLineSize = 100;
256 char line[kMaxLineSize];
257 while (fp->
FGets(line, kMaxLineSize) !=
nullptr) {
258 if (sscanf(line,
"%s %d", unichar, &NumProtos) != 2)
continue;
262 for (i = 0; i < NumProtos; i++)
266 tprintf(
"Error: unichar %s in normproto file is not in unichar set.\n",
268 for (i = 0; i < NumProtos; i++)
float ComputeNormMatch(CLASS_ID ClassId, const FEATURE_STRUCT &feature, bool DebugMatch)
NORM_PROTOS * ReadNormProtos(FILE *File)
double classify_norm_adj_curl
float StandardDeviation(PROTOTYPE *Proto, uint16_t Dimension)
#define double_VAR(name, val, comment)
void PrintNormMatch(FILE *File, int NumParams, PROTOTYPE *Proto, FEATURE Feature)
uint16_t ReadSampleSize(TFile *fp)
char * FGets(char *buffer, int buffer_size)
UNICHAR_ID unichar_to_id(const char *const unichar_repr) const
NORM_PROTOS * ReadNormProtos(TFile *fp)
void FreePrototype(void *arg)
void FreeProtoList(LIST *ProtoList)
PROTOTYPE * ReadPrototype(TFile *fp, uint16_t N)
bool contains_unichar(const char *const unichar_repr) const
LIST push_last(LIST list, void *item)
const double kWidthErrorWeighting
DLLSYM void tprintf(const char *format,...)
float Mean(PROTOTYPE *Proto, uint16_t Dimension)
const char * id_to_unichar(UNICHAR_ID id) const
double NormEvidenceOf(double NormAdj)
PARAM_DESC * ReadParamDesc(TFile *fp, uint16_t N)
double classify_norm_adj_midpoint