24.02.1
|
A binary decision tree based heuristic. More...
#include <HeuristicTree.h>
Data Structures | |
struct | BranchNode |
struct | LeafNode |
struct | Node |
Public Types | |
enum | NodeType { Branch, Leaf } |
using | NodeID = size_t |
using | TreeID = size_t |
using | Index = std::tuple< HeuristicType, std::string, DataType > |
Public Member Functions | |
HeuristicTree () | |
Constructor. More... | |
HeuristicTree (TreeID id, HeuristicType h_type, const std::string &ip_target, DataType data_type) | |
Constructor. More... | |
HeuristicTree (const HeuristicTree &)=delete | |
Prevent copy construction. More... | |
HeuristicTree & | operator= (const HeuristicTree &)=delete |
Prevent copy assignment. More... | |
HeuristicTree (HeuristicTree &&other) noexcept=default | |
Move constructor. More... | |
HeuristicTree & | operator= (HeuristicTree &&other)=default |
Move assignment. More... | |
template<typename T > | |
std::pair< bool, T > | query (GEMMShape shape) const |
Query a leaf value given a gemm shape. More... | |
template<typename T > | |
bool | add_leaf (NodeID id, T leaf_value) |
Add a leaf node. More... | |
bool | add_branch (NodeID id, Condition cond, NodeID true_node, NodeID false_node) |
Add a branch node. More... | |
TreeID | id () const |
Get tree ID. More... | |
Index | index () const |
Get tree index. More... | |
bool | check () |
Check if tree is valid. More... | |
Related Functions | |
(Note that these are not member functions.) | |
template std::pair< bool, GEMMType > | query (GEMMShape shape) const |
Explicit template instantiation. More... | |
template std::pair< bool, GEMMConfigNative > | query (GEMMShape shape) const |
Explicit template instantiation. More... | |
template std::pair< bool, GEMMConfigReshapedOnlyRHS > | query (GEMMShape shape) const |
Explicit template instantiation. More... | |
template std::pair< bool, GEMMConfigReshaped > | query (GEMMShape shape) const |
Explicit template instantiation. More... | |
template bool | add_leaf (NodeID id, GEMMType val) |
Explicit template instantiation. More... | |
template bool | add_leaf (NodeID id, GEMMConfigNative val) |
Explicit template instantiation. More... | |
template bool | add_leaf (NodeID id, GEMMConfigReshapedOnlyRHS val) |
Explicit template instantiation. More... | |
template bool | add_leaf (NodeID id, GEMMConfigReshaped val) |
Explicit template instantiation. More... | |
A binary decision tree based heuristic.
Definition at line 68 of file HeuristicTree.h.
using Index = std::tuple<HeuristicType, std::string, DataType> |
Definition at line 73 of file HeuristicTree.h.
using NodeID = size_t |
Definition at line 71 of file HeuristicTree.h.
using TreeID = size_t |
Definition at line 72 of file HeuristicTree.h.
|
strong |
HeuristicTree | ( | ) |
Constructor.
Definition at line 92 of file HeuristicTree.cpp.
References arm_compute::F32, and arm_compute::mlgo::GEMM_Type.
HeuristicTree | ( | TreeID | id, |
HeuristicType | h_type, | ||
const std::string & | ip_target, | ||
DataType | data_type | ||
) |
|
delete |
Prevent copy construction.
|
defaultnoexcept |
Move constructor.
Add a branch node.
id | Branch node ID |
cond | Branch node Condition |
true_node | True node's ID |
false_node | False node's ID |
Definition at line 149 of file HeuristicTree.cpp.
References ARM_COMPUTE_LOG_INFO_MSG_WITH_FORMAT_CORE, Condition::feature, and HeuristicTree::id().
bool add_leaf | ( | NodeID | id, |
T | leaf_value | ||
) |
Add a leaf node.
T | Leaf value type |
id | Leaf node ID |
leaf_value | Leaf node value |
Definition at line 133 of file HeuristicTree.cpp.
References ARM_COMPUTE_LOG_INFO_MSG_WITH_FORMAT_CORE, and HeuristicTree::id().
bool check | ( | ) |
Check if tree is valid.
Definition at line 212 of file HeuristicTree.cpp.
References ARM_COMPUTE_LOG_INFO_MSG_CORE, and ARM_COMPUTE_LOG_INFO_MSG_WITH_FORMAT_CORE.
|
inline |
Get tree ID.
Definition at line 161 of file HeuristicTree.h.
Referenced by HeuristicTree::add_branch(), and HeuristicTree::add_leaf().
|
inline |
|
delete |
Prevent copy assignment.
|
default |
Move assignment.
std::pair< bool, T > query | ( | GEMMShape | shape | ) | const |
Query a leaf value given a gemm shape.
T | Leaf value type |
shape | A GEMMShape for the query |
Definition at line 102 of file HeuristicTree.cpp.
References ARM_COMPUTE_ERROR_ON_MSG, ARM_COMPUTE_LOG_INFO_MSG_WITH_FORMAT_CORE, HeuristicTree::Branch, HeuristicTree::Leaf, and arm_compute::test::validation::shape.
|
related |
Explicit template instantiation.
|
related |
Explicit template instantiation.
|
related |
Explicit template instantiation.
Explicit template instantiation.
|
related |
Explicit template instantiation.
|
related |
Explicit template instantiation.
|
related |
Explicit template instantiation.