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

Constructor & Destructor Documentation

◆ LossLayer()

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

Definition at line 28 of file LossLayer.cc.

29 : _y_pred(nullptr), _y_true(nullptr), _output(nullptr), _back_prop_y_pred(nullptr),
31{
32 // DO NOTHING
33}
const IPortableTensor * _y_pred
Definition LossLayer.h:50
const IPortableTensor * _y_true
Definition LossLayer.h:51
ir::train::LossReductionType _reduction_type
Definition LossLayer.h:54

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 35 of file LossLayer.cc.

38{
39 assert(y_pred != nullptr);
40 assert(y_true != nullptr);
41 assert(output != nullptr);
42 // back_prop_y_pred can be nullptr if backwarding is not required
43
44 _y_pred = y_pred;
45 _y_true = y_true;
47 _back_prop_y_pred = back_prop_y_pred;
48 _reduction_type = reduction_type;
49}

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: