ONE - On-device Neural Engine
Loading...
Searching...
No Matches
onert::backend::train Namespace Reference

Namespaces

namespace  ops
 
namespace  optimizer
 

Data Structures

class  Backend
 
class  BackendContext
 
class  BumpPlanner
 Class to plan memory by bump way. More...
 
class  Config
 
class  DisposableMemoryManager
 
class  DisposableTensorIndex
 Class that is index of DisposableTensor. More...
 
class  DummyBackendContext
 
class  FirstFitPlanner
 Class to plan memory by firstfit way. More...
 
class  ITensorRegistry
 
struct  ITrainableBackend
 
class  ITrainableTensor
 A tensor class that can be trained. More...
 
class  KernelGenerator
 
class  KernelGeneratorBase
 
class  LayerScopeMemoryManager
 
class  LayerScopeTensor
 
class  LayerScopeTensorIndex
 
class  MemoryPlannerFactory
 
class  PortableTensorRegistryTemplate
 
class  Tensor
 
class  TensorBuilder
 
class  TensorManager
 
class  TensorPlanner
 
class  TensorRegistry
 
class  TrainableBackendContext
 
struct  TrainableContextData
 
class  TrainableMemoryManager
 
class  WICPlanner
 Class to plan memory by Weighted Interval Color algorithm. More...
 

Typedefs

using ExternalContext = cpu::ExternalContext
 
using MemoryManager = backend::basic::MemoryManager
 
using TrainableTensor = basic::train::TrainableTensor
 
using BackPropTensor = Tensor
 
using GradientTensor = Tensor
 
using LayerScopeTensors = std::vector< std::shared_ptr< LayerScopeTensor > >
 
using FunctionMap = std::unordered_map< ir::OperationIndex, std::unique_ptr< exec::train::TrainableFnSequence > >
 
using TrainableBackendContexts = std::unordered_map< const Backend *, std::unique_ptr< TrainableBackendContext > >
 

Enumerations

enum class  LayerScopeTensorLifeTime : unsigned char { BACKWARD , FORWARD_TO_BACKWARD }
 

Functions

std::ostream & operator<< (std::ostream &o, const DisposableTensorIndex &i)
 
std::ostream & operator<< (std::ostream &o, const LayerScopeTensorIndex &i)
 
std::unique_ptr< exec::train::optimizer::OptimizercreateOptimizer (const ir::train::OptimizerInfo &optim_info)
 

Typedef Documentation

◆ BackPropTensor

Definition at line 47 of file Tensor.h.

◆ ExternalContext

◆ FunctionMap

using onert::backend::train::FunctionMap = typedef std::unordered_map<ir::OperationIndex, std::unique_ptr<exec::train::TrainableFnSequence> >

Definition at line 36 of file TrainableBackendContext.h.

◆ GradientTensor

Definition at line 48 of file Tensor.h.

◆ LayerScopeTensors

using onert::backend::train::LayerScopeTensors = typedef std::vector<std::shared_ptr<LayerScopeTensor> >

Definition at line 61 of file LayerScopeTensor.h.

◆ MemoryManager

◆ TrainableBackendContexts

using onert::backend::train::TrainableBackendContexts = typedef std::unordered_map<const Backend *, std::unique_ptr<TrainableBackendContext> >

Definition at line 91 of file TrainableBackendContext.h.

◆ TrainableTensor

Enumeration Type Documentation

◆ LayerScopeTensorLifeTime

enum class onert::backend::train::LayerScopeTensorLifeTime : unsigned char
strong
Enumerator
BACKWARD 
FORWARD_TO_BACKWARD 

Definition at line 29 of file LayerScopeTensor.h.

30{
31 BACKWARD, // alive during backward()
32 FORWARD_TO_BACKWARD, // alive from forward() to backward()
33};

Function Documentation

◆ createOptimizer()

std::unique_ptr< exec::train::optimizer::Optimizer > onert::backend::train::createOptimizer ( const ir::train::OptimizerInfo optim_info)

Definition at line 33 of file Optimizers.h.

34{
35 // TODO Set properties of optimizer
36 if (optim_info.optim_code == ir::train::OptimizerCode::SGD)
37 {
38 return std::make_unique<optimizer::SGD>(optim_info.learning_rate);
39 }
40 else if (optim_info.optim_code == ir::train::OptimizerCode::Adam)
41 {
42 return std::make_unique<optimizer::Adam>(optim_info.learning_rate);
43 }
44 else
45 throw std::runtime_error("Invalid optimizer type, " +
46 ir::train::toString(optim_info.optim_code));
47}

References onert::ir::train::Adam, onert::ir::train::OptimizerInfo::learning_rate, onert::ir::train::OptimizerInfo::optim_code, onert::ir::train::SGD, and onert::ir::train::toString().

Referenced by onert::backend::train::Backend::newContext().

◆ operator<<() [1/2]

std::ostream & onert::backend::train::operator<< ( std::ostream &  o,
const DisposableTensorIndex i 
)
inline

Definition at line 91 of file DisposableTensorIndex.h.

92{
93 return operator<<(o, i.operand_index());
94}
std::ostream & operator<<(std::ostream &os, const circledump::ModelEx &model)
Definition Dump.cpp:467
const ir::OperandIndex & operand_index() const
Get operand index.

References onert::backend::train::DisposableTensorIndex::operand_index(), and operator<<().

Referenced by operator<<().

◆ operator<<() [2/2]

std::ostream & onert::backend::train::operator<< ( std::ostream &  o,
const LayerScopeTensorIndex i 
)
inline