| 44 | } |
| 45 | |
| 46 | void Layer::store(std::ofstream *output) { |
| 47 | // All the neurons in the same layer have the same number of weights |
| 48 | // so that is stored once along with the number of neurons in the layer |
| 49 | // and the activation function name of the layer |
| 50 | *output << neurons.size() << " " << neurons[0].weights.size() << " " << getActivationFunctionName() << "\n"; |
| 51 | for (unsigned int a = 0; a < neurons.size(); a++) { |
| 52 | for (unsigned int b = 0; b < neurons[a].weights.size(); b++) { |
| 53 | *output << neurons[a].weights[b] << " "; |
| 54 | } |
| 55 | *output << "\n"; |
| 56 | } |
| 57 | } |
no test coverage detected