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 | Protected Member Functions | Protected Attributes | List of all members
dnf_composer::element::NeuralField Class Referencefinal

Continuous attractor neural field — the core DFT building block. More...

#include <neural_field.h>

Inheritance diagram for dnf_composer::element::NeuralField:
Collaboration diagram for dnf_composer::element::NeuralField:

Public Member Functions

std::shared_ptr< Elementclone () const override
 
std::vector< NeuralFieldBumpgetBumps () const
 Return all currently detected above-threshold bumps.
 
bool getComputeStateMetrics () const
 
double getHighestActivation () const
 
double getLowestActivation () const
 
NeuralFieldParameters getParameters () const
 
std::shared_ptr< KernelgetSelfExcitationKernel () const
 Return the registered self-excitation kernel, if any.
 
double getStabilityThreshold () const
 
void init () override
 Initialize the element (called once before the simulation loop).
 
bool isStable () const
 
 NeuralField (const ElementCommonParameters &elementCommonParameters, const NeuralFieldParameters &parameters)
 Construct a neural field.
 
void setComputeStateMetrics (bool enable)
 Enable or disable per-step state-metric computation (stability, bumps, min/max). The default (enabled) path uses a single fused O(N) pass and is fast enough for normal use. Disable only as an advanced micro-optimisation for headless batch runs where bump data and stability checks are never needed. Default: true (full state tracking enabled).
 
void setParameters (const NeuralFieldParameters &parameters)
 
void setThresholdForStability (const double threshold)
 Set the stability convergence threshold.
 
void step (double t, double deltaT) override
 Advance the element by one time step.
 
std::string toString () const override
 
- Public Member Functions inherited from dnf_composer::element::Element
virtual void addInput (const std::shared_ptr< Element > &inputElement, const std::string &inputComponent="output")
 Register inputElement as an upstream source for this element.
 
void buildInputCache ()
 Cache raw pointers to input component data. Call after all element init()s complete.
 
virtual void changeDimensions (const ElementDimensions &newDimensions)
 Resize all components to newDimensions and re-initialize.
 
void close ()
 
 Element (const ElementCommonParameters &parameters)
 Construct an element with the given common parameters.
 
std::vector< double > getComponent (const std::string &componentName)
 Return a copy of the named component vector.
 
std::vector< std::string > getComponentList () const
 
std::vector< double > * getComponentPtr (const std::string &componentName)
 
const std::unordered_map< std::string, std::vector< double > > * getComponents () const
 Return a read-only pointer to the full components map.
 
ElementCommonParameters getElementCommonParameters () const
 
std::vector< std::shared_ptr< Element > > getInputs ()
 
std::unordered_map< std::shared_ptr< Element >, std::string > getInputsAndComponents ()
 Return all inputs mapped to the component name they expose.
 
ElementLabel getLabel () const
 
int getMaxSpatialDimension () const
 
std::vector< std::shared_ptr< Element > > getOutputs ()
 
int getSize () const
 Return the number of spatial samples (size = round(x_max / d_x)).
 
double getStepSize () const
 Return the spatial resolution (d_x).
 
int getUniqueIdentifier () const
 
std::string getUniqueName () const
 
bool hasInput () const
 
bool hasInput (const std::string &inputElementName, const std::string &inputComponent)
 
bool hasInput (int inputElementId, const std::string &inputComponent)
 
bool hasOutput () const
 
bool hasOutput (const std::string &outputElementName, const std::string &outputComponent)
 
bool hasOutput (int outputElementId, const std::string &outputComponent)
 
void print () const
 
void removeInput (const std::string &inputElementId)
 
void removeInput (int uniqueId)
 
void removeInputs ()
 
void removeOutput (const std::string &outputElementId)
 Deregister this element as an input of outputElementId.
 
void removeOutput (int uniqueId)
 Deregister this element as an input of the element with uniqueId.
 
void removeOutputs ()
 
void setUniqueName (const std::string &name)
 
void updateInput ()
 Pull data from all registered input elements into this element's components.
 
virtual ~Element ()=default
 

Protected Member Functions

void calculateActivation (double t, double deltaT)
 
void calculateOutput ()
 
void updateBumps (double deltaT)
 
void updateState (double deltaT)
 

Protected Attributes

NeuralFieldParameters parameters
 Dynamics parameters (tau, h, activation function).
 
NeuralFieldState state
 Runtime state (bumps, stability, min/max).
 
- Protected Attributes inherited from dnf_composer::element::Element
ElementCommonParameters commonParameters
 Name, label, and spatial dimensions.
 
std::unordered_map< std::string, std::vector< double > > components
 Named data arrays (e.g. "output").
 
std::unordered_map< std::shared_ptr< Element >, std::string > inputs
 Upstream elements and the component they expose.
 
std::unordered_map< std::shared_ptr< Element >, std::string > outputs
 Downstream elements that read this element's output.
 

Detailed Description

Continuous attractor neural field — the core DFT building block.

Implements a one-dimensional neural field with Amari-type dynamics:

tau * du/dt = -u + h + s(x, t) + (w * f(u))(x)

where u is activation, h the resting level, s the summed external input, and w the lateral interaction kernel convolved with the output f(u) (determined by the activation function).

Constructor & Destructor Documentation

◆ NeuralField()

dnf_composer::element::NeuralField::NeuralField ( const ElementCommonParameters elementCommonParameters,
const NeuralFieldParameters parameters 
)

Construct a neural field.

Parameters
elementCommonParametersName, label, and spatial dimensions.
parametersField dynamics parameters.

Member Function Documentation

◆ calculateActivation()

void dnf_composer::element::NeuralField::calculateActivation ( double  t,
double  deltaT 
)
protected
Here is the caller graph for this function:

◆ calculateOutput()

void dnf_composer::element::NeuralField::calculateOutput ( )
protected
Here is the caller graph for this function:

◆ clone()

std::shared_ptr< Element > dnf_composer::element::NeuralField::clone ( ) const
overridevirtual

◆ getBumps()

std::vector< NeuralFieldBump > dnf_composer::element::NeuralField::getBumps ( ) const
inline

Return all currently detected above-threshold bumps.

◆ getComputeStateMetrics()

bool dnf_composer::element::NeuralField::getComputeStateMetrics ( ) const
inline

◆ getHighestActivation()

double dnf_composer::element::NeuralField::getHighestActivation ( ) const
inline

◆ getLowestActivation()

double dnf_composer::element::NeuralField::getLowestActivation ( ) const
inline

◆ getParameters()

NeuralFieldParameters dnf_composer::element::NeuralField::getParameters ( ) const

◆ getSelfExcitationKernel()

std::shared_ptr< Kernel > dnf_composer::element::NeuralField::getSelfExcitationKernel ( ) const

Return the registered self-excitation kernel, if any.

◆ getStabilityThreshold()

double dnf_composer::element::NeuralField::getStabilityThreshold ( ) const
inline

◆ init()

void dnf_composer::element::NeuralField::init ( )
overridevirtual

Initialize the element (called once before the simulation loop).

Implements dnf_composer::element::Element.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ isStable()

bool dnf_composer::element::NeuralField::isStable ( ) const

◆ setComputeStateMetrics()

void dnf_composer::element::NeuralField::setComputeStateMetrics ( bool  enable)
inline

Enable or disable per-step state-metric computation (stability, bumps, min/max). The default (enabled) path uses a single fused O(N) pass and is fast enough for normal use. Disable only as an advanced micro-optimisation for headless batch runs where bump data and stability checks are never needed. Default: true (full state tracking enabled).

◆ setParameters()

void dnf_composer::element::NeuralField::setParameters ( const NeuralFieldParameters parameters)
Here is the call graph for this function:

◆ setThresholdForStability()

void dnf_composer::element::NeuralField::setThresholdForStability ( const double  threshold)
inline

Set the stability convergence threshold.

Parameters
thresholdNew threshold value (default 0.895).

◆ step()

void dnf_composer::element::NeuralField::step ( double  t,
double  deltaT 
)
overridevirtual

Advance the element by one time step.

Parameters
tCurrent simulation time.
deltaTIntegration step size.

Implements dnf_composer::element::Element.

Here is the call graph for this function:

◆ toString()

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

Implements dnf_composer::element::Element.

Here is the call graph for this function:

◆ updateBumps()

void dnf_composer::element::NeuralField::updateBumps ( double  deltaT)
protected
Here is the caller graph for this function:

◆ updateState()

void dnf_composer::element::NeuralField::updateState ( double  deltaT)
protected
Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ parameters

NeuralFieldParameters dnf_composer::element::NeuralField::parameters
protected

Dynamics parameters (tau, h, activation function).

◆ state

NeuralFieldState dnf_composer::element::NeuralField::state
protected

Runtime state (bumps, stability, min/max).


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