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

#include <LossLayer.h>

Collaboration diagram for onert::backend::train::ops::LossLayer:

Public Member Functions

 LossLayer ()
 
void configure (const IPortableTensor *y_pred, const IPortableTensor *y_true, IPortableTensor *output, IPortableTensor *back_prop_y_pred, ir::train::LossReductionType reduction_type)
 
- Public Member Functions inherited from onert::exec::train::ITrainableFunction
virtual ~ITrainableFunction ()=default
 
virtual void forward (bool training)=0
 
virtual void backward ()=0
 
virtual std::optional< backend::train::LayerScopeTensorsregisterLayerScopeTensors ()
 

Protected Attributes

const IPortableTensor_y_pred
 
const IPortableTensor_y_true
 
IPortableTensor_output
 
IPortableTensor_back_prop_y_pred
 
ir::train::LossReductionType _reduction_type
 

Detailed Description

Definition at line 34 of file LossLayer.h.

Constructor & Destructor Documentation

◆ LossLayer()

onert::backend::train::ops::LossLayer::LossLayer ( )

Definition at line 22 of file LossLayer.cc.

23 : _y_pred(nullptr), _y_true(nullptr), _output(nullptr), _back_prop_y_pred(nullptr),
25{
26 // DO NOTHING
27}
const IPortableTensor * _y_pred
Definition LossLayer.h:44
const IPortableTensor * _y_true
Definition LossLayer.h:45
ir::train::LossReductionType _reduction_type
Definition LossLayer.h:48

Member Function Documentation

◆ configure()

void onert::backend::train::ops::LossLayer::configure ( const IPortableTensor y_pred,
const IPortableTensor y_true,
IPortableTensor output,
IPortableTensor back_prop_y_pred,
ir::train::LossReductionType  reduction_type 
)

Definition at line 29 of file LossLayer.cc.

32{
33 assert(y_pred != nullptr);
34 assert(y_true != nullptr);
35 assert(output != nullptr);
36 // back_prop_y_pred can be nullptr if backwarding is not required
37
38 _y_pred = y_pred;
39 _y_true = y_true;
41 _back_prop_y_pred = back_prop_y_pred;
42 _reduction_type = reduction_type;
43}

References _back_prop_y_pred, _output, _reduction_type, _y_pred, and _y_true.

Referenced by onert::backend::train::ops::LossMeanSquaredErrorLayer::configure(), and onert::backend::train::ops::LossCategoricalCrossentropyLayer::configure().

Field Documentation

◆ _back_prop_y_pred

IPortableTensor* onert::backend::train::ops::LossLayer::_back_prop_y_pred
protected

◆ _output

◆ _reduction_type

◆ _y_pred

◆ _y_true


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