go home Home | Main Page | Topics | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages
Loading...
Searching...
No Matches
ImpactLoss::Loss Class Referenceabstract

#include <ImpactLoss.h>

Detailed Description

Abstract base class for losses operating on extracted feature maps.

Stores the accumulated loss value and its derivative, and provides methods for updating them. Designed to support both:

  • Static mode (with manual update of derivative using precomputed jacobians)
  • Jacobian mode (direct backpropagation of gradients)

Subclasses must implement:

Definition at line 60 of file ImpactLoss.h.

Inheritance diagram for ImpactLoss::Loss:

Public Member Functions

virtual torch::Tensor GetDerivative (double N) const
virtual double GetValue (double N) const
virtual void initialize (torch::Tensor &output)
 Loss (bool isLossNormalized)
virtual Lossoperator+= (const Loss &other)
void reset ()
void setNumberOfParameters (int numberOfParameters)
void updateDerivativeInJacobianMode (torch::Tensor &jacobian, torch::Tensor &nonZeroJacobianIndices)
virtual void updateValue (torch::Tensor &fixedOutput, torch::Tensor &movingOutput)=0
virtual void updateValueAndDerivativeInStaticMode (torch::Tensor &fixedOutput, torch::Tensor &movingOutput, torch::Tensor &jacobian, torch::Tensor &nonZeroJacobianIndices)
virtual torch::Tensor updateValueAndGetGradientModulator (torch::Tensor &fixedOutput, torch::Tensor &movingOutput)=0
virtual ~Loss ()=default

Protected Attributes

torch::Tensor m_Derivative
bool m_Initialized = false
int m_NumberOfParameters
double m_Value

Private Attributes

double m_Normalization = 0

Constructor & Destructor Documentation

◆ Loss()

ImpactLoss::Loss::Loss ( bool isLossNormalized)
inline

Definition at line 72 of file ImpactLoss.h.

◆ ~Loss()

virtual ImpactLoss::Loss::~Loss ( )
virtualdefault

Member Function Documentation

◆ GetDerivative()

virtual torch::Tensor ImpactLoss::Loss::GetDerivative ( double N) const
inlinevirtual

Reimplemented in ImpactLoss::NCC.

Definition at line 135 of file ImpactLoss.h.

◆ GetValue()

virtual double ImpactLoss::Loss::GetValue ( double N) const
inlinevirtual

Reimplemented in ImpactLoss::NCC.

Definition at line 125 of file ImpactLoss.h.

◆ initialize()

virtual void ImpactLoss::Loss::initialize ( torch::Tensor & output)
inlinevirtual

Reimplemented in ImpactLoss::NCC.

Definition at line 92 of file ImpactLoss.h.

◆ operator+=()

virtual Loss & ImpactLoss::Loss::operator+= ( const Loss & other)
inlinevirtual

Reimplemented in ImpactLoss::NCC.

Definition at line 143 of file ImpactLoss.h.

◆ reset()

void ImpactLoss::Loss::reset ( )
inline

Definition at line 86 of file ImpactLoss.h.

◆ setNumberOfParameters()

void ImpactLoss::Loss::setNumberOfParameters ( int numberOfParameters)
inline

Definition at line 81 of file ImpactLoss.h.

◆ updateDerivativeInJacobianMode()

void ImpactLoss::Loss::updateDerivativeInJacobianMode ( torch::Tensor & jacobian,
torch::Tensor & nonZeroJacobianIndices )
inline

Definition at line 119 of file ImpactLoss.h.

◆ updateValue()

virtual void ImpactLoss::Loss::updateValue ( torch::Tensor & fixedOutput,
torch::Tensor & movingOutput )
pure virtual

◆ updateValueAndDerivativeInStaticMode()

virtual void ImpactLoss::Loss::updateValueAndDerivativeInStaticMode ( torch::Tensor & fixedOutput,
torch::Tensor & movingOutput,
torch::Tensor & jacobian,
torch::Tensor & nonZeroJacobianIndices )
inlinevirtual

Reimplemented in ImpactLoss::NCC.

Definition at line 106 of file ImpactLoss.h.

◆ updateValueAndGetGradientModulator()

virtual torch::Tensor ImpactLoss::Loss::updateValueAndGetGradientModulator ( torch::Tensor & fixedOutput,
torch::Tensor & movingOutput )
pure virtual

Member Data Documentation

◆ m_Derivative

torch::Tensor ImpactLoss::Loss::m_Derivative
protected

Definition at line 67 of file ImpactLoss.h.

◆ m_Initialized

bool ImpactLoss::Loss::m_Initialized = false
protected

Definition at line 68 of file ImpactLoss.h.

◆ m_Normalization

double ImpactLoss::Loss::m_Normalization = 0
mutableprivate

Definition at line 63 of file ImpactLoss.h.

◆ m_NumberOfParameters

int ImpactLoss::Loss::m_NumberOfParameters
protected

Definition at line 69 of file ImpactLoss.h.

◆ m_Value

double ImpactLoss::Loss::m_Value
protected

Definition at line 66 of file ImpactLoss.h.



Generated on 1774142652 for elastix by doxygen 1.15.0 elastix logo