src/wordrec/params_model.cpp
float ParamsModel::ComputeCost(const float features[]) const {
  float unnorm_score = 0.0;
  for (int f = 0; f < PTRAIN_NUM_FEATURE_TYPES; ++f) {
    unnorm_score += weights_vec_[pass_][f] * features[f];
  }
  return ClipToRange(-unnorm_score / kScoreScaleFactor, kMinFinalCost, kMaxFinalCost);
}
// Applies params model weights to the given features.
// Assumes that features is an array of size PTRAIN_NUM_FEATURE_TYPES.
// The cost is set to a number that can be multiplied by the outline length,
// as with the old ratings scheme. This enables words of different length
// and combinations of words to be compared meaningfully.
Applies params model weights to the given features.
Assumes that features is an array of size PTRAIN_NUM_FEATURE_TYPES.
The cost is set to a number that can be multiplied by the outline length,
as with the old ratings scheme. This enables words of different length
and combinations of words to be compared meaningfully.
Applies params model weights to the given features . Assumes that features is an array of size PTRAIN_NUM_FEATURE_TYPES . The cost is set to a number that can be multiplied by the outline length as with the old ratings scheme . This enables words of different length and combinations of words to be compared meaningfully .
float ParamsModel::ComputeCost(const float features[]) const {
  float unnorm_score = 0.0;
  for (int f = 0; f < PTRAIN_NUM_FEATURE_TYPES; ++f) {
    unnorm_score += weights_vec_[pass_][f] * features[f];
  }
  return ClipToRange(-unnorm_score / kScoreScaleFactor, kMinFinalCost, kMaxFinalCost);
}
float ParamsModel :: ComputeCost ( const float features [ ] ) const { float unnorm_score = 0.0 ; for ( int f = 0 ; f < PTRAIN_NUM_FEATURE_TYPES ; ++ f ) { unnorm_score += weights_vec_ [ pass_ ] [ f ] * features [ f ] ; } return ClipToRange ( - unnorm_score / kScoreScaleFactor , kMinFinalCost , kMaxFinalCost ) ; }
Applies params model weights to the given features.
Applies params model weights to the given features .