CTaxonomy is used to describe hierarchical structure between tasks.
Definition at line 141 of file MultitaskKernelTreeNormalizer.h.
Public Member Functions | |
CTaxonomy () | |
CNode * | get_node (int32_t task_id) |
void | set_root_beta (float64_t beta) |
CNode * | add_node (std::string parent_name, std::string child_name, float64_t beta) |
int32_t | get_id (std::string name) |
std::set< CNode * > | intersect_root_path (CNode *node_lhs, CNode *node_rhs) |
float64_t | compute_node_similarity (int32_t task_lhs, int32_t task_rhs) |
void | update_task_histogram (std::vector< int32_t > task_vector_lhs) |
int32_t | get_num_nodes () |
int32_t | get_num_leaves () |
float64_t | get_node_weight (int32_t idx) |
void | set_node_weight (int32_t idx, float64_t weight) |
virtual const char * | get_name () const |
std::map< std::string, int32_t > | get_name2id () |
int32_t | get_id_by_name (std::string name) |
Protected Attributes | |
CNode * | root |
std::map< std::string, int32_t > | name2id |
std::vector< CNode * > | nodes |
std::map< int32_t, float64_t > | task_histogram |
CTaxonomy | ( | ) |
default constructor
Definition at line 148 of file MultitaskKernelTreeNormalizer.h.
inserts additional node into taxonomy
parent_name | name of parent | |
child_name | name of child | |
beta | weight of child |
Definition at line 178 of file MultitaskKernelTreeNormalizer.h.
float64_t compute_node_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 |
Definition at line 239 of file MultitaskKernelTreeNormalizer.h.
int32_t get_id | ( | std::string | name | ) |
translates name to id
name | name of task |
Definition at line 210 of file MultitaskKernelTreeNormalizer.h.
int32_t get_id_by_name | ( | std::string | name | ) |
translate name to id
name | node name |
Definition at line 343 of file MultitaskKernelTreeNormalizer.h.
virtual const char* get_name | ( | void | ) | const [virtual] |
Implements CSGObject.
Definition at line 328 of file MultitaskKernelTreeNormalizer.h.
std::map<std::string, int32_t> get_name2id | ( | ) |
Definition at line 334 of file MultitaskKernelTreeNormalizer.h.
CNode* get_node | ( | int32_t | task_id | ) |
task_id | task identifier |
Definition at line 161 of file MultitaskKernelTreeNormalizer.h.
float64_t get_node_weight | ( | int32_t | idx | ) |
Definition at line 311 of file MultitaskKernelTreeNormalizer.h.
int32_t get_num_leaves | ( | ) |
Definition at line 295 of file MultitaskKernelTreeNormalizer.h.
int32_t get_num_nodes | ( | ) |
Definition at line 289 of file MultitaskKernelTreeNormalizer.h.
given two nodes, compute the intersection of their ancestors
node_lhs | node of left hand side | |
node_rhs | node of right hand side |
Definition at line 219 of file MultitaskKernelTreeNormalizer.h.
void set_node_weight | ( | int32_t | idx, | |
float64_t | weight | |||
) |
idx | node id | |
weight | weight to set |
Definition at line 321 of file MultitaskKernelTreeNormalizer.h.
void set_root_beta | ( | float64_t | beta | ) |
set root weight
beta | weight |
Definition at line 168 of file MultitaskKernelTreeNormalizer.h.
void update_task_histogram | ( | std::vector< int32_t > | task_vector_lhs | ) |
keep track of how many elements each task has
task_vector_lhs | vector of task ids for examples |
Definition at line 262 of file MultitaskKernelTreeNormalizer.h.
std::map<std::string, int32_t> name2id [protected] |
Definition at line 352 of file MultitaskKernelTreeNormalizer.h.
Definition at line 353 of file MultitaskKernelTreeNormalizer.h.
Definition at line 351 of file MultitaskKernelTreeNormalizer.h.
std::map<int32_t, float64_t> task_histogram [protected] |
Definition at line 354 of file MultitaskKernelTreeNormalizer.h.