Skip to content
Snippets Groups Projects
Commit 7615f6e6 authored by asilador's avatar asilador
Browse files

Changed Beta value

parent c5f809e8
No related branches found
No related tags found
No related merge requests found
......@@ -32,7 +32,7 @@ def armijo(alpha0,Q,b,c,D,m):
#print('alpha is ', alpha)
s = 1.0
sigma = 1.0
beta = 1.0/2
beta = 1.0/3
while f(Q,b,c,x+np.transpose(beta**m*s*D)) < f(Q,b,c,x) + sigma*beta**m*s*(np.transpose(gradf(Q,b,x)))*np.transpose(D):
m+=1
#print('m is ', m)
......@@ -56,7 +56,7 @@ def grad_opt(epsilon,x,count,alpha):
D = -1*np.transpose(gradf(Q,b,x))/np.linalg.norm(gradf(Q,b,x))
#print('D is ', D)
alpha = armijo(alpha,Q,b,c,D,m)
print('alpha0 is ', alpha)
#print('alpha0 is ', alpha)
count += 1
if count%1000==0:
print 'f(x) is ', f(Q,b,c,x)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment