Skip to content

Commit

Permalink
Really proper way to handle W in OCAS SVM
Browse files Browse the repository at this point in the history
  • Loading branch information
lisitsyn committed Mar 22, 2017
1 parent b7b9dfe commit 48e7ed4
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/shogun/classifier/svm/SVMOcas.cpp
Expand Up @@ -275,7 +275,6 @@ int CSVMOcas::compute_output(float64_t *output, void* ptr)
CSVMOcas* o = (CSVMOcas*) ptr;
CDotFeatures* f=o->features;
int32_t nData=f->get_num_vectors();
SGVector<float64_t> w(o->get_w());

float64_t* y = o->lab.vector;

Expand All @@ -300,10 +299,9 @@ void CSVMOcas::compute_W(
void* ptr )
{
CSVMOcas* o = (CSVMOcas*) ptr;
SGVector<float64_t> w_vector(o->get_w());
uint32_t nDim= (uint32_t) w_vector.vlen;
CMath::swap(w_vector.vector, o->old_w);
float64_t* W=w_vector.vector;
uint32_t nDim= (uint32_t) o->current_w.vlen;
CMath::swap(o->current_w.vector, o->old_w);
float64_t* W=o->current_w.vector;
float64_t* oldW=o->old_w;
memset(W, 0, sizeof(float64_t)*nDim);
float64_t old_bias=o->bias;
Expand Down

0 comments on commit 48e7ed4

Please sign in to comment.