| 89 | } |
| 90 | |
| 91 | void NeuralNet::setWeights(std::vector<double> w) { |
| 92 | unsigned int counter = 0; |
| 93 | for(unsigned int a = 0; a < net.size(); a++) { |
| 94 | for(unsigned int b = 0; b < net[a].neurons.size(); b++) { |
| 95 | for(unsigned int c = 0; c < net[a].neurons[b].weights.size(); c++) { |
| 96 | net[a].neurons[b].weights[c] = w[counter]; |
| 97 | counter++; |
| 98 | } |
| 99 | } |
| 100 | } |
| 101 | if(counter != w.size()) { |
| 102 | std::cout << "Not the right number of weights\n"; |
| 103 | throw 1; |
| 104 | } |
| 105 | } |
| 106 | |
| 107 | void NeuralNet::setWeights3D(std::vector< std::vector< std::vector<double> > > w) { |
| 108 | for(unsigned int a = 0; a < net.size(); a++) { |