ONE - On-device Neural Engine
Loading...
Searching...
No Matches
onert::exec::train::optimizer::Optimizer Class Referenceabstract

Base class for all optimizers. More...

#include <Optimizer.h>

Public Member Functions

virtual ~Optimizer ()=default
 
virtual std::string name () const
 Get the name of optimizer.
 
virtual double getLearningRate (uint32_t iteration) const =0
 Get the Learning Rate.
 
virtual uint32_t getVarCount () const =0
 Get the number of optimizer variables s.
 
virtual void applyGradient (const UpdateFactors &factors) const =0
 Apply gradient to a trainable tensor.
 

Detailed Description

Base class for all optimizers.

for optimizers

Definition at line 42 of file Optimizer.h.

Constructor & Destructor Documentation

◆ ~Optimizer()

virtual onert::exec::train::optimizer::Optimizer::~Optimizer ( )
virtualdefault

Member Function Documentation

◆ applyGradient()

virtual void onert::exec::train::optimizer::Optimizer::applyGradient ( const UpdateFactors factors) const
pure virtual

Apply gradient to a trainable tensor.

Parameters
factorsUpdateFactors to be used for applying gradient to a trainable tensor

Implemented in onert::backend::train::optimizer::Adam, and onert::backend::train::optimizer::SGD.

Referenced by onert::backend::train::ops::GradientApplier::applyGradient().

◆ getLearningRate()

virtual double onert::exec::train::optimizer::Optimizer::getLearningRate ( uint32_t  iteration) const
pure virtual

Get the Learning Rate.

Parameters
iterationThe number of training steps
Returns
Learning rate

Implemented in onert::backend::train::optimizer::SGD, and onert::backend::train::optimizer::Adam.

◆ getVarCount()

virtual uint32_t onert::exec::train::optimizer::Optimizer::getVarCount ( ) const
pure virtual

Get the number of optimizer variables s.

Returns
The number of optimizer variables

Implemented in onert::backend::train::optimizer::Adam, and onert::backend::train::optimizer::SGD.

Referenced by onert::backend::train::TensorBuilder::registerBackwardTensorInfo().

◆ name()

virtual std::string onert::exec::train::optimizer::Optimizer::name ( ) const
inlinevirtual

Get the name of optimizer.

Returns
The name of optimizer

Reimplemented in onert::backend::train::optimizer::Adam, and onert::backend::train::optimizer::SGD.

Definition at line 52 of file Optimizer.h.

52{ return std::string{"Invalid"}; }

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