|
Dynamic Neural Field Composer 0.0.0
A C++20 library and interactive application for building and simulating Dynamic Neural Field (DNF) architectures.
|
Heaviside step function. More...
#include <activation_function.h>
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< ActivationFunction > | clone () 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 | |
| ActivationFunction & | operator= (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. | |
Heaviside step function.
Formula: 
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 | — |
|
default |
|
explicit |
Construct a Heaviside function with the given threshold.
| x_shift | Activation threshold. |
|
overridedefault |
|
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.
|
overridevirtual |
Implements dnf_composer::element::ActivationFunction.
| double dnf_composer::element::HeavisideFunction::getXShift | ( | ) | const |
|
overridevirtual |
Apply the activation function to input and return the result.
Implements dnf_composer::element::ActivationFunction.
| bool dnf_composer::element::HeavisideFunction::operator== | ( | const HeavisideFunction & | other | ) | const |
|
overridevirtual |
|
overridevirtual |
| double dnf_composer::element::HeavisideFunction::x_shift |
Threshold; activation strictly above this value maps to 1.