nnlib
GPU-accelerated, C/C++ neural network library.
Public Member Functions | List of all members
BinaryCrossEntropy Class Reference

Class representing the Binary Cross Entropy. More...

#include <loss.h>

Inheritance diagram for BinaryCrossEntropy:
Loss Metric

Public Member Functions

sTensor calculateLoss (const sTensor &targets, const sTensor &predictions) override
 
std::string getShortName () const override
 Short string identifier of the metric. More...
 
- Public Member Functions inherited from Loss
 Loss ()
 Constructor for the Loss class. More...
 
float calculateMetric (const sTensor &targets, const sTensor &predictions) override
 Defines the method inherited from abstract Metric parent. More...
 
- Public Member Functions inherited from Metric
 Metric ()
 Constructor for the Metric class. More...
 
void reset ()
 Reset the metric, i.e.: set numSamples and currentTotalMetric to 0.
 

Additional Inherited Members

- Protected Attributes inherited from Metric
size_t numSamples
 The number of samples processed so far.
 
float currentTotalMetric
 The current total value of the metric.
 

Detailed Description

Class representing the Binary Cross Entropy.

This loss expects the targets to be of shape (n, 1) with labels 0 or 1.

Examples
Titanic.

Member Function Documentation

◆ getShortName()

std::string BinaryCrossEntropy::getShortName ( ) const
overridevirtual

Short string identifier of the metric.

Used when printing the value of the metric to the terminal.

Returns
A string identifier of the metric.

Implements Metric.


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