ONE - On-device Neural Engine
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
onert::ir::train Namespace Reference

Namespaces

namespace  checkpoint
 
namespace  operation
 

Data Structures

struct  CategoricalCrossentropyParam
 
class  ITrainableOperation
 
struct  LossInfo
 
struct  OptimizerInfo
 
class  TrainableGraph
 
class  TrainableOperation
 
struct  TrainableOperationVisitor
 
class  TrainingIndex
 Class that provides index of tensor for training. More...
 
class  TrainingInfo
 
class  UseDefChain
 
class  UseDefGenerator
 
struct  UseDefGeneratorBase
 

Typedefs

using TrainingOperationIndex = TrainingIndex< OperationIndex >
 Type that provides index of operation node for training.
 
using TrainingOperandIndex = TrainingIndex< OperandIndex >
 Type that provides index of operand for training.
 
using UseDefChains = std::unordered_map< TrainingOperandIndex, UseDefChain >
 

Enumerations

enum class  LossCode { Undefined , MeanSquaredError , CategoricalCrossentropy }
 
enum class  LossReductionType { Undefined , SumOverBatchSize , Sum }
 
enum class  OptimizerCode { Undefined , SGD , Adam }
 

Functions

std::ostream & operator<< (std::ostream &o, const TrainingOperationIndex &i)
 
std::ostream & operator<< (std::ostream &o, const TrainingOperandIndex &i)
 
std::string toString (LossCode opcode)
 Convert the optimizer code to the name.
 
std::string toString (OptimizerCode opcode)
 Convert the optimizer code to the name.
 

Typedef Documentation

◆ TrainingOperandIndex

Type that provides index of operand for training.

Note
TrainingOperandIndex can be index of an operand used in forwarding if the member "_is_forward" of TrainingIndex is true TrainingOperandIndex can be index of an operand used in backwarding if the member "_is_forward" of TrainingIndex is false

Definition at line 128 of file Index.h.

◆ TrainingOperationIndex

Type that provides index of operation node for training.

Note
TrainingOperationIndex can be index of a forwarding node if the member "_is_forward" of TrainingIndex is true TrainingOperationIndex can be index of a backwarding node if the membwr "_is_forward" of TrainingIndex is false

Definition at line 119 of file Index.h.

◆ UseDefChains

using onert::ir::train::UseDefChains = typedef std::unordered_map<TrainingOperandIndex, UseDefChain>

Definition at line 28 of file UseDefChains.h.

Enumeration Type Documentation

◆ LossCode

enum class onert::ir::train::LossCode
strong
Enumerator
Undefined 
MeanSquaredError 
CategoricalCrossentropy 

Definition at line 25 of file LossCode.h.

26{
27 Undefined, //< Undefined
28 MeanSquaredError, //< MeanSquaredError optimizer
29 CategoricalCrossentropy //< CategoricalCrossentropy optimizer
30};

◆ LossReductionType

Enumerator
Undefined 
SumOverBatchSize 
Sum 

Definition at line 28 of file LossInfo.h.

29{
30 Undefined, //< Undefined
31 SumOverBatchSize, //< SumOverBatchSize loss reduction type
32 Sum, //< Sum loss reduction type
33};

◆ OptimizerCode

Enumerator
Undefined 
SGD 
Adam 

Definition at line 27 of file OptimizerCode.h.

28{
29 Undefined, //< Undefined
30 SGD, //< SGD optimizer
31 Adam //< Adam optimizer
32};

Function Documentation

◆ operator<<() [1/2]

std::ostream & onert::ir::train::operator<< ( std::ostream &  o,
const TrainingOperandIndex i 
)
inline

Definition at line 135 of file Index.h.

136{
137 return operator<<(o, i.index());
138}
std::ostream & operator<<(std::ostream &os, const circledump::ModelEx &model)
Definition Dump.cpp:467
const T & index() const
Get index.
Definition Index.h:63

References onert::ir::train::TrainingIndex< T >::index(), and operator<<().

◆ operator<<() [2/2]

std::ostream & onert::ir::train::operator<< ( std::ostream &  o,
const TrainingOperationIndex i 
)
inline

Definition at line 130 of file Index.h.

131{
132 return operator<<(o, i.index());
133}

References onert::ir::train::TrainingIndex< T >::index(), and operator<<().

Referenced by operator<<(), and operator<<().

◆ toString() [1/2]

std::string onert::ir::train::toString ( LossCode  opcode)

Convert the optimizer code to the name.

Parameters
opcodeThe optimizer code
Returns
The name of the optimizer

Definition at line 24 of file LossCode.cc.

25{
26 static const std::unordered_map<LossCode, const char *> map{
27 {LossCode::Undefined, "Undefined"},
28 {LossCode::MeanSquaredError, "MeanSquaredError"},
29 {LossCode::CategoricalCrossentropy, "CategoricalCrossentropy"}};
30 return map.at(code);
31}

References CategoricalCrossentropy, MeanSquaredError, and Undefined.

Referenced by onert::backend::train::createOptimizer(), and onert::ir::train::operation::Loss::name().

◆ toString() [2/2]

std::string onert::ir::train::toString ( OptimizerCode  opcode)

Convert the optimizer code to the name.

Parameters
opcodeThe optimizer code
Returns
The name of the optimizer

Definition at line 24 of file OptimizerCode.cc.

25{
26 static const std::unordered_map<OptimizerCode, const char *> map{
27 {OptimizerCode::Undefined, "Undefined"},
28 {OptimizerCode::SGD, "SGD"},
29 {OptimizerCode::Adam, "Adam"}};
30 return map.at(code);
31}

References Adam, SGD, and Undefined.