diff --git a/dlib/svm/structural_svm_problem.h b/dlib/svm/structural_svm_problem.h index 0b9a95782..c94ed66fe 100644 --- a/dlib/svm/structural_svm_problem.h +++ b/dlib/svm/structural_svm_problem.h @@ -566,14 +566,12 @@ namespace dlib f = matrix_cast(reshape(rowm(m, range(idx, idx+size-1)), nr, nc)); svd3(f, u,w,v); - w = round_zeros(w, std::max(1e-9,max(w)*1e-7)); const double norm = sum(w); obj += strength*norm; nuclear_norm_part += strength*norm/C; - w = w>0; - f = u*diagm(w)*trans(v); + f = u*trans(v); set_rowm(grad, range(idx, idx+size-1)) = matrix_cast(strength*reshape_to_column_vector(f)); }