DaNNet
Public Member Functions | Private Attributes | List of all members
dnn::opt_adagrad Class Reference

ADAgrad optimizer class. More...

#include <dnn_opt.h>

Inheritance diagram for dnn::opt_adagrad:
dnn::opt

Public Member Functions

 opt_adagrad (DNN_Dtype s, DNN_Dtype l=0.0, DNN_Dtype a=0.0, DNN_Dtype e=1e-8)
 ADAgrad constructor. More...
 
 ~opt_adagrad ()
 
void apply (arma::Cube< DNN_Dtype > &W, arma::Mat< DNN_Dtype > &B, const arma::Cube< DNN_Dtype > &Wgrad, const arma::Mat< DNN_Dtype > &Bgrad)
 Apply the optimizer to the layer parameters. More...
 
std::string get_algorithm (void)
 Get the optimizer algorithm information. More...
 
- Public Member Functions inherited from dnn::opt
 opt ()
 
 ~opt ()
 
void set_learn_rate_alg (LR_ALG alg, DNN_Dtype a=0.0, DNN_Dtype b=10.0)
 Set learning rate algorithm. More...
 
void update_learn_rate (void)
 Update learning rate. More...
 
DNN_Dtype get_learn_rate (void)
 Get the learning rate. More...
 

Private Attributes

arma::Cube< DNN_Dtypev
 
arma::Mat< DNN_DtypevB
 
DNN_Dtype eps
 

Additional Inherited Members

- Protected Attributes inherited from dnn::opt
std::string alg
 
DNN_Dtype lr
 Learning rate. More...
 
DNN_Dtype reg_lambda
 Regularisation parameter lambda. More...
 
DNN_Dtype reg_alpha
 Elastic net mix parameter - 0=ridge (L2) .. 1=LASSO (L1) More...
 
LR_ALG lr_alg
 Learning rate schedule algorithm. More...
 
DNN_Dtype lr_0
 Init value for lr. More...
 
DNN_Dtype lr_a
 Internal parameter a. More...
 
DNN_Dtype lr_b
 Internal parameter b. More...
 
arma::uword it
 Iteration counter. More...
 

Detailed Description

ADAgrad optimizer class.

ADAgrad algorithm, see https://arxiv.org/pdf/1609.04747.pdf

Definition at line 648 of file dnn_opt.h.

Constructor & Destructor Documentation

◆ opt_adagrad()

dnn::opt_adagrad::opt_adagrad ( DNN_Dtype  s,
DNN_Dtype  l = 0.0,
DNN_Dtype  a = 0.0,
DNN_Dtype  e = 1e-8 
)
inline

ADAgrad constructor.

Parameters
[in]sStep size - learning rate
[in]lRegularisation param lambda
[in]aRegularisation param alpha
[in]eeps parameter

Definition at line 663 of file dnn_opt.h.

◆ ~opt_adagrad()

dnn::opt_adagrad::~opt_adagrad ( )
inline

Definition at line 672 of file dnn_opt.h.

Member Function Documentation

◆ apply()

void dnn::opt_adagrad::apply ( arma::Cube< DNN_Dtype > &  W,
arma::Mat< DNN_Dtype > &  B,
const arma::Cube< DNN_Dtype > &  Wgrad,
const arma::Mat< DNN_Dtype > &  Bgrad 
)
inlinevirtual

Apply the optimizer to the layer parameters.

Parameters
[in,out]W,BLearnable parameters
[in]Wgrad,BgradGradient of the learnable parameters

Implements dnn::opt.

Definition at line 680 of file dnn_opt.h.

◆ get_algorithm()

std::string dnn::opt_adagrad::get_algorithm ( void  )
inlinevirtual

Get the optimizer algorithm information.

Returns
Algorithm information string

Reimplemented from dnn::opt.

Definition at line 716 of file dnn_opt.h.

Member Data Documentation

◆ eps

DNN_Dtype dnn::opt_adagrad::eps
private

Definition at line 653 of file dnn_opt.h.

◆ v

arma::Cube<DNN_Dtype> dnn::opt_adagrad::v
private

Definition at line 651 of file dnn_opt.h.

◆ vB

arma::Mat<DNN_Dtype> dnn::opt_adagrad::vB
private

Definition at line 652 of file dnn_opt.h.


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