Skip to content

Commit

Permalink
check diff at the beginning of local smo
Browse files Browse the repository at this point in the history
  • Loading branch information
shijiashuai committed Nov 23, 2017
1 parent a8930a5 commit 9ea1a87
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/thundersvm/kernel/smo_kernel.cu
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
#include <thrust/sort.h>
#include <thrust/system/cuda/detail/par.h>
#include "thundersvm/kernel/smo_kernel.h"
#include <config.h>

#ifdef USE_CUDA
namespace svm_kernel {
Expand Down Expand Up @@ -74,14 +73,14 @@ namespace svm_kernel {
float local_diff = low_value - up_value;
if (numOfIter == 0) {
local_eps = max(eps, 0.1f * local_diff);
if (tid == 0) {
diff[0] = local_diff;
}
}

if (local_diff < local_eps) {
alpha[wsi] = a;
alpha_diff[tid] = -(a - aold) * y;
if (tid == 0) {
diff[0] = local_diff;
}
break;
}
__syncthreads();
Expand Down

0 comments on commit 9ea1a87

Please sign in to comment.