MCPcopy Create free account
hub / github.com/daniel-e/rustml / matrix

Method matrix

src/opt.rs:149–162  ·  view source on GitHub ↗

Creates a matrix from the intermediate parameters and values of the objective funciton after each iteration.

(&self)

Source from the content-addressed store, hash-verified

147 /// Creates a matrix from the intermediate parameters and
148 /// values of the objective funciton after each iteration.
149 pub fn matrix(&self) -> Matrix<T> {
150
151 if self.fvals.len() == 0 {
152 return Matrix::new();
153 }
154
155 let mut m: Matrix<T> = Matrix::new();
156 for &(ref v, f) in self.fvals.iter() {
157 let mut x = v.clone();
158 x.push(f);
159 m.add_row(&x);
160 }
161 m
162 }
163}
164
165/// Minimizes an objective using gradient descent.

Callers 1

mainFunction · 0.80

Calls 3

add_rowMethod · 0.80
lenMethod · 0.45
iterMethod · 0.45

Tested by

no test coverage detected