Ejemplo n.º 1
0
 def initialize(self):
     Algorithm.initialize(self)
     # to store results
     # tridiagonal matrix coefficients
     self.alpha = np.zeros(self.maxiter + 1)
     self.beta = np.zeros(self.maxiter)
     self.vectors = np.zeros((self.maxiter + 1, self.n))
     self.w = np.zeros(self.n)
     # starting point
     self.vectors[0] = np.random.randn(self.n)
     self.vectors[0] /= np.sqrt(norm2(self.vectors[0]))
Ejemplo n.º 2
0
 def initialize(self):
     Algorithm.initialize(self)
     # to store results
     # tridiagonal matrix coefficients
     self.alpha = np.zeros(self.maxiter + 1)
     self.beta = np.zeros(self.maxiter)
     self.vectors = np.zeros((self.maxiter + 1, self.n))
     self.w = np.zeros(self.n)
     # starting point
     self.vectors[0] = np.random.randn(self.n)
     self.vectors[0] /= np.sqrt(norm2(self.vectors[0]))
Ejemplo n.º 3
0
 def update_gradient_norm(self):
     self.last_gradient_norm = copy(self.current_gradient_norm)
     self.current_gradient_norm = norm2(self.current_gradient)
Ejemplo n.º 4
0
 def update_beta(self):
     self.beta[self.iter_] = np.sqrt(norm2(self.w))
Ejemplo n.º 5
0
 def update_beta(self):
     self.beta[self.iter_] = np.sqrt(norm2(self.w))