ONE - On-device Neural Engine
Loading...
Searching...
No Matches
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 132 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 123 of file Index.h.

◆ UseDefChains

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

Definition at line 32 of file UseDefChains.h.

Enumeration Type Documentation

◆ LossCode

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

Definition at line 29 of file LossCode.h.

30{
31 Undefined, //< Undefined
32 MeanSquaredError, //< MeanSquaredError optimizer
33 CategoricalCrossentropy //< CategoricalCrossentropy optimizer
34};

◆ LossReductionType

Enumerator
Undefined 
SumOverBatchSize 
Sum 

Definition at line 29 of file LossInfo.h.

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

◆ OptimizerCode

Enumerator
Undefined 
SGD 
Adam 

Definition at line 31 of file OptimizerCode.h.

32{
33 Undefined, //< Undefined
34 SGD, //< SGD optimizer
35 Adam //< Adam optimizer
36};

Function Documentation

◆ operator<<() [1/2]

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

Definition at line 139 of file Index.h.

140{
141 return operator<<(o, i.index());
142}
std::ostream & operator<<(std::ostream &os, const circledump::ModelEx &model)
Definition Dump.cpp:467
const T & index() const
Get index.
Definition Index.h:67

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 134 of file Index.h.

135{
136 return operator<<(o, i.index());
137}

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 28 of file LossCode.cc.

29{
30 static const std::unordered_map<LossCode, const char *> map{
31 {LossCode::Undefined, "Undefined"},
32 {LossCode::MeanSquaredError, "MeanSquaredError"},
33 {LossCode::CategoricalCrossentropy, "CategoricalCrossentropy"}};
34 return map.at(code);
35}

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 28 of file OptimizerCode.cc.

29{
30 static const std::unordered_map<OptimizerCode, const char *> map{
31 {OptimizerCode::Undefined, "Undefined"},
32 {OptimizerCode::SGD, "SGD"},
33 {OptimizerCode::Adam, "Adam"}};
34 return map.at(code);
35}

References Adam, SGD, and Undefined.