DiSMEC++
|
Base class for all weight initializers. More...
#include <initializer.h>
Public Member Functions | |
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< StatisticsCollection > | get_stats () const |
Gets an ownership-sharing reference to the StatisticsCollection . More... | |
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... | |
Base class for all weight initializers.
Weight initializers are used by TrainingTaskGenerator
to generate the initial weight vector before the actual training process starts. A well-chosen initial vector can significantly decrease training time. Of course, this requires that the calculation of the initial vector itself be fast. For more discussion as well as the list of available initializers, see initvectors . Instances of WeightsInitializer
will be created inside the training threads by a WeightInitializationStrategy
. This ensure that each training thread has its own initializer, so the get_initial_weight()
method does not need to be mutex-protected.
Definition at line 30 of file initializer.h.
|
virtualdefault |
|
pure virtual |
Generate an initial vector for the given label. The result should be placed in target.
Implemented in dismec::init::ZeroInitializer, dismec::init::PreTrainedInitializer, dismec::init::NumpyInitializer, dismec::init::MultiPosMeanInitializer< Sparse >, dismec::init::MeanOfFeaturesInitializer, dismec::init::ConstantInitializer, and anonymous_namespace{cascade.cpp}::CombinedWeightInitializer.