Skip to content

Commit

Permalink
Made inner iterations of malsar ported code safe
Browse files Browse the repository at this point in the history
  • Loading branch information
lisitsyn committed Jul 17, 2012
1 parent b39de77 commit 48a7858
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/shogun/lib/slep/malsar_joint_feature_learning.cpp
Expand Up @@ -97,8 +97,9 @@ slep_result_t malsar_joint_feature_learning(

double Fzp = 0.0;

int inner_iter = 0;
// line search, Armijo-Goldstein scheme
while (true)
while (inner_iter <= 1000)
{
// compute lasso projection of Ws - gWs/gamma
for (task=0; task<n_tasks; task++)
Expand All @@ -109,6 +110,7 @@ slep_result_t malsar_joint_feature_learning(
}
// walk in direction of antigradient
Czp = Cs - gCs/gamma;
std::cout << Czp;

// compute objective at line search point
Fzp = 0.0;
Expand Down Expand Up @@ -151,6 +153,8 @@ slep_result_t malsar_joint_feature_learning(
break;
else
gamma *= gamma_inc;

inner_iter++;
}

Wz_old = Wz;
Expand Down
3 changes: 2 additions & 1 deletion src/shogun/lib/slep/malsar_low_rank.cpp
Expand Up @@ -96,8 +96,9 @@ slep_result_t malsar_low_rank(

double Fzp = 0.0;

int inner_iter = 0;
// line search, Armijo-Goldstein scheme
while (true)
while (inner_iter <= 1000)
{
// compute trace projection of Ws - gWs/gamma with 2*rho/gamma
internal::set_is_malloc_allowed(true);
Expand Down

0 comments on commit 48a7858

Please sign in to comment.