|
LBANN
0.103.0
LivermoreBigArtificialNeuralNetworkToolkit
|
#include <truncation_selection_exchange.hpp>
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_strategy > | m_metrics |
| The list of metric/strategy pairs. More... | |
| int | m_truncation_k |
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.
| Enumerator | |
|---|---|
| LOWER_IS_BETTER | |
| HIGHER_IS_BETTER | |
Definition at line 54 of file truncation_selection_exchange.hpp.
| lbann::ltfb::TruncationSelectionExchange::TruncationSelectionExchange | ( | std::string | metric_name, |
| metric_strategy | winner_strategy, | ||
| int | truncation_k | ||
| ) |
Constructor.
| [in] | metric_name | The name of the metric to use for evaluation. A metric with this name must exist in the model passed to apply(). |
| [in] | winner_strategy | Strategy for determining the winner of a tournament. |
| [in] | truncation_k | Partitions ranking list to top(winners)/bottom(losers) |
| lbann::ltfb::TruncationSelectionExchange::TruncationSelectionExchange | ( | std::unordered_map< std::string, metric_strategy > | metrics, |
| int | truncation_k | ||
| ) |
Constructor.
| [in] | metrics | The metric/strategy pairs. A metric with each given name must exist in the model passed to apply(). |
| [in] | truncation_k | Partitions ranking list to top(winners)/bottom(losers) |
|
default |
| lbann::ltfb::TruncationSelectionExchange::TruncationSelectionExchange | ( | TruncationSelectionExchange const & | other | ) |
|
private |
Get the value of the given metric from the model.
|
final |
Engage in a ranked tournament with a population of trainers.
| [in,out] | m | On input, the locally computed model. On output, the selected (winning model) with respect to the tournament. |
| [in,out] | ctxt | The execution context for the outer LTFB wrapper. |
| [in,out] | dc | The data source for the tournament. |
|
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.
|
private |
Definition at line 122 of file truncation_selection_exchange.hpp.