11 #ifndef _MULTITASKKERNELMASKPAIRNORMALIZER_H___
12 #define _MULTITASKKERNELMASKPAIRNORMALIZER_H___
48 std::vector<std::pair<int32_t, int32_t> > active_pairs_) :
81 if (std::string(k->
get_name()) ==
"WeightedDegree") {
82 SG_INFO(
"using first-element normalization\n")
85 SG_INFO(
"no inner normalization for non-WDK kernel\n")
127 SG_ERROR(
"normalize_lhs not implemented")
137 SG_ERROR(
"normalize_rhs not implemented")
154 for (int32_t i = 0; i != (int32_t)(vec.size()); ++i)
175 for (int32_t i = 0; i != (int32_t)(vec.size()); ++i)
200 for (int32_t i=0; i!=
static_cast<int>(
active_pairs.size()); i++)
205 if ((block.first==task_lhs && block.second==task_rhs) ||
206 (block.first==task_rhs && block.second==task_lhs))
243 return "MultitaskKernelMaskPairNormalizer";
virtual const char * get_name() const =0
std::vector< int32_t > task_vector_lhs
virtual float64_t compute(int32_t x, int32_t y)=0
float64_t get_similarity(int32_t task_lhs, int32_t task_rhs)
std::vector< std::pair< int32_t, int32_t > > active_pairs
float64_t set_normalization_constant(float64_t constant)
#define SG_NOTIMPLEMENTED
virtual float64_t normalize_rhs(float64_t value, int32_t idx_rhs)
std::vector< int32_t > get_task_vector_lhs() const
virtual bool init(CKernel *k)
virtual int32_t get_num_vec_lhs()
CMultitaskKernelMaskPairNormalizer()
CMultitaskKernelMaskPairNormalizer * KernelNormalizerToMultitaskKernelMaskPairNormalizer(CKernelNormalizer *n)
virtual float64_t normalize_lhs(float64_t value, int32_t idx_lhs)
CMultitaskKernelMaskPairNormalizer(std::vector< int32_t > task_vector_, std::vector< std::pair< int32_t, int32_t > > active_pairs_)
std::vector< int32_t > task_vector_rhs
float64_t get_normalization_constant() const
void set_task_vector_rhs(std::vector< int32_t > vec)
std::vector< std::pair< int32_t, int32_t > > get_active_pairs()
The MultitaskKernel allows Multitask Learning via a modified kernel function.
virtual ~CMultitaskKernelMaskPairNormalizer()
The class Kernel Normalizer defines a function to post-process kernel values.
void set_task_vector_lhs(std::vector< int32_t > vec)
virtual int32_t get_num_vec_rhs()
float64_t normalization_constant
CFeatures * rhs
feature vectors to occur on right hand side
all of classes and functions are contained in the shogun namespace
CFeatures * lhs
feature vectors to occur on left hand side
virtual float64_t normalize(float64_t value, int32_t idx_lhs, int32_t idx_rhs)
std::vector< int32_t > get_task_vector_rhs() const
The class Features is the base class of all feature objects.
virtual const char * get_name() const
Block< Matrix > block(Matrix matrix, index_t row_begin, index_t col_begin, index_t row_size, index_t col_size)
void set_task_vector(std::vector< int32_t > vec)