The MultitaskKernel allows Multitask Learning via a modified kernel function.
The user defines a set of active tasks. Subsequently, only similarities between active tasks are taken into account. Kernel entries between tasks of which at least one is not an active tasks are set to zero.
在文件MultitaskKernelMaskNormalizer.h第32行定义。
公有成员 | |
CMultitaskKernelMaskNormalizer () | |
CMultitaskKernelMaskNormalizer (std::vector< int32_t > task_lhs, std::vector< int32_t > task_rhs, std::vector< int32_t > active_tasks_vec) | |
virtual | ~CMultitaskKernelMaskNormalizer () |
virtual bool | init (CKernel *k) |
virtual float64_t | normalize (float64_t value, int32_t idx_lhs, int32_t idx_rhs) |
virtual float64_t | normalize_lhs (float64_t value, int32_t idx_lhs) |
virtual float64_t | normalize_rhs (float64_t value, int32_t idx_rhs) |
std::vector< int32_t > | get_task_vector_lhs () const |
void | set_task_vector_lhs (std::vector< int32_t > vec) |
std::vector< int32_t > | get_task_vector_rhs () const |
void | set_task_vector_rhs (std::vector< int32_t > vec) |
void | set_task_vector (std::vector< int32_t > vec) |
float64_t | get_similarity (int32_t task_lhs, int32_t task_rhs) |
std::vector< int32_t > | get_active_tasks () |
float64_t | get_normalization_constant () const |
float64_t | set_normalization_constant (float64_t constant) |
virtual const char * | get_name () const |
保护属性 | |
std::set< int32_t > | active_tasks |
std::vector< int32_t > | task_vector_lhs |
std::vector< int32_t > | task_vector_rhs |
float64_t | scale |
float64_t | normalization_constant |
default constructor
CMultitaskKernelMaskNormalizer | ( | std::vector< int32_t > | task_lhs, | |
std::vector< int32_t > | task_rhs, | |||
std::vector< int32_t > | active_tasks_vec | |||
) |
default constructor
task_lhs | task vector with containing task_id for each example for left hand side | |
task_rhs | task vector with containing task_id for each example for right hand side |
virtual ~CMultitaskKernelMaskNormalizer | ( | ) | [virtual] |
default destructor
std::vector<int32_t> get_active_tasks | ( | ) |
virtual const char* get_name | ( | ) | const [virtual] |
float64_t get_normalization_constant | ( | ) | const |
float64_t get_similarity | ( | int32_t | task_lhs, | |
int32_t | task_rhs | |||
) |
task_lhs | task_id on left hand side | |
task_rhs | task_id on right hand side |
std::vector<int32_t> get_task_vector_lhs | ( | ) | const |
std::vector<int32_t> get_task_vector_rhs | ( | ) | const |
virtual bool init | ( | CKernel * | k | ) | [virtual] |
initialization of the normalizer
k | kernel |
normalize the kernel value
value | kernel value | |
idx_lhs | index of left hand side vector | |
idx_rhs | index of right hand side vector |
normalize only the left hand side vector
value | value of a component of the left hand side feature vector | |
idx_lhs | index of left hand side vector |
normalize only the right hand side vector
value | value of a component of the right hand side feature vector | |
idx_rhs | index of right hand side vector |
constant | normalization constant |
void set_task_vector | ( | std::vector< int32_t > | vec | ) |
vec | task vector with containing task_id for each example |
void set_task_vector_lhs | ( | std::vector< int32_t > | vec | ) |
vec | task vector with containing task_id for each example |
void set_task_vector_rhs | ( | std::vector< int32_t > | vec | ) |
vec | task vector with containing task_id for each example |
std::set<int32_t> active_tasks [protected] |
list of active tasks
float64_t normalization_constant [protected] |
outer normalization constant
value of first element
std::vector<int32_t> task_vector_lhs [protected] |
task vector indicating to which task each example on the left hand side belongs
std::vector<int32_t> task_vector_rhs [protected] |
task vector indicating to which task each example on the right hand side belongs