LBANN  0.103.0
LivermoreBigArtificialNeuralNetworkToolkit
lbann::ltfb::TruncationSelectionExchange Class Referencefinal

#include <truncation_selection_exchange.hpp>

Inheritance diagram for lbann::ltfb::TruncationSelectionExchange:
[legend]
Collaboration diagram for lbann::ltfb::TruncationSelectionExchange:
[legend]

Public Types

enum  metric_strategy { metric_strategy::LOWER_IS_BETTER, metric_strategy::HIGHER_IS_BETTER }
 

Public Member Functions

void select_next (model &m, ltfb::LTFBExecutionContext &ctxt, data_coordinator &dc) const final
 Engage in a ranked tournament with a population of trainers. More...
 
Life-cycle management
 TruncationSelectionExchange (std::string metric_name, metric_strategy winner_strategy, int truncation_k)
 Constructor. More...
 
 TruncationSelectionExchange (std::unordered_map< std::string, metric_strategy > metrics, int truncation_k)
 Constructor. More...
 
 ~TruncationSelectionExchange ()=default
 
 TruncationSelectionExchange (TruncationSelectionExchange const &other)
 
- Public Member Functions inherited from lbann::Cloneable< TruncationSelectionExchange, MetaLearningStrategy >
std::unique_ptr< TruncationSelectionExchange > clone () const
 Return an exception-safe, memory-safe copy of this object. More...
 

Private Member Functions

EvalType evaluate_model (model &m, LTFBExecutionContext &ctxt, data_coordinator &dc) const
 Get the value of the given metric from the model. More...
 

Private Attributes

std::unordered_map< std::string, metric_strategym_metrics
 The list of metric/strategy pairs. More...
 
int m_truncation_k
 

Detailed Description

A variant of classic LTFB or exploitation mechanism in population-based training. All trainers in the population set are ranked using specified evaluation metric. Model parameters, training hyperparameters and or topologies of any trainer in the bottom rank is replaced by that of a (random) trainer in the top rank.

Definition at line 50 of file truncation_selection_exchange.hpp.

Member Enumeration Documentation

◆ metric_strategy

Enumerator
LOWER_IS_BETTER 
HIGHER_IS_BETTER 

Definition at line 54 of file truncation_selection_exchange.hpp.

Constructor & Destructor Documentation

◆ TruncationSelectionExchange() [1/3]

lbann::ltfb::TruncationSelectionExchange::TruncationSelectionExchange ( std::string  metric_name,
metric_strategy  winner_strategy,
int  truncation_k 
)

Constructor.

Parameters
[in]metric_nameThe name of the metric to use for evaluation. A metric with this name must exist in the model passed to apply().
[in]winner_strategyStrategy for determining the winner of a tournament.
[in]truncation_kPartitions ranking list to top(winners)/bottom(losers)

◆ TruncationSelectionExchange() [2/3]

lbann::ltfb::TruncationSelectionExchange::TruncationSelectionExchange ( std::unordered_map< std::string, metric_strategy metrics,
int  truncation_k 
)

Constructor.

Parameters
[in]metricsThe metric/strategy pairs. A metric with each given name must exist in the model passed to apply().
[in]truncation_kPartitions ranking list to top(winners)/bottom(losers)

◆ ~TruncationSelectionExchange()

lbann::ltfb::TruncationSelectionExchange::~TruncationSelectionExchange ( )
default

◆ TruncationSelectionExchange() [3/3]

lbann::ltfb::TruncationSelectionExchange::TruncationSelectionExchange ( TruncationSelectionExchange const &  other)

Member Function Documentation

◆ evaluate_model()

EvalType lbann::ltfb::TruncationSelectionExchange::evaluate_model ( model m,
LTFBExecutionContext ctxt,
data_coordinator dc 
) const
private

Get the value of the given metric from the model.

◆ select_next()

void lbann::ltfb::TruncationSelectionExchange::select_next ( model m,
ltfb::LTFBExecutionContext ctxt,
data_coordinator dc 
) const
final

Engage in a ranked tournament with a population of trainers.

Parameters
[in,out]mOn input, the locally computed model. On output, the selected (winning model) with respect to the tournament.
[in,out]ctxtThe execution context for the outer LTFB wrapper.
[in,out]dcThe data source for the tournament.

Member Data Documentation

◆ m_metrics

std::unordered_map<std::string, metric_strategy> lbann::ltfb::TruncationSelectionExchange::m_metrics
private

The list of metric/strategy pairs.

Each metric gets its own strategy. Note, only one metric and strategy pair is currently supported. List (map) is for compatibility with classic LTFB (RPE) And as a placeholder for when multiple metrics are needed.

Definition at line 118 of file truncation_selection_exchange.hpp.

◆ m_truncation_k

int lbann::ltfb::TruncationSelectionExchange::m_truncation_k
private

Definition at line 122 of file truncation_selection_exchange.hpp.


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