DiSMEC++
|
Base class for all weight init strategies. More...
#include <initializer.h>
Public Member Functions | |
virtual | ~WeightInitializationStrategy ()=default |
virtual std::unique_ptr< WeightsInitializer > | make_initializer (const std::shared_ptr< const GenericFeatureMatrix > &features) const =0 |
Creats a new, thread local WeightsInitializer . More... | |
Base class for all weight init strategies.
The WeightInitializationStrategy
is responsible for generating a WeightInitializer
for each thread. To that end, the training code calls WeightInitializationStrategy::make_initializer()
during thread initialization, i.e. the function will be called in the thread that will then also be used to run the initializations.
The WeightInitializationStrategy::make_initializer()
gets passed in a reference to the training features. This is done (as opposed to WeightInitializationStrategy
saving the features itself) so we can get the numa-local feature copies, and don't have to do the duplication again.
Definition at line 53 of file initializer.h.
|
virtualdefault |
|
pure virtual |
Creats a new, thread local WeightsInitializer
.
This function will be called from the thread in which the returned WeightsInitializer
will be used. It gets passed in a numa-local copy of the feature matrix.
features | Read-only reference to the numa-local feature matrix. |
WeightsInitializer
. Implemented in dismec::init::ZeroInitializationStrategy, dismec::init::PreTrainedInitializationStrategy, dismec::init::NumpyInitializationStrategy, dismec::init::MultiPosMeanStrategy, dismec::init::MeanOfFeaturesStrategy, and dismec::init::ConstantInitializationStrategy.