32 void CMMDKernelSelectionComb::init()
71 SG_SDEBUG(
"libqp state: primal=%f\n", state.QP);
102 SG_DEBUG(
"found at least one positive MMD\n")
110 SG_WARNING(
"All mmd estimates are negative. This is techically possible,"
111 "although extremely rare. Consider using different kernels. "
112 "This combination will lead to a bad two-sample test. Since any"
113 "combination is bad, will now just return equally distributed "
122 SG_DEBUG(
"one MMD entry is positive, performing optimisation\n")
124 for (
index_t i=0; i<num_kernels; ++i)
132 weights[i]=1.0/sum_mmds;
136 SG_DEBUG(
"starting libqp optimization\n")
144 SG_DEBUG(
"libqp returns: nIts=%d, exit_flag: %d\n", qp_exitflag.nIter,
145 qp_exitflag.exitflag);
153 SG_DEBUG(
"lowcut: weight[%i]=%f<%f setting to zero\n", i, weights[i],
158 sum_weights+=weights[i];
163 weights[i]/=sum_weights;
virtual CKernel * select_kernel()
virtual void set_subkernel_weights(SGVector< float64_t > weights)
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. Provides abstract methods for selecting kernels and computing criteria or kernel weights for the implemented method. In order to implement new methods for kernel selection, simply write a new implementation of this class.
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...
virtual SGVector< float64_t > compute_measures()=0
static const float64_t * get_Q_col(uint32_t i)
CKernelTwoSampleTest * m_estimator
all of classes and functions are contained in the shogun namespace
virtual ~CMMDKernelSelectionComb()
void set_const(T const_elem)