|
LBANN
0.103.0
LivermoreBigArtificialNeuralNetworkToolkit
|
Stochastic gradient descent optimizer. More...
#include <sgd.hpp>
Public Types | |
Public Types | |
| using | AbsDistMatrixType = El::AbstractDistMatrix< TensorDataType > |
| The tensor type expected in this object. More... | |
| using | OptimizerType = data_type_optimizer< TensorDataType > |
| The optimizer base type of this object. More... | |
| using | WeightsType = data_type_weights< TensorDataType > |
| The concrete weights type used by this object. More... | |
Public Member Functions | |
| void | write_proto (lbann_data::Optimizer &opt) const final |
Life cycle functions | |
| sgd (TensorDataType learning_rate, TensorDataType momentum=0, bool nesterov=false) | |
| sgd (const sgd &other) | |
| sgd & | operator= (const sgd &other) |
| ~sgd () override=default | |
Serialization | |
| template<class ArchiveT > | |
| void | serialize (ArchiveT &ar) |
| Serialize to the archive. More... | |
Descriptions | |
| std::string | get_type () const override |
| description | get_description () const override |
Access functions | |
| TensorDataType | get_momentum () const noexcept |
| Decay rate for gradient accumulation. More... | |
| void | set_momentum (TensorDataType momentum) |
| Decay rate for gradient accumulation. More... | |
| bool | using_nesterov () const noexcept |
| void | set_nesterov (bool nesterov) |
| const AbsDistMatrixType & | get_velocity () const |
| AbsDistMatrixType & | get_velocity () |
Setup | |
| void | setup (WeightsType *w=nullptr) override |
Public Member Functions inherited from lbann::Cloneable< sgd< TensorDataType >, data_type_optimizer< TensorDataType > > | |
| std::unique_ptr< sgd< TensorDataType > > | clone () const |
| Return an exception-safe, memory-safe copy of this object. More... | |
Protected Member Functions | |
| sgd () | |
| Default constructor. More... | |
| void | step_compute (AbsDistMatrixType &values, const AbsDistMatrixType &gradient) override |
Private Types | |
| using | BaseType = Cloneable< sgd< TensorDataType >, data_type_optimizer< TensorDataType > > |
Private Member Functions | |
| void | momentum_step_cpu (AbsDistMatrixType &values, const AbsDistMatrixType &gradient) |
Private Attributes | |
| TensorDataType | m_momentum |
| Decay rate for gradient accumulation. More... | |
| bool | m_nesterov |
| std::unique_ptr< AbsDistMatrixType > | m_velocity |
| Accumulated gradients. More... | |
Friends | |
| class | cereal::access |
Stochastic gradient descent optimizer.
Supports momentum and Nesterov acceleration.
| using lbann::sgd< TensorDataType >::AbsDistMatrixType = El::AbstractDistMatrix<TensorDataType> |
|
private |
| using lbann::sgd< TensorDataType >::OptimizerType = data_type_optimizer<TensorDataType> |
| using lbann::sgd< TensorDataType >::WeightsType = data_type_weights<TensorDataType> |
| lbann::sgd< TensorDataType >::sgd | ( | TensorDataType | learning_rate, |
| TensorDataType | momentum = 0, |
||
| bool | nesterov = false |
||
| ) |
| lbann::sgd< TensorDataType >::sgd | ( | const sgd< TensorDataType > & | other | ) |
|
overridedefault |
|
inlineprotected |
|
override |
Human-readable description.
|
inlinenoexcept |
|
inlineoverride |
| const AbsDistMatrixType& lbann::sgd< TensorDataType >::get_velocity | ( | ) | const |
Accumulated gradients for momentum optimizer.
| AbsDistMatrixType& lbann::sgd< TensorDataType >::get_velocity | ( | ) |
Accumulated gradients for momentum optimizer.
|
private |
CPU implementation of momentum or Nesterov step.
| sgd& lbann::sgd< TensorDataType >::operator= | ( | const sgd< TensorDataType > & | other | ) |
| void lbann::sgd< TensorDataType >::serialize | ( | ArchiveT & | ar | ) |
Serialize to the archive.
Definition at line 37 of file sgd_impl.hpp.
|
inline |
|
inline |
|
override |
|
overrideprotected |
Computation for an optimization step.
|
inlinenoexcept |
|
final |
Add optimizer data to prototext
|
friend |
|
private |
|
private |
|
private |