24 #ifndef SRC_RUNTIME_CL_MLGO_HEURISTIC_TREE_H 25 #define SRC_RUNTIME_CL_MLGO_HEURISTIC_TREE_H 72 using Index = std::tuple<HeuristicType, std::string, DataType>;
81 virtual ~
Node() =
default;
87 : id{
id },
condition{ cond }, true_node{ t_node }, false_node{ f_node }
92 return NodeType::Branch;
100 template <
typename T>
104 : id{
id }, value{ val }
109 return NodeType::Leaf;
136 template <
typename T>
146 template <
typename T>
147 bool add_leaf(
NodeID id, T leaf_value);
171 return std::make_tuple(_heuristic_type, _ip_target, _data_type);
180 static constexpr
size_t _max_query_depth{ 1000 };
181 static constexpr
size_t _max_num_nodes{ 100000 };
182 static constexpr
NodeID _root{ 0 };
185 bool check_if_structurally_correct()
const;
190 std::string _ip_target;
192 std::map<NodeID, std::unique_ptr<Node>> _tree;
198 #endif //SRC_RUNTIME_CL_MLGO_HEURISTIC_TREE_H
LeafNode(NodeID id, T val)
float threshold
Threshold value.
Condition condition(TokenStream &in, bool &valid)
unsigned int n
Number of columns for the rhs matrix.
unsigned int m
Number of rows for the lhs matrix.
std::tuple< HeuristicType, std::string, DataType > Index
decltype(strategy::transforms) typedef type
unsigned int k
Number of rows for the rhs matrix.
HeuristicType
Types of Heuristic (tree)
Copyright (c) 2017-2021 Arm Limited.
ConditionalOp
Conditional ops.
Greater than or equal to.
unsigned int b
Batch size.
BranchNode(NodeID id, Condition cond, NodeID t_node, NodeID f_node)
A binary decision tree based heuristic.
NodeType type() const override
MLGOHeuristics mlgo(TokenStream &in, bool &valid)
A branch condition expression evaluating: feature op threshold.
Index index() const
Get tree index.
GEMM Shape used for query.
TreeID id() const
Get tree ID.
DataType
Available data types.
ConditionalOp op
Condtional op.
NodeType type() const override
std::string feature
Feature name.