27 #ifndef LBANN_EXECUTION_ALGORITHMS_TRAINING_ALGORITHM_HPP_INCLUDED 28 #define LBANN_EXECUTION_ALGORITHMS_TRAINING_ALGORITHM_HPP_INCLUDED 34 #include <google/protobuf/message.h> 40 class data_coordinator;
101 virtual std::string
get_type()
const = 0;
104 std::string
const&
get_name()
const noexcept;
141 size_t max_mini_batch_size,
142 const std::vector<El::Grid*>& grids);
184 #endif // LBANN_EXECUTION_ALGORITHMS_TRAINING_ALGORITHM_HPP_INCLUDED virtual std::string get_type() const =0
A string identifying the type of the object.
std::string m_name
The user-defined name of the algorithm.
virtual ~TrainingAlgorithm()=default
std::unique_ptr< ExecutionContext > get_new_execution_context() const
Get a default-initialized execution context that fits this training algorithm.
std::string const & get_name() const noexcept
A user-defined string identifying the algorithm object.
void apply(model &model, data_coordinator &dc)
Apply the algorithm to the given model.
Abstract base class for neural network models.
The execution context for an KFAC algorithm.
TrainingAlgorithm & operator=(const TrainingAlgorithm &other)=delete
typename std::add_pointer< T >::type observer_ptr
Creating an observer_ptr to complement the unique_ptr and shared_ptr.
execution_mode
Neural network execution mode.
virtual void apply(ExecutionContext &context, model &model, data_coordinator &dc, execution_mode mode)=0
Apply the algorithm to the given model.
virtual ExecutionContext * do_get_new_execution_context() const =0
Covariant return-friendly implementation of get_new_exection_context().
std::unique_ptr< T > to_unique_ptr(T *ptr)
Convert the raw pointer to a unique_ptr.
void setup_models(std::vector< observer_ptr< model >> const &models, size_t max_mini_batch_size, const std::vector< El::Grid *> &grids)
Setup a collection of models.
TrainingAlgorithm(std::string name)
Constructor.
Base class for LBANN training_algorithms.