| 20 | RaceNet::RaceNet() : net(layerParams, learningRate) {} |
| 21 | |
| 22 | vector<double> RaceNet::Infer(vector<double> raycastInputs) { |
| 23 | // as the sigmoid function never reaches 0.0 nor 1.0 |
| 24 | // it can be a good idea to consider values greater than 0.9 as 1.0 and values smaller than 0.1 as 0.0 |
| 25 | // hence the step function. |
| 26 | Matrix<double> resultMatrix = net.computeOutput(raycastInputs);//.applyFunction(stepFunction); |
| 27 | std::vector<double> resultVector; |
| 28 | |
| 29 | resultVector.emplace_back(resultMatrix.get(0, 0)); |
| 30 | resultVector.emplace_back(resultMatrix.get(0, 1)); |
| 31 | resultVector.emplace_back(resultMatrix.get(0, 2)); |
| 32 | //resultVector.emplace_back(resultMatrix.get(0, 3)); |
| 33 | |
| 34 | return resultVector; |
| 35 | } |
no test coverage detected