libdl  0.0.1
Simple yet powerful deep learning
Loading...
Searching...
No Matches
dl::MeanError Class Reference

Public Member Functions

MeanErroroperator+= (dl::TensorPtr loss) noexcept
 
dl::TensorPtr aggregated () const
 

Detailed Description

Definition at line 14 of file evaluators.hpp.

Constructor & Destructor Documentation

◆ MeanError()

dl::MeanError::MeanError ( )
inlinenoexcept

Definition at line 20 of file evaluators.hpp.

20: sum(dl::constant(0)), num(0) {}

Member Function Documentation

◆ aggregated()

dl::TensorPtr dl::MeanError::aggregated ( ) const
inline

Definition at line 28 of file evaluators.hpp.

28{ return sum / (float)num; }

◆ operator+=()

MeanError & dl::MeanError::operator+= ( dl::TensorPtr  loss)
inlinenoexcept

Definition at line 22 of file evaluators.hpp.

22 {
23 sum = sum + dl::sum(loss);
24 num += dl::numEntries(loss);
25 return *this;
26 }
TensorPtr sum(TensorPtr x) noexcept
Sum.
size_t numEntries(const TensorPtr &tensor) noexcept
Returns the number of entries in the tensor.

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