Dynamic Neural Field Composer 0.0.0
A C++20 library and interactive application for building and simulating Dynamic Neural Field (DNF) architectures.
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
dnf_composer::element::HeavisideFunction Struct Referencefinal

Heaviside step function. More...

#include <activation_function.h>

Inheritance diagram for dnf_composer::element::HeavisideFunction:
Collaboration diagram for dnf_composer::element::HeavisideFunction:

Public Member Functions

void apply (const std::vector< double > &input, std::vector< double > &out) const override
 Apply the activation function in-place into a pre-allocated out buffer. out must already be sized to input.size(). No heap allocation occurs.
 
std::unique_ptr< ActivationFunctionclone () const override
 
double getXShift () const
 
 HeavisideFunction (const HeavisideFunction &)=default
 
 HeavisideFunction (double x_shift)
 Construct a Heaviside function with the given threshold.
 
std::vector< double > operator() (const std::vector< double > &input) override
 Apply the activation function to input and return the result.
 
bool operator== (const HeavisideFunction &other) const
 
void print () const override
 
std::string toString () const override
 
 ~HeavisideFunction () override=default
 
- Public Member Functions inherited from dnf_composer::element::ActivationFunction
 ActivationFunction ()=default
 
 ActivationFunction (const ActivationFunction &)=default
 
ActivationFunctionoperator= (const ActivationFunction &)=delete
 
virtual ~ActivationFunction ()=default
 

Public Attributes

double x_shift
 Threshold; activation strictly above this value maps to 1.
 
- Public Attributes inherited from dnf_composer::element::ActivationFunction
ActivationFunctionType type
 Concrete function type.
 

Detailed Description

Heaviside step function.

Formula: $ \sigma(x) = \begin{cases} 1 & x > x\_shift \\ 0 & x \le x\_shift \end{cases} $

Cross-framework equivalence:

Framework Type / call Note
dnf-composer HeavisideFunction(x_shift) maps 1 when x > x_shift
cedar HeavisideSigmoid(theta=x_shift) identical formula (strict >)
cosivina no built-in equivalent

Constructor & Destructor Documentation

◆ HeavisideFunction() [1/2]

dnf_composer::element::HeavisideFunction::HeavisideFunction ( const HeavisideFunction )
default

◆ HeavisideFunction() [2/2]

dnf_composer::element::HeavisideFunction::HeavisideFunction ( double  x_shift)
explicit

Construct a Heaviside function with the given threshold.

Parameters
x_shiftActivation threshold.

◆ ~HeavisideFunction()

dnf_composer::element::HeavisideFunction::~HeavisideFunction ( )
overridedefault

Member Function Documentation

◆ apply()

void dnf_composer::element::HeavisideFunction::apply ( const std::vector< double > &  input,
std::vector< double > &  out 
) const
overridevirtual

Apply the activation function in-place into a pre-allocated out buffer. out must already be sized to input.size(). No heap allocation occurs.

Implements dnf_composer::element::ActivationFunction.

◆ clone()

std::unique_ptr< ActivationFunction > dnf_composer::element::HeavisideFunction::clone ( ) const
overridevirtual

◆ getXShift()

double dnf_composer::element::HeavisideFunction::getXShift ( ) const

◆ operator()()

std::vector< double > dnf_composer::element::HeavisideFunction::operator() ( const std::vector< double > &  input)
overridevirtual

Apply the activation function to input and return the result.

Implements dnf_composer::element::ActivationFunction.

Here is the call graph for this function:

◆ operator==()

bool dnf_composer::element::HeavisideFunction::operator== ( const HeavisideFunction other) const

◆ print()

void dnf_composer::element::HeavisideFunction::print ( ) const
overridevirtual

Implements dnf_composer::element::ActivationFunction.

Here is the call graph for this function:

◆ toString()

std::string dnf_composer::element::HeavisideFunction::toString ( ) const
overridevirtual

Implements dnf_composer::element::ActivationFunction.

Here is the caller graph for this function:

Member Data Documentation

◆ x_shift

double dnf_composer::element::HeavisideFunction::x_shift

Threshold; activation strictly above this value maps to 1.


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