Forward Computing of the best individual.
| 198 | |
| 199 | // Forward Computing of the best individual. |
| 200 | std::vector<float> Lycoris::compute(std::vector<float> &input) { |
| 201 | if (input.size() != inputNum) { |
| 202 | std::cout << "The input data is not proper!" << std::endl; |
| 203 | exit(6); |
| 204 | } |
| 205 | |
| 206 | checkFirstRun(); |
| 207 | |
| 208 | float output[outputNum]; |
| 209 | best->forward(input, output); |
| 210 | |
| 211 | if (args->mode == "classify") { |
| 212 | LycorisUtils::softmax(output, outputNum); |
| 213 | } |
| 214 | |
| 215 | std::vector<float> ret(output, output + outputNum); |
| 216 | return ret; |
| 217 | } |
| 218 | |
| 219 | // Parallel forward Computing of the best individual. |
| 220 | std::vector<std::vector<float> > Lycoris::computeBatch(std::vector<std::vector<float> > &input) { |