forpy
2
|
Use the provided data plain throughout the training. More...
#include <fastdprov.h>
Public Member Functions | |
FastDProv (const DataStore< Mat > &data, const DataStore< Mat > &annotations, const std::shared_ptr< std::vector< float > const > &weights_store) | |
Standard constructor. Takes shared ownership on data and annotations. More... | |
FastDProv (const Data< MatCRef > &data, const Data< MatCRef > &annotations, const std::shared_ptr< std::vector< float > const > &weights_store) | |
Non-ownership requiring constructor. More... | |
bool | operator== (const IDataProvider &rhs) const |
std::vector< id_t > & | get_initial_sample_list () |
forpy::IDataProvider function implementation. More... | |
size_t | get_n_samples () const |
forpy::IDataProvider function implementation. More... | |
Data< VecCMap > | get_feature (const size_t &) const |
forpy::IDataProvider function implementation. More... | |
Data< MatCRef > | get_annotations () const |
forpy::IDataProvider function implementation. More... | |
void | set_annotations (const DataStore< Mat > &new_annotation_store) |
forpy::IDataProvider function implementation. More... | |
std::shared_ptr< const std::vector< float > > | get_weights () const |
forpy::IDataProvider function implementation. More... | |
std::vector< std::shared_ptr< IDataProvider > > | create_tree_providers (usage_map_t &usage_map) |
forpy::IDataProvider function implementation. More... | |
![]() | |
virtual | ~IDataProvider () |
size_t | get_feat_vec_dim () const |
Get the feature vector dimension. More... | |
size_t | get_annot_vec_dim () const |
Get the annotation vector dimension. More... | |
Private Member Functions | |
FastDProv () | |
Constructor for deserialization. More... | |
FastDProv (const Data< MatCRef > &data, const Data< MatCRef > &annotations, const std::shared_ptr< std::vector< float > const > &weights_store, std::shared_ptr< std::vector< id_t >> &training_ids) | |
Constructor for creating a 'proxy' data provider for trees. More... | |
void | checks (const Data< MatCRef > &data, const Data< MatCRef > &annotations) const |
Perform all necessary checks before constructing an instance. More... | |
void | init_from_arrays () |
Perform the initialization once the FastDProv::data and FastDProv::annotations have been set. More... | |
Private Attributes | |
DataStore< Mat > | data_store |
Data storage. If ownership of the data can't be shared, it is copied here. More... | |
DataStore< Mat > | annotation_store |
Data< MatCRef > | data |
A reference to the data. More... | |
Data< MatCRef > | annotations |
A reference to the annotations. More... | |
std::shared_ptr< std::vector< float > const > | weights_store |
Weight storage. More... | |
std::shared_ptr< std::vector< id_t > > | training_ids |
size_t | annot_vec_dim |
The dimension of one annotation vector. More... | |
size_t | feat_vec_dim |
The dimension of one feature vector. More... | |
Friends | |
std::ostream & | operator<< (std::ostream &stream, const FastDProv &self) |
Additional Inherited Members | |
![]() | |
virtual std::vector< std::shared_ptr< IDataProvider > > virtual create_tree_providers(usage_map_t &usage_map) VIRTUAL(std bool | operator== (const IDataProvider &rhs) const VIRTUAL(bool) |
Creates the data providers for each tree from the specified usage map. More... | |
![]() | |
IDataProvider (const size_t &feature_dimension, const size_t &annotation_dimension) | |
Standard constructor to use for inheriting classes. More... | |
IDataProvider () | |
Constructor solely for deserialization. More... | |
![]() | |
size_t | feat_vec_dim |
The dimension of one feature vector. More... | |
size_t | annot_vec_dim |
The dimension of one annotation vector. More... | |
Use the provided data plain throughout the training.
Definition at line 19 of file fastdprov.h.
forpy::FastDProv::FastDProv | ( | const DataStore< Mat > & | data, |
const DataStore< Mat > & | annotations, | ||
const std::shared_ptr< std::vector< float > const > & | weights_store | ||
) |
Standard constructor. Takes shared ownership on data and annotations.
data | Matrix in column major order with shape (n_samples x n_features). |
annotations | Matrix in row major order with shape (n_samples x n_annots). |
weights_store | Storage for sample weights. If nullptr, weights are ignored. |
forpy::FastDProv::FastDProv | ( | const Data< MatCRef > & | data, |
const Data< MatCRef > & | annotations, | ||
const std::shared_ptr< std::vector< float > const > & | weights_store | ||
) |
Non-ownership requiring constructor.
It's your job to keep the data alive as long as this object exists. I'm looking at you, Python interface!
data | Matrix in column major order with shape (n_samples x n_features). |
annotations | Matrix in row major order with shape (n_samples x n_annots). |
weights_store | Vector with shape (n_samples) with positive weights for each sample. |
|
inlineprivate |
Constructor for deserialization.
Definition at line 86 of file fastdprov.h.
|
private |
Constructor for creating a 'proxy' data provider for trees.
This just maps the data of an existing data provider.
|
private |
Perform all necessary checks before constructing an instance.
std::vector<std::shared_ptr<IDataProvider> > forpy::FastDProv::create_tree_providers | ( | usage_map_t & | usage_map | ) |
forpy::IDataProvider function implementation.
forpy::IDataProvider function implementation.
Reimplemented from forpy::IDataProvider.
Definition at line 59 of file fastdprov.h.
forpy::IDataProvider function implementation.
Reimplemented from forpy::IDataProvider.
|
inline |
forpy::IDataProvider function implementation.
Definition at line 53 of file fastdprov.h.
|
inline |
forpy::IDataProvider function implementation.
Definition at line 55 of file fastdprov.h.
|
inlinevirtual |
forpy::IDataProvider function implementation.
Reimplemented from forpy::IDataProvider.
Definition at line 67 of file fastdprov.h.
|
private |
Perform the initialization once the FastDProv::data and FastDProv::annotations have been set.
bool forpy::FastDProv::operator== | ( | const IDataProvider & | rhs | ) | const |
|
inlinevirtual |
forpy::IDataProvider function implementation.
Reimplemented from forpy::IDataProvider.
Definition at line 61 of file fastdprov.h.
|
friend |
Definition at line 75 of file fastdprov.h.
|
private |
The dimension of one annotation vector.
Definition at line 119 of file idataprovider.h.
Data storage. If ownership of the annotations can't be shared, they are copied here.
Definition at line 111 of file fastdprov.h.
A reference to the annotations.
Definition at line 115 of file fastdprov.h.
A reference to the data.
Definition at line 113 of file fastdprov.h.
Data storage. If ownership of the data can't be shared, it is copied here.
Definition at line 108 of file fastdprov.h.
|
private |
The dimension of one feature vector.
Definition at line 114 of file idataprovider.h.
|
private |
A vector of the annotation indices that should be used out of the full data.
Definition at line 120 of file fastdprov.h.
|
private |
Weight storage.
Definition at line 117 of file fastdprov.h.