18 using namespace shogun;
34 SG_ERROR(
"CLinearTimeMMD: Only features with equal number of vectors "
35 "are currently possible\n");
46 SG_ERROR(
"CLinearTimeMMD: Only features with equal number of vectors "
47 "are currently possible\n");
56 void CLinearTimeMMD::init()
75 SG_DEBUG(
"entering CLinearTimeMMD::compute_statistic()\n");
105 SG_DEBUG(
"returning: 1/%d*(%f+%f-%f-%f)\n", m_2, pp, qq, pq, qp);
108 SG_DEBUG(
"leaving CLinearTimeMMD::compute_statistic()\n");
109 return 1.0/m_2*(pp+qq-pq-qp);
168 SG_WARNING(
"%s::compute_variance_estimate: The number of samples"
169 " should be very large (at least 1000) in order to get a"
170 " good Gaussian approximation using MMD1_GAUSSIAN.\n",
214 SG_ERROR(
"CLinearTimeMMD::optimize_kernel_weights(): Only possible "
215 "with a combined kernel!\n");
220 SG_ERROR(
"CLinearTimeMMD::optimize_kernel_weights(): Only possible "
221 "with combined features!\n");
234 SG_ERROR(
"CLinearTimeMMD::optimize_kernel_weights(): Only possible "
235 "when number of sub-kernels (%d) equal number of sub-features "
258 for (
index_t i=0; i<num_kernels; ++i)
264 pp=current->
kernel(j, m2+j);
268 hs(j, i)=pp+qq-pq-qp;
286 SG_DEBUG(
"regularizing matrix Q by adding %f to diagonal\n",
288 for (
index_t i=0; i<num_kernels; ++i)
320 SG_DEBUG(
"found at least one positive MMD\n");
329 SG_WARNING(
"All mmd estimates are negative. This is techical possible,"
330 " although extremely rare. Current problem might bad\n");
333 for (
index_t i=0; i<num_kernels*num_kernels; ++i)
338 for (
index_t i=0; i<num_kernels; ++i)
350 SG_DEBUG(
"starting libqp optimization\n");
358 SG_DEBUG(
"libqp returns: nIts=%d, exit_flag: %d\n", qp_exitflag.nIter,
359 qp_exitflag.exitflag);
367 SG_DEBUG(
"lowcut: weight[%i]=%f<%f; setting to zero\n", i, x[i],
392 SG_SDEBUG(
"libqp state: primal=%f\n", state.QP);