DiSMEC++
dismec::postproc::Sparsify Class Reference
Inheritance diagram for dismec::postproc::Sparsify:
dismec::postproc::PostProcessor dismec::stats::Tracked

Classes

struct  BoundData
 
struct  UpperBoundResult
 

Public Member Functions

 Sparsify (std::shared_ptr< objective::Objective > objective, real_t tolerance)
 
- Public Member Functions inherited from dismec::postproc::PostProcessor
virtual ~PostProcessor ()=default
 
- 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...
 

Private Member Functions

void process (label_id_t label_id, Eigen::Ref< DenseRealVector > weight_vector, solvers::MinimizationResult &result) override
 Apply post-processing for the weight_vector corresponding to the label label_id. More...
 
UpperBoundResult find_initial_bounds (Eigen::Ref< DenseRealVector > weight_vector, real_t tolerance, real_t initial_lower)
 

Static Private Member Functions

static int make_sparse (Eigen::Ref< DenseRealVector > target, const Eigen::Ref< const DenseRealVector > &source, real_t cutoff)
 

Private Attributes

std::shared_ptr< objective::Objectivem_Objective
 
real_t m_Tolerance
 
HashVector m_WorkingVector
 
real_t m_NumValues = 1
 
real_t m_SumLogVal = std::log(0.02)
 
real_t m_SumSqrLog = std::log(0.02) * std::log(0.02)
 

Additional Inherited Members

- 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...
 

Detailed Description

Definition at line 27 of file sparsify.cpp.

Constructor & Destructor Documentation

◆ Sparsify()

Member Function Documentation

◆ find_initial_bounds()

Sparsify::UpperBoundResult dismec::postproc::Sparsify::find_initial_bounds ( Eigen::Ref< DenseRealVector weight_vector,
real_t  tolerance,
real_t  initial_lower 
)
private

◆ make_sparse()

static int dismec::postproc::Sparsify::make_sparse ( Eigen::Ref< DenseRealVector target,
const Eigen::Ref< const DenseRealVector > &  source,
real_t  cutoff 
)
inlinestaticprivate

Definition at line 47 of file sparsify.cpp.

◆ process()

void dismec::postproc::Sparsify::process ( label_id_t  label_id,
Eigen::Ref< DenseRealVector weight_vector,
solvers::MinimizationResult result 
)
overrideprivatevirtual

Apply post-processing for the weight_vector corresponding to the label label_id.

Implements dismec::postproc::PostProcessor.

Definition at line 80 of file sparsify.cpp.

References dismec::solvers::MinimizationResult::FinalValue, m_Tolerance, m_WorkingVector, dismec::stats::Tracked::make_timer(), and anonymous_namespace{sparsify.cpp}::STAT_DURATION.

Member Data Documentation

◆ m_NumValues

real_t dismec::postproc::Sparsify::m_NumValues = 1
private

Definition at line 73 of file sparsify.cpp.

◆ m_Objective

std::shared_ptr<objective::Objective> dismec::postproc::Sparsify::m_Objective
private

Definition at line 43 of file sparsify.cpp.

◆ m_SumLogVal

real_t dismec::postproc::Sparsify::m_SumLogVal = std::log(0.02)
private

Definition at line 74 of file sparsify.cpp.

◆ m_SumSqrLog

real_t dismec::postproc::Sparsify::m_SumSqrLog = std::log(0.02) * std::log(0.02)
private

Definition at line 75 of file sparsify.cpp.

◆ m_Tolerance

real_t dismec::postproc::Sparsify::m_Tolerance
private

Definition at line 44 of file sparsify.cpp.

Referenced by process().

◆ m_WorkingVector

HashVector dismec::postproc::Sparsify::m_WorkingVector
private

Definition at line 45 of file sparsify.cpp.

Referenced by process().


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