Adjust the weights of all the samples to be uniform in the given charset. Returns the number of samples in the iterator.
| 218 | // Adjust the weights of all the samples to be uniform in the given charset. |
| 219 | // Returns the number of samples in the iterator. |
| 220 | int SampleIterator::UniformSamples() { |
| 221 | int num_good_samples = 0; |
| 222 | for (Begin(); !AtEnd(); Next()) { |
| 223 | TrainingSample* sample = MutableSample(); |
| 224 | sample->set_weight(1.0); |
| 225 | ++num_good_samples; |
| 226 | } |
| 227 | NormalizeSamples(); |
| 228 | return num_good_samples; |
| 229 | } |
| 230 | |
| 231 | // Normalize the weights of all the samples in the charset_map so they sum |
| 232 | // to 1. Returns the minimum assigned sample weight. |
nothing calls this directly
no test coverage detected