11 #ifndef _MULTITASKKERNELMASKNORMALIZER_H___
12 #define _MULTITASKKERNELMASKNORMALIZER_H___
52 std::vector<int32_t> task_rhs,
53 std::vector<int32_t> active_tasks_vec)
62 for (int32_t i = 0; i != (int32_t)(active_tasks_vec.size()); ++i)
92 if (std::string(k->
get_name()) ==
"WeightedDegree") {
93 SG_INFO(
"using first-element normalization\n");
96 SG_INFO(
"no inner normalization for non-WDK kernel\n");
138 SG_ERROR(
"normalize_lhs not implemented");
148 SG_ERROR(
"normalize_rhs not implemented");
165 for (int32_t i = 0; i != (int32_t)(vec.size()); ++i)
186 for (int32_t i = 0; i != (int32_t)(vec.size()); ++i)
214 if (lhs_is_in && rhs_is_in)
229 std::vector<int32_t> active_tasks_vec;
234 active_tasks_vec.push_back(*it);
237 return active_tasks_vec;
262 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
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