11 #ifndef _MULTITASKKERNELMASKNORMALIZER_H___
12 #define _MULTITASKKERNELMASKNORMALIZER_H___
55 std::vector<int32_t> task_rhs,
56 std::vector<int32_t> active_tasks_vec)
65 for (int32_t i = 0; i != (int32_t)(active_tasks_vec.size()); ++i)
95 if (std::string(k->
get_name()) ==
"WeightedDegree") {
96 SG_INFO(
"using first-element normalization\n")
99 SG_INFO(
"no inner normalization for non-WDK kernel\n")
141 SG_ERROR(
"normalize_lhs not implemented")
151 SG_ERROR(
"normalize_rhs not implemented")
168 for (int32_t i = 0; i != (int32_t)(vec.size()); ++i)
189 for (int32_t i = 0; i != (int32_t)(vec.size()); ++i)
217 if (lhs_is_in && rhs_is_in)
232 std::vector<int32_t> active_tasks_vec;
237 active_tasks_vec.push_back(*it);
240 return active_tasks_vec;
265 return "MultitaskKernelMaskNormalizer";
virtual const char * get_name() const =0
virtual float64_t normalize(float64_t value, int32_t idx_lhs, int32_t idx_rhs)
virtual float64_t compute(int32_t x, int32_t y)=0
The MultitaskKernel allows Multitask Learning via a modified kernel function.
virtual bool init(CKernel *k)
std::vector< int32_t > task_vector_rhs
void set_task_vector_lhs(std::vector< int32_t > vec)
void set_task_vector_rhs(std::vector< int32_t > vec)
#define SG_NOTIMPLEMENTED
CMultitaskKernelMaskNormalizer(std::vector< int32_t > task_lhs, std::vector< int32_t > task_rhs, std::vector< int32_t > active_tasks_vec)
float64_t get_similarity(int32_t task_lhs, int32_t task_rhs)
virtual const char * get_name() const
virtual int32_t get_num_vec_lhs()
virtual ~CMultitaskKernelMaskNormalizer()
std::vector< int32_t > get_task_vector_rhs() const
std::vector< int32_t > task_vector_lhs
std::set< int32_t > active_tasks
std::vector< int32_t > get_task_vector_lhs() const
The class Kernel Normalizer defines a function to post-process kernel values.
virtual int32_t get_num_vec_rhs()
CFeatures * rhs
feature vectors to occur on right hand side
all of classes and functions are contained in the shogun namespace
virtual float64_t normalize_rhs(float64_t value, int32_t idx_rhs)
CFeatures * lhs
feature vectors to occur on left hand side
The class Features is the base class of all feature objects.
void set_task_vector(std::vector< int32_t > vec)
CMultitaskKernelMaskNormalizer * KernelNormalizerToMultitaskKernelMaskNormalizer(CKernelNormalizer *n)
virtual float64_t normalize_lhs(float64_t value, int32_t idx_lhs)
float64_t set_normalization_constant(float64_t constant)
CMultitaskKernelMaskNormalizer()
std::vector< int32_t > get_active_tasks()
float64_t normalization_constant
float64_t get_normalization_constant() const