CTaxonomy is used to describe hierarchical structure between tasks.
在文件MultitaskKernelTreeNormalizer.h第141行定义。
公有成员 | |
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) |
保护属性 | |
CNode * | root |
std::map< std::string, int32_t > | name2id |
std::vector< CNode * > | nodes |
std::map< int32_t, float64_t > | task_histogram |
CTaxonomy | ( | ) |
default constructor
inserts additional node into taxonomy
parent_name | name of parent | |
child_name | name of child | |
beta | weight of child |
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 |
int32_t get_id | ( | std::string | name | ) |
int32_t get_id_by_name | ( | std::string | name | ) |
virtual const char* get_name | ( | ) | const [virtual] |
std::map<std::string, int32_t> get_name2id | ( | ) |
CNode* get_node | ( | int32_t | task_id | ) |
float64_t get_node_weight | ( | int32_t | idx | ) |
int32_t get_num_leaves | ( | ) |
int32_t get_num_nodes | ( | ) |
given two nodes, compute the intersection of their ancestors
node_lhs | node of left hand side | |
node_rhs | node of right hand side |
void set_node_weight | ( | int32_t | idx, | |
float64_t | weight | |||
) |
idx | node id | |
weight | weight to set |
void set_root_beta | ( | float64_t | beta | ) |
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 |
std::map<std::string, int32_t> name2id [protected] |
std::map<int32_t, float64_t> task_histogram [protected] |