Deep Learning Algorithm Implementations 1.0.0
C++ implementations of fundamental deep learning algorithms
|
Binary Cross Entropy with Logits Loss. More...
#include <losses.hpp>
Public Member Functions | |
BCEWithLogitsLoss (const std::string &reduction="mean") | |
Constructor. | |
Variable< T > | forward (const Variable< T > &predictions, const Variable< T > &targets) override |
Forward pass: compute BCE loss from logits. | |
![]() | |
virtual | ~AutogradLoss ()=default |
Variable< T > | operator() (const Variable< T > &predictions, const Variable< T > &targets) |
Convenience operator for computing loss. | |
Binary Cross Entropy with Logits Loss.
Combines sigmoid and BCE for numerical stability. More stable than applying sigmoid then BCE separately.
Definition at line 148 of file losses.hpp.
|
inlineexplicit |
Constructor.
reduction | Type of reduction ('mean', 'sum', 'none') |
Definition at line 154 of file losses.hpp.
|
overridevirtual |
Forward pass: compute BCE loss from logits.
predictions | Raw logits (before sigmoid) |
targets | Binary target values (0 or 1) |
Implements dl::loss::AutogradLoss< T >.
Definition at line 121 of file losses.cpp.