Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fixes for MC OCAS
  • Loading branch information
lisitsyn committed Mar 8, 2012
1 parent ec86ec8 commit 229943e
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/shogun/classifier/svm/libocas.cpp
Expand Up @@ -1016,7 +1016,8 @@ ocas_return_value_T msvm_ocas_solver(
float64_t xi, sq_norm_W, QPSolverTolRel, QPSolverTolAbs, dot_prod_WoldW, sq_norm_oldW;
float64_t A0, B0, t, t1, t2, R, tmp, element_b, x;
float64_t *A, *B, *theta, *Theta, *sortedA, *Add;
float64_t start_time, ocas_start_time, grad_sum, grad, min_x = 0, old_x, old_grad;
float64_t start_time = 0.0, ocas_start_time = 0.0, grad_sum = 0.0;
float64_t grad = 0.0, min_x = 0.0, old_x = 0.0, old_grad = 0.0;
uint32_t i, y, y2, ypred = 0, *new_cut, cnt1, cnt2, j, nSortedA, idx;
uint32_t *I;
uint8_t S = 1;
Expand Down Expand Up @@ -1169,7 +1170,7 @@ ocas_return_value_T msvm_ocas_solver(
/* initial cutting plane */
for(i=0; i < nData; i++)
{
y2 = (uint32_t)data_y[i]-1;
y2 = (uint32_t)data_y[i];

if(y2 > 0)
new_cut[i] = 0;
Expand Down Expand Up @@ -1252,7 +1253,7 @@ ocas_return_value_T msvm_ocas_solver(
/* new_cut[i] = argmax_i ( [[y != y_i]] + (w_y- w_y_i)'*x_i ) */
for(i=0; i < nData; i++)
{
y2 = (uint32_t)data_y[i]-1;
y2 = (uint32_t)data_y[i];

for(xi=-LIBOCAS_PLUS_INF, y=0; y < nY; y++)
{
Expand Down Expand Up @@ -1304,7 +1305,7 @@ ocas_return_value_T msvm_ocas_solver(

for(i=0; i < nData; i++)
{
y2 = (uint32_t)data_y[i]-1;
y2 = (uint32_t)data_y[i];

for(y=0; y < nY; y++)
{
Expand Down Expand Up @@ -1402,7 +1403,7 @@ ocas_return_value_T msvm_ocas_solver(
/* new_cut[i] = argmax_i ( [[y != y_i]] + (w_y- w_y_i)'*x_i ) */
for(i=0; i < nData; i++)
{
y2 = (uint32_t)data_y[i]-1;
y2 = (uint32_t)data_y[i];

for(xi=-LIBOCAS_PLUS_INF, y=0; y < nY; y++)
{
Expand Down Expand Up @@ -1430,7 +1431,7 @@ ocas_return_value_T msvm_ocas_solver(
R = 0;
for(i=0; i < nData; i++)
{
y2 = (uint32_t)data_y[i]-1;
y2 = (uint32_t)data_y[i];

for(tmp=-LIBOCAS_PLUS_INF, y=0; y < nY; y++)
{
Expand Down

0 comments on commit 229943e

Please sign in to comment.