| 64 | } |
| 65 | |
| 66 | void Network::printToFile(Matrix<double> &m, std::ofstream &file) { |
| 67 | int h = m.getHeight(); |
| 68 | int w = m.getWidth(); |
| 69 | |
| 70 | file << h << std::endl; |
| 71 | file << w << std::endl; |
| 72 | for (int i = 0; i < h; i++) { |
| 73 | for (int j = 0; j < w; j++) { |
| 74 | file << m.get(i, j) << (j != w - 1 ? " " : ""); |
| 75 | } |
| 76 | file << std::endl; |
| 77 | } |
| 78 | } |
| 79 | |
| 80 | void Network::saveNetworkParams(const char *filepath) { |
| 81 | std::ofstream out(filepath); |