ONE - On-device Neural Engine
Loading...
Searching...
No Matches
onert::ir::train::TrainingInfo Class Referencefinal

#include <TrainingInfo.h>

Public Member Functions

 TrainingInfo ()
 
 TrainingInfo (const TrainingInfo &)=default
 
 TrainingInfo (TrainingInfo &&)=default
 
TrainingInfooperator= (const TrainingInfo &)=default
 
TrainingInfooperator= (TrainingInfo &&)=default
 
 ~TrainingInfo ()=default
 
uint32_t version () const
 
const LossInfolossInfo () const
 
const OptimizerInfooptimizerInfo () const
 
uint32_t batchSize () const
 
const uint32_t & trainingStep () const
 
const std::set< OperationIndex > & getTrainableOps () const
 
void setVersion (const uint32_t version)
 
void setBatchSize (const uint32_t batch_size)
 
void setLossInfo (const LossInfo &loss_info)
 
void setOptimizerInfo (const OptimizerInfo &optimizer_info)
 
uint32_t & trainingStep ()
 
void setTrainableOps (const std::set< OperationIndex > &trainable_ops)
 
bool isValid () const
 

Detailed Description

Definition at line 35 of file TrainingInfo.h.

Constructor & Destructor Documentation

◆ TrainingInfo() [1/3]

onert::ir::train::TrainingInfo::TrainingInfo ( )
inline

Definition at line 38 of file TrainingInfo.h.

39 : _version{0}, _loss_info(), _optimizer_info(), _batch_size(0), _training_step{0},
40 _trainable_ops{}
41 {
42 }

◆ TrainingInfo() [2/3]

onert::ir::train::TrainingInfo::TrainingInfo ( const TrainingInfo )
default

◆ TrainingInfo() [3/3]

onert::ir::train::TrainingInfo::TrainingInfo ( TrainingInfo &&  )
default

◆ ~TrainingInfo()

onert::ir::train::TrainingInfo::~TrainingInfo ( )
default

Member Function Documentation

◆ batchSize()

uint32_t onert::ir::train::TrainingInfo::batchSize ( ) const
inline

Definition at line 53 of file TrainingInfo.h.

53{ return _batch_size; }

Referenced by onert::compiler::train::TrainingCompiler::compile().

◆ getTrainableOps()

const std::set< OperationIndex > & onert::ir::train::TrainingInfo::getTrainableOps ( ) const
inline

Definition at line 55 of file TrainingInfo.h.

55{ return _trainable_ops; }

Referenced by onert::compiler::train::TrainingCompiler::compile().

◆ isValid()

bool onert::ir::train::TrainingInfo::isValid ( ) const

Definition at line 26 of file TrainingInfo.cc.

27{
28 if (_batch_size == 0)
29 return false;
30
31 if (_optimizer_info.optim_code == OptimizerCode::Undefined)
32 return false;
33
34 if (_optimizer_info.learning_rate <= 0.0f)
35 return false;
36
37 if (_loss_info.loss_code == LossCode::Undefined)
38 return false;
39
41 return false;
42
43 // If there are invalid combination, add more condition-check here
44 return true;
45}
LossReductionType reduction_type
Definition LossInfo.h:45

References onert::ir::train::OptimizerInfo::learning_rate, onert::ir::train::LossInfo::loss_code, onert::ir::train::OptimizerInfo::optim_code, onert::ir::train::LossInfo::reduction_type, and onert::ir::train::Undefined.

◆ lossInfo()

const LossInfo & onert::ir::train::TrainingInfo::lossInfo ( ) const
inline

Definition at line 51 of file TrainingInfo.h.

51{ return _loss_info; }

Referenced by onert::compiler::train::pass::LossInsertionPass::run().

◆ operator=() [1/2]

TrainingInfo & onert::ir::train::TrainingInfo::operator= ( const TrainingInfo )
default

◆ operator=() [2/2]

TrainingInfo & onert::ir::train::TrainingInfo::operator= ( TrainingInfo &&  )
default

◆ optimizerInfo()

const OptimizerInfo & onert::ir::train::TrainingInfo::optimizerInfo ( ) const
inline

Definition at line 52 of file TrainingInfo.h.

52{ return _optimizer_info; }

◆ setBatchSize()

void onert::ir::train::TrainingInfo::setBatchSize ( const uint32_t  batch_size)
inline

Definition at line 59 of file TrainingInfo.h.

59{ _batch_size = batch_size; }

◆ setLossInfo()

void onert::ir::train::TrainingInfo::setLossInfo ( const LossInfo loss_info)
inline

Definition at line 60 of file TrainingInfo.h.

60{ _loss_info = loss_info; }

◆ setOptimizerInfo()

void onert::ir::train::TrainingInfo::setOptimizerInfo ( const OptimizerInfo optimizer_info)
inline

Definition at line 61 of file TrainingInfo.h.

61{ _optimizer_info = optimizer_info; }

◆ setTrainableOps()

void onert::ir::train::TrainingInfo::setTrainableOps ( const std::set< OperationIndex > &  trainable_ops)
inline

Definition at line 63 of file TrainingInfo.h.

64 {
65 _trainable_ops = trainable_ops;
66 }

◆ setVersion()

void onert::ir::train::TrainingInfo::setVersion ( const uint32_t  version)
inline

Definition at line 58 of file TrainingInfo.h.

58{ _version = version; }

References version().

◆ trainingStep() [1/2]

uint32_t & onert::ir::train::TrainingInfo::trainingStep ( )
inline

Definition at line 62 of file TrainingInfo.h.

62{ return _training_step; }

◆ trainingStep() [2/2]

const uint32_t & onert::ir::train::TrainingInfo::trainingStep ( ) const
inline

Definition at line 54 of file TrainingInfo.h.

54{ return _training_step; }

◆ version()

uint32_t onert::ir::train::TrainingInfo::version ( ) const
inline

Definition at line 50 of file TrainingInfo.h.

50{ return _version; }

Referenced by setVersion().


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