forpy 2

Public Member Functions | Public Attributes | List of all members
forpy::DeciderDesk Struct Reference
Desk Implementations

Desk for decider training. More...

`#include <desk.h>`

## Public Member Functions
void | setup (std::vector< size_t > *ntfp, mu::variant< std::vector< float >, std::vector< double >, std::vector< uint32_t >, std::vector< uint8_t >> *nttp)
void | reset ()

## Public Attributes
mu::variant< const float *, const double *, const uint *, const uint8_t * > | full_feat_p_v
std::vector< size_t > | invalid_counts
std::vector< size_t > * | node_to_featsel_p
mu::variant< std::vector< float >, std::vector< double >, std::vector< uint32_t >, std::vector< uint8_t > > * | node_to_thresh_v_p
size_t | n_samples
| These variables are populated in IDecider::make_node. More...
size_t | input_dim
| These variables are populated in IDecider::make_node. More...
size_t | annot_dim
| These variables are populated in IDecider::make_node. More...
uint | min_samples_at_leaf
| These variables are populated in IDecider::make_node. More...
id_t * | elem_id_p
id_t | start_id
| These variables are populated in IDecider::make_node. More...
id_t | end_id
| These variables are populated in IDecider::make_node. More...
id_t | node_id
| These variables are populated in IDecider::make_node. More...
OptSplitV | best_res_v
| Variables used during the threshold optimization. More...
OptSplitV | opt_res_v
| Variables used during the threshold optimization. More...
id_t | best_feat_idx
| Variables used during the threshold optimization. More...
bool | presorted
| Variables used during the threshold optimization. More...
bool | need_sort
| Variables used during the threshold optimization. More...
std::vector< id_t > | feature_indices
| Variables used during the threshold optimization. More...
std::vector< float > | full_sum
| Variables initialized in IThreshOpt::full_entropy. More...
float * | full_sum_p
| Variables initialized in IThreshOpt::full_entropy. More...
float | fullentropy
| Variables initialized in IThreshOpt::full_entropy. More...
float | maxproxy
| Variables initialized in IThreshOpt::full_entropy. More...
const float * | annot_p
| Variables initialized in IThreshOpt::full_entropy. More...
const uint * | class_annot_p
| Variables initialized in IThreshOpt::full_entropy. More...
size_t | annot_os
| Variables initialized in IThreshOpt::full_entropy. More...
const float * | weights_p
| Variables initialized in IThreshOpt::full_entropy. More...
float | full_w
| Variables initialized in IThreshOpt::full_entropy. More...
std::vector< id_t > | sort_perm
| Variables initialized in IThreshOpt::full_entropy. More...
id_t * | sort_perm_p
| Variables initialized in IThreshOpt::full_entropy. More...
std::vector< id_t > | elem_ids_sorted
| Variables initialized in IThreshOpt::full_entropy. More...
id_t * | elem_ids_sorted_p
| Variables initialized in IThreshOpt::full_entropy. More...
std::vector< float > | feat_values
| Variables initialized in IThreshOpt::full_entropy. More...
float * | feat_p
| Variables initialized in IThreshOpt::full_entropy. More...
DataV | class_feat_values
| Variables initialized in IThreshOpt::full_entropy. More...
std::vector< float > | left_sum_vec
| Variables initialized in IThreshOpt::full_entropy. More...
float * | left_sum_p
| Variables initialized in IThreshOpt::full_entropy. More...
bool | make_to_leaf
| Return values from IThreshOpt::optimize. More...
interv_t | left_int
| Return values from IThreshOpt::optimize. More...
interv_t | right_int
| Return values from IThreshOpt::optimize. More...
id_t | left_id
| Return values from IThreshOpt::optimize. More...
id_t | right_id
| Return values from IThreshOpt::optimize. More...

## Detailed Description

Desk for decider training.

Storage container for threaded decider training (see also Desk Implementations).

Definition at line 61 of file desk.h.

## Member Function Documentation

## ◆ reset()

void forpy::DeciderDesk::reset | ( |  | ) |
| inline

Definition at line 142 of file desk.h.

## ◆ setup()

void forpy::DeciderDesk::setup | ( | std::vector< size_t > * | ntfp,
|  | mu::variant< std::vector< float >, std::vector< double >, std::vector< uint32_t >, std::vector< uint8_t >> * | nttp
| ) |  |
| inline

Definition at line 134 of file desk.h.

## Member Data Documentation

## ◆ annot_dim

size_t forpy::DeciderDesk::annot_dim

These variables are populated in IDecider::make_node.

Definition at line 64 of file desk.h.

## ◆ annot_os

size_t forpy::DeciderDesk::annot_os

Variables initialized in IThreshOpt::full_entropy.

Definition at line 88 of file desk.h.

## ◆ annot_p

const float* forpy::DeciderDesk::annot_p

Variables initialized in IThreshOpt::full_entropy.

Definition at line 86 of file desk.h.

## ◆ best_feat_idx

id_t forpy::DeciderDesk::best_feat_idx

Variables used during the threshold optimization.

Definition at line 76 of file desk.h.

## ◆ best_res_v

OptSplitV forpy::DeciderDesk::best_res_v

Variables used during the threshold optimization.

Definition at line 75 of file desk.h.

## ◆ class_annot_p

const uint* forpy::DeciderDesk::class_annot_p

Variables initialized in IThreshOpt::full_entropy.

Definition at line 87 of file desk.h.

## ◆ class_feat_values

DataV forpy::DeciderDesk::class_feat_values

Variables initialized in IThreshOpt::full_entropy.

Definition at line 97 of file desk.h.

## ◆ elem_id_p

id_t* forpy::DeciderDesk::elem_id_p

Points only to the relevant section of the full id list! E.g., the full id list is [0, 1, 2, 3, 4] and this node is optimized for IDs 1:3, the pointer points to element 1.

Definition at line 69 of file desk.h.

## ◆ elem_ids_sorted

std::vector<id_t> forpy::DeciderDesk::elem_ids_sorted

Variables initialized in IThreshOpt::full_entropy.

Definition at line 93 of file desk.h.

## ◆ elem_ids_sorted_p

id_t* forpy::DeciderDesk::elem_ids_sorted_p

Variables initialized in IThreshOpt::full_entropy.

Definition at line 94 of file desk.h.

## ◆ end_id

id_t forpy::DeciderDesk::end_id

These variables are populated in IDecider::make_node.

Definition at line 70 of file desk.h.

## ◆ feat_p

float* forpy::DeciderDesk::feat_p

Variables initialized in IThreshOpt::full_entropy.

Definition at line 96 of file desk.h.

## ◆ feat_values

std::vector<float> forpy::DeciderDesk::feat_values

Variables initialized in IThreshOpt::full_entropy.

Definition at line 95 of file desk.h.

## ◆ feature_indices

std::vector<id_t> forpy::DeciderDesk::feature_indices

Variables used during the threshold optimization.

Definition at line 78 of file desk.h.

## ◆ full_feat_p_v

mu::variant<const float *, const double *, const uint *, const uint8_t *> forpy::DeciderDesk::full_feat_p_v

Must be initialized before calling IThreshOpt::optimize. Points to the a selected feature vector (full samples, so even if for this node only samples 1:3 are needed, this points to the feature for sample 0) with stride 1. This can be done using IDataProvider::get_feature .

Definition at line 107 of file desk.h.

## ◆ full_sum

std::vector<float> forpy::DeciderDesk::full_sum

Variables initialized in IThreshOpt::full_entropy.

Definition at line 83 of file desk.h.

## ◆ full_sum_p

float* forpy::DeciderDesk::full_sum_p

Variables initialized in IThreshOpt::full_entropy.

Definition at line 84 of file desk.h.

## ◆ full_w

float forpy::DeciderDesk::full_w

Variables initialized in IThreshOpt::full_entropy.

Definition at line 90 of file desk.h.

## ◆ fullentropy

float forpy::DeciderDesk::fullentropy

Variables initialized in IThreshOpt::full_entropy.

Definition at line 85 of file desk.h.

## ◆ input_dim

size_t forpy::DeciderDesk::input_dim

These variables are populated in IDecider::make_node.

Definition at line 64 of file desk.h.

## ◆ invalid_counts

std::vector<size_t> forpy::DeciderDesk::invalid_counts

Stores the number of elements in a vector of feature IDs that have been determined as invalid (e.g., because they are constant). For these values to work correctly, only DFS may be used (otherwise, the vector of features may be re-sorted and counts may become invalid before the node optimization reaches relevant nodes).

Definition at line 122 of file desk.h.

## ◆ left_id

id_t forpy::DeciderDesk::left_id

Return values from IThreshOpt::optimize.

Definition at line 114 of file desk.h.

## ◆ left_int

interv_t forpy::DeciderDesk::left_int

Return values from IThreshOpt::optimize.

Definition at line 113 of file desk.h.

## ◆ left_sum_p

float* forpy::DeciderDesk::left_sum_p

Variables initialized in IThreshOpt::full_entropy.

Definition at line 99 of file desk.h.

## ◆ left_sum_vec

std::vector<float> forpy::DeciderDesk::left_sum_vec

Variables initialized in IThreshOpt::full_entropy.

Definition at line 98 of file desk.h.

## ◆ make_to_leaf

bool forpy::DeciderDesk::make_to_leaf

Return values from IThreshOpt::optimize.

Definition at line 111 of file desk.h.

## ◆ maxproxy

float forpy::DeciderDesk::maxproxy

Variables initialized in IThreshOpt::full_entropy.

Definition at line 85 of file desk.h.

## ◆ min_samples_at_leaf

uint forpy::DeciderDesk::min_samples_at_leaf

These variables are populated in IDecider::make_node.

Definition at line 65 of file desk.h.

## ◆ n_samples

size_t forpy::DeciderDesk::n_samples

These variables are populated in IDecider::make_node.

Definition at line 64 of file desk.h.

## ◆ need_sort

bool forpy::DeciderDesk::need_sort

Variables used during the threshold optimization.

Definition at line 77 of file desk.h.

## ◆ node_id

id_t forpy::DeciderDesk::node_id

These variables are populated in IDecider::make_node.

Definition at line 70 of file desk.h.

## ◆ node_to_featsel_p

std::vector<size_t>* forpy::DeciderDesk::node_to_featsel_p

Pointer to a shared vector of a mapping node_id->feature. Since multiple threads never write to the same node and the vector is guaranteed to be large enough, concurrent writes can be performed.

Definition at line 127 of file desk.h.

## ◆ node_to_thresh_v_p

mu::variant<std::vector<float>, std::vector<double>, std::vector<uint32_t>, std::vector<uint8_t> >* forpy::DeciderDesk::node_to_thresh_v_p

Pointer to a shared vector of a mapping node_id->threshold. Since multiple threads never write to the same node and the vector is guaranteed to be large enough, concurrent writes can be performed.

Definition at line 132 of file desk.h.

## ◆ opt_res_v

OptSplitV forpy::DeciderDesk::opt_res_v

Variables used during the threshold optimization.

Definition at line 75 of file desk.h.

## ◆ presorted

bool forpy::DeciderDesk::presorted

Variables used during the threshold optimization.

Definition at line 77 of file desk.h.

## ◆ right_id

id_t forpy::DeciderDesk::right_id

Return values from IThreshOpt::optimize.

Definition at line 114 of file desk.h.

## ◆ right_int

interv_t forpy::DeciderDesk::right_int

Return values from IThreshOpt::optimize.

Definition at line 113 of file desk.h.

## ◆ sort_perm

std::vector<id_t> forpy::DeciderDesk::sort_perm

Variables initialized in IThreshOpt::full_entropy.

Definition at line 91 of file desk.h.

## ◆ sort_perm_p

id_t* forpy::DeciderDesk::sort_perm_p

Variables initialized in IThreshOpt::full_entropy.

Definition at line 92 of file desk.h.

## ◆ start_id

id_t forpy::DeciderDesk::start_id

These variables are populated in IDecider::make_node.

Definition at line 70 of file desk.h.

## ◆ weights_p

const float* forpy::DeciderDesk::weights_p

Variables initialized in IThreshOpt::full_entropy.

Definition at line 89 of file desk.h.

The documentation for this struct was generated from the following file:

- /Users/classner/git/forpy/include/forpy/util/desk.h