| 78 | } |
| 79 | |
| 80 | void Network::saveNetworkParams(const char *filepath) { |
| 81 | std::ofstream out(filepath); |
| 82 | |
| 83 | out << hiddenLayersCount << std::endl; |
| 84 | out << learningRate << std::endl; |
| 85 | |
| 86 | for (Matrix<double> m : W) { |
| 87 | printToFile(m, out); |
| 88 | } |
| 89 | |
| 90 | for (Matrix<double> m : B) { |
| 91 | printToFile(m, out); |
| 92 | } |
| 93 | |
| 94 | out.close(); |
| 95 | } |
| 96 | |
| 97 | void Network::loadNetworkParams(const char *filepath) { |
| 98 | std::ifstream in(filepath); |