24.02.1
|
Go to the documentation of this file.
24 #ifndef SRC_RUNTIME_CL_MLGO_HEURISTIC_TREE_H
25 #define SRC_RUNTIME_CL_MLGO_HEURISTIC_TREE_H
73 using Index = std::tuple<HeuristicType, std::string, DataType>;
82 virtual ~Node() =
default;
101 template <
typename T>
136 template <
typename T>
146 template <
typename T>
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
unsigned int n
Number of columns for the rhs matrix.
unsigned int k
Number of rows for the rhs matrix.
NodeType type() const override
float threshold
Threshold value.
@ LE
Less than or equal to.
NodeType type() const override
BranchNode(NodeID id, Condition cond, NodeID t_node, NodeID f_node)
unsigned int b
Batch size.
std::string feature
Feature name.
TreeID id() const
Get tree ID.
virtual NodeType type() const =0
Index index() const
Get tree index.
A binary decision tree based heuristic.
LeafNode(NodeID id, T val)
unsigned int m
Number of rows for the lhs matrix.
bool add_leaf(NodeID id, T leaf_value)
Add a leaf node.
bool add_branch(NodeID id, Condition cond, NodeID true_node, NodeID false_node)
Add a branch node.
A branch condition expression evaluating: feature op threshold.
MLGOHeuristics mlgo(TokenStream &in, bool &valid)
@ GE
Greater than or equal to.
HeuristicType
Types of Heuristic (tree)
std::tuple< HeuristicType, std::string, DataType > Index
Copyright (c) 2017-2024 Arm Limited.
HeuristicTree & operator=(const HeuristicTree &)=delete
Prevent copy assignment.
HeuristicTree()
Constructor.
ConditionalOp op
Condtional op.
DataType
Available data types.
ConditionalOp
Conditional ops.
bool check()
Check if tree is valid.
GEMM Shape used for query.
std::pair< bool, T > query(GEMMShape shape) const
Query a leaf value given a gemm shape.