|
ADS-IDAC Engine 5.0.0
|
Splits states of graph variables while a per-variable bin limit allows it. More...
#include <manager.hpp>
Public Member Functions | |
| DiscretizationManager (std::size_t max_bins_per_var=50) | |
| bool | should_split (const Graph &graph, NodeId var) const |
| Tests whether a variable still has fewer states than the limit. More... | |
| void | split_bin (Graph &graph, NodeId var, std::size_t state_idx) |
| Splits one state of a variable into two. More... | |
Private Attributes | |
| std::size_t | max_bins_per_var_ |
| split_bin() is a no-op at or above this state count More... | |
Splits states of graph variables while a per-variable bin limit allows it.
Definition at line 18 of file manager.hpp.
|
explicit |
| max_bins_per_var | Largest number of states a variable may reach through split_bin(). |
Definition at line 5 of file manager.cpp.
Tests whether a variable still has fewer states than the limit.
| graph | Graph that holds the variable. |
| var | Variable id. |
| std::out_of_range | if var is not a variable of graph. |
Definition at line 8 of file manager.cpp.
References bncore::Graph::get_variable(), max_bins_per_var_, and bncore::VariableMetadata::num_states().
Referenced by split_bin().
Splits one state of a variable into two.
The state named S is replaced by "S_low" and "S_high" at the same position, through Graph::split_state(). If should_split() is false the call does nothing. The CPTs stored in the graph are not resized, so the tables of the variable and of its children have to be set again before inference.
| graph | Graph to modify. |
| var | Variable id. |
| state_idx | Index of the state to split. It must be less than the variable's state count. |
| std::out_of_range | if var is not a variable of graph. |
Definition at line 13 of file manager.cpp.
References bncore::Graph::get_variable(), should_split(), bncore::Graph::split_state(), and bncore::VariableMetadata::states.
|
private |
split_bin() is a no-op at or above this state count
Definition at line 46 of file manager.hpp.
Referenced by should_split().