Updates the parameters of the network. Each matrix in `deltas` is added to the corresponding matrix of parameters of the network, i.e. the first matrix which contains the parameters from the first layer to the second layer, the second matrix is added to the parameters which contains the parameters from the second layer to the third layer and so on.
(&mut self, deltas: &[Matrix<f64>])
| 222 | /// the second matrix is added to the parameters which contains the |
| 223 | /// parameters from the second layer to the third layer and so on. |
| 224 | pub fn update_params(&mut self, deltas: &[Matrix<f64>]) { |
| 225 | |
| 226 | assert!(self.params.len() == deltas.len(), "Dimensions do not match."); |
| 227 | for i in (0..self.params.len()) { |
| 228 | self.params[i].iadd(&deltas[i]); |
| 229 | } |
| 230 | } |
| 231 | |
| 232 | /// Returns the parameters of the network. |
| 233 | pub fn params(&self) -> Vec<Matrix<f64>> { |