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

Logistic (exponential) sigmoid. More...

#include <activation_function.h>

Inheritance diagram for dnf_composer::element::SigmoidFunction:
Collaboration diagram for dnf_composer::element::SigmoidFunction:

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 getSteepness () 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 SigmoidFunction &other) const
 
void print () const override
 
 SigmoidFunction (const SigmoidFunction &)=default
 
 SigmoidFunction (double x_shift, double steepness)
 Construct a sigmoid with the given inflection point and slope.
 
std::string toString () const override
 
 ~SigmoidFunction () 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 steepness
 Slope at the inflection point (cedar/cosivina: beta).
 
double x_shift
 Inflection point of the sigmoid (cedar: theta; cosivina: x0).
 
- Public Attributes inherited from dnf_composer::element::ActivationFunction
ActivationFunctionType type
 Concrete function type.
 

Detailed Description

Logistic (exponential) sigmoid.

Formula: $ \sigma(x) = \frac{1}{1 + e^{-\mathrm{steepness}(x - x\_shift)}} $

Cross-framework equivalence (formula-identical):

Framework Type / call
dnf-composer SigmoidFunction(x_shift, steepness)
cedar ExpSigmoid(beta=steepness, theta=x_shift)
cosivina sigmoid(beta=steepness, x0=x_shift)

All three use the same formula. Only the parameter names differ.

Constructor & Destructor Documentation

◆ SigmoidFunction() [1/2]

dnf_composer::element::SigmoidFunction::SigmoidFunction ( const SigmoidFunction )
default

◆ SigmoidFunction() [2/2]

dnf_composer::element::SigmoidFunction::SigmoidFunction ( double  x_shift,
double  steepness 
)

Construct a sigmoid with the given inflection point and slope.

Parameters
x_shiftActivation value at the inflection (threshold).
steepnessSlope parameter (larger = steeper transition).

◆ ~SigmoidFunction()

dnf_composer::element::SigmoidFunction::~SigmoidFunction ( )
overridedefault

Member Function Documentation

◆ apply()

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

◆ getSteepness()

double dnf_composer::element::SigmoidFunction::getSteepness ( ) const

◆ getXShift()

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

◆ operator()()

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

◆ print()

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

Implements dnf_composer::element::ActivationFunction.

Here is the call graph for this function:

◆ toString()

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

Implements dnf_composer::element::ActivationFunction.

Here is the caller graph for this function:

Member Data Documentation

◆ steepness

double dnf_composer::element::SigmoidFunction::steepness

Slope at the inflection point (cedar/cosivina: beta).

◆ x_shift

double dnf_composer::element::SigmoidFunction::x_shift

Inflection point of the sigmoid (cedar: theta; cosivina: x0).


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