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::AbsSigmoidFunction Struct Referencefinal

Rational (absolute-value) sigmoid — cedar's default activation function. More...

#include <activation_function.h>

Inheritance diagram for dnf_composer::element::AbsSigmoidFunction:
Collaboration diagram for dnf_composer::element::AbsSigmoidFunction:

Public Member Functions

 AbsSigmoidFunction (const AbsSigmoidFunction &)=default
 
 AbsSigmoidFunction (double x_shift, double beta)
 Construct an AbsSigmoid with the given threshold and steepness.
 
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 getBeta () const
 
double getXShift () const
 
std::vector< double > operator() (const std::vector< double > &input) override
 Apply the activation function to input and return the result.
 
bool operator== (const AbsSigmoidFunction &other) const
 
void print () const override
 
std::string toString () const override
 
 ~AbsSigmoidFunction () 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 beta
 Steepness parameter — cedar/cosivina naming (larger = steeper).
 
double x_shift
 Inflection point / threshold (cedar: theta).
 
- Public Attributes inherited from dnf_composer::element::ActivationFunction
ActivationFunctionType type
 Concrete function type.
 

Detailed Description

Rational (absolute-value) sigmoid — cedar's default activation function.

Formula: $ \sigma(x) = \frac{1}{2}\left(1 + \frac{\beta(x - x\_shift)}{1 + \beta|x - x\_shift|}\right) $

This is computationally cheaper than SigmoidFunction because it avoids std::exp. At $\beta \ge 20$ the two functions are numerically indistinguishable (max pointwise error < 0.001).

Cross-framework equivalence:

Framework Type / call Exact?
dnf-composer AbsSigmoidFunction(x_shift, beta)
cedar AbsSigmoid(beta=beta, theta=x_shift)
cosivina no built-in equivalent

Approximate equivalence to ExpSigmoid: Use SigmoidFunction(x_shift, beta) or cosivina sigmoid(beta=beta, x0=x_shift) — identical for $\beta \ge 20$.

Note
Cedar uses AbsSigmoid with $\beta = 100$ by default (near-Heaviside). Published cedar parameter sets assume this steep nonlinearity.

Constructor & Destructor Documentation

◆ AbsSigmoidFunction() [1/2]

dnf_composer::element::AbsSigmoidFunction::AbsSigmoidFunction ( const AbsSigmoidFunction )
default

◆ AbsSigmoidFunction() [2/2]

dnf_composer::element::AbsSigmoidFunction::AbsSigmoidFunction ( double  x_shift,
double  beta 
)

Construct an AbsSigmoid with the given threshold and steepness.

Parameters
x_shiftInflection point of the sigmoid.
betaSlope parameter.

◆ ~AbsSigmoidFunction()

dnf_composer::element::AbsSigmoidFunction::~AbsSigmoidFunction ( )
overridedefault

Member Function Documentation

◆ apply()

void dnf_composer::element::AbsSigmoidFunction::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::AbsSigmoidFunction::clone ( ) const
overridevirtual

◆ getBeta()

double dnf_composer::element::AbsSigmoidFunction::getBeta ( ) const

◆ getXShift()

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

◆ operator()()

std::vector< double > dnf_composer::element::AbsSigmoidFunction::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::AbsSigmoidFunction::operator== ( const AbsSigmoidFunction other) const

◆ print()

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

Implements dnf_composer::element::ActivationFunction.

Here is the call graph for this function:

◆ toString()

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

Implements dnf_composer::element::ActivationFunction.

Here is the caller graph for this function:

Member Data Documentation

◆ beta

double dnf_composer::element::AbsSigmoidFunction::beta

Steepness parameter — cedar/cosivina naming (larger = steeper).

◆ x_shift

double dnf_composer::element::AbsSigmoidFunction::x_shift

Inflection point / threshold (cedar: theta).


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