* classifies a charsamp and returns an alternate list * of chars sorted by char costs */
| 185 | * of chars sorted by char costs |
| 186 | */ |
| 187 | CharAltList *ConvNetCharClassifier::Classify(CharSamp *char_samp) { |
| 188 | // run the needed nets |
| 189 | if (RunNets(char_samp) == false) { |
| 190 | return NULL; |
| 191 | } |
| 192 | |
| 193 | int class_cnt = char_set_->ClassCount(); |
| 194 | |
| 195 | // create an altlist |
| 196 | CharAltList *alt_list = new CharAltList(char_set_, class_cnt); |
| 197 | |
| 198 | for (int out = 1; out < class_cnt; out++) { |
| 199 | int cost = CubeUtils::Prob2Cost(net_output_[out]); |
| 200 | alt_list->Insert(out, cost); |
| 201 | } |
| 202 | |
| 203 | return alt_list; |
| 204 | } |
| 205 | |
| 206 | /** |
| 207 | * Set an external net (for training purposes) |
no test coverage detected