DiSMEC++
dismec::init::SubsetFeatureMeanInitializer Class Reference

#include <subset.h>

Inheritance diagram for dismec::init::SubsetFeatureMeanInitializer:
dismec::init::WeightsInitializer dismec::stats::Tracked dismec::init::MeanOfFeaturesInitializer dismec::init::MultiPosMeanInitializer< Sparse >

Public Member Functions

 SubsetFeatureMeanInitializer (std::shared_ptr< const DatasetBase > data, const DenseRealVector &mean_of_all, std::shared_ptr< const GenericFeatureMatrix > local_features, real_t pos, real_t neg)
 
- Public Member Functions inherited from dismec::init::WeightsInitializer
virtual ~WeightsInitializer ()=default
 
virtual void get_initial_weight (label_id_t label_id, Eigen::Ref< DenseRealVector > target, objective::Objective &objective)=0
 Generate an initial vector for the given label. The result should be placed in target. More...
 
- Public Member Functions inherited from dismec::stats::Tracked
 Tracked ()
 Default constructor, creates the internal stats::StatisticsCollection. More...
 
void register_stat (const std::string &name, std::unique_ptr< Statistics > stat)
 Registers a tracker for the statistics name. More...
 
std::shared_ptr< StatisticsCollectionget_stats () const
 Gets an ownership-sharing reference to the StatisticsCollection. More...
 

Protected Member Functions

std::pair< real_t, real_tcalculate_factors (label_id_t label_id, const Eigen::Ref< DenseRealVector > &mean_of_positives)
 
- Protected Member Functions inherited from dismec::stats::Tracked
 ~Tracked ()
 Non-virtual destructor. Declared protected, so we don't accidentally try to do a polymorphic delete. More...
 
template<class T >
void record (stat_id_t stat, T &&value)
 Record statistics. This function just forwards all its arguments to the internal StatisticsCollection. More...
 
void declare_stat (stat_id_t index, StatisticMetaData meta)
 Declares a new statistics. This function just forwards all its arguments to the internal StatisticsCollection. More...
 
void declare_tag (tag_id_t index, std::string name)
 Declares a new tag. This function just forwards all its arguments to the internal StatisticsCollection. More...
 
template<class... Args>
void set_tag (tag_id_t tag, long value)
 Set value of tag. This function just forwards all its arguments to the internal StatisticsCollection. More...
 
template<class... Args>
auto make_timer (stat_id_t id, Args... args)
 Creates a new ScopeTimer using stats::record_scope_time. More...
 

Protected Attributes

std::shared_ptr< const DatasetBasem_DataSet
 
std::shared_ptr< const GenericFeatureMatrixm_LocalFeatures
 
BinaryLabelVector m_LabelBuffer
 
DenseRealVector m_MeanOfAll
 
real_t m_MeanAllNormSquared
 
real_t m_PosTarget
 
real_t m_NegTarget
 

Static Protected Attributes

static constexpr stats::stat_id_t STAT_DURATION {0}
 

Detailed Description

Definition at line 12 of file subset.h.

Constructor & Destructor Documentation

◆ SubsetFeatureMeanInitializer()

SubsetFeatureMeanInitializer::SubsetFeatureMeanInitializer ( std::shared_ptr< const DatasetBase data,
const DenseRealVector mean_of_all,
std::shared_ptr< const GenericFeatureMatrix local_features,
real_t  pos,
real_t  neg 
)

Definition at line 18 of file subset.cpp.

References m_DataSet, m_LabelBuffer, m_LocalFeatures, m_MeanAllNormSquared, and m_MeanOfAll.

Member Function Documentation

◆ calculate_factors()

std::pair< real_t, real_t > SubsetFeatureMeanInitializer::calculate_factors ( label_id_t  label_id,
const Eigen::Ref< DenseRealVector > &  mean_of_positives 
)
protected

Member Data Documentation

◆ m_DataSet

std::shared_ptr<const DatasetBase> dismec::init::SubsetFeatureMeanInitializer::m_DataSet
protected

◆ m_LabelBuffer

BinaryLabelVector dismec::init::SubsetFeatureMeanInitializer::m_LabelBuffer
protected

◆ m_LocalFeatures

std::shared_ptr<const GenericFeatureMatrix> dismec::init::SubsetFeatureMeanInitializer::m_LocalFeatures
protected

◆ m_MeanAllNormSquared

real_t dismec::init::SubsetFeatureMeanInitializer::m_MeanAllNormSquared
protected

Definition at line 24 of file subset.h.

Referenced by calculate_factors(), and SubsetFeatureMeanInitializer().

◆ m_MeanOfAll

DenseRealVector dismec::init::SubsetFeatureMeanInitializer::m_MeanOfAll
protected

◆ m_NegTarget

real_t dismec::init::SubsetFeatureMeanInitializer::m_NegTarget
protected

Definition at line 27 of file subset.h.

Referenced by calculate_factors().

◆ m_PosTarget

real_t dismec::init::SubsetFeatureMeanInitializer::m_PosTarget
protected

Definition at line 26 of file subset.h.

Referenced by calculate_factors().

◆ STAT_DURATION

constexpr stats::stat_id_t dismec::init::SubsetFeatureMeanInitializer::STAT_DURATION {0}
staticconstexprprotected

The documentation for this class was generated from the following files: