14 using namespace shogun;
32 void CMMDKernelSelectionComb::init()
61 SG_SDEBUG(
"CMMDKernelSelectionComb::print_state: libqp state:"
62 " primal=%f\n", state.QP);
106 SG_DEBUG(
"found at least one positive MMD\n")
114 SG_WARNING(
"CMMDKernelSelectionComb::solve_optimization(): all mmd "
115 "estimates are negative. This is techically possible, although "
116 "extremely rare. Consider using different kernels. "
117 "This combination will lead to a bad two-sample test. Since any"
118 "combination is bad, will now just return equally distributed "
127 SG_DEBUG(
"one MMD entry is positive, performing optimisation\n")
129 for (
index_t i=0; i<num_kernels; ++i)
137 weights[i]=1.0/sum_mmds;
141 SG_DEBUG(
"starting libqp optimization\n")
149 SG_DEBUG(
"libqp returns: nIts=%d, exit_flag: %d\n", qp_exitflag.nIter,
150 qp_exitflag.exitflag);
158 SG_DEBUG(
"lowcut: weight[%i]=%f<%f setting to zero\n", i, weights[i],
163 sum_weights+=weights[i];
168 weights[i]/=sum_weights;
176 SG_ERROR(
"CMMDKernelSelectionComb::select_kernel(): LAPACK needs to be "
177 "installed in order to use weight optimisation for combined "
184 SG_ERROR(
"CMMDKernelSelectionComb::select_kernel(): LAPACK needs to be "
185 "installed in order to use weight optimisation for combined "
193 SG_ERROR(
"CMMDKernelSelectionComb::solve_optimization(): LAPACK needs to be "
194 "installed in order to use weight optimisation for combined "
virtual CKernel * select_kernel()
virtual void set_subkernel_weights(SGVector< float64_t > weights)
virtual SGVector< float64_t > compute_measures()=0
virtual CKernel * get_kernel()
static SGMatrix< float64_t > m_Q
static const float64_t INFTY
infinity
virtual SGVector< float64_t > solve_optimization(SGVector< float64_t > mmds)
Base class for kernel selection for MMD-based two-sample test statistic implementations (e...
index_t m_opt_max_iterations
Kernel two sample test base class. Provides an interface for performing a two-sample test using a ker...
static void print_state(libqp_state_T state)
CMMDKernelSelectionComb()
The Combined kernel is used to combine a number of kernels into a single CombinedKernel object by lin...
static const float64_t * get_Q_col(uint32_t i)
void set_const(T const_elem)
virtual ~CMMDKernelSelectionComb()
CKernelTwoSampleTest * m_mmd