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
Namespaces | Enumerations | Functions
math.h File Reference
#include <vector>
#include <array>
#include <cmath>
#include <algorithm>
#include <numeric>
#include <functional>
#include <random>
#include <numbers>
#include <fstream>
Include dependency graph for math.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  dnf_composer
 
namespace  dnf_composer::tools
 
namespace  dnf_composer::tools::math
 

Enumerations

enum class  dnf_composer::tools::math::ReduceOp { dnf_composer::tools::math::SUM , dnf_composer::tools::math::AVERAGE , dnf_composer::tools::math::MAXIMUM , dnf_composer::tools::math::MINIMUM }
 

Functions

template<typename T >
std::vector< T > dnf_composer::tools::math::absSigmoid (const std::vector< T > &x, T beta, T x0)
 AbsSigmoid: rational approximation of the logistic sigmoid.
 
template<typename T >
void dnf_composer::tools::math::broadcast1DTo2D_into (std::vector< T > &out, const std::vector< T > &profile, int size_x, int size_y, bool alongX)
 
template<typename T >
dnf_composer::tools::math::calculateVectorAvg (const std::vector< T > &vec)
 
template<typename T >
dnf_composer::tools::math::calculateVectorNorm (const std::vector< T > &vec)
 
template<typename T >
dnf_composer::tools::math::calculateVectorSum (const std::vector< T > &vec)
 
double dnf_composer::tools::math::circular_gaussian_2d (double x, double y, double mu_x, double mu_y, double sigma, double A)
 
template<typename T >
std::vector< T > dnf_composer::tools::math::circularGauss (uint32_t size, const T &sigma, const T &position)
 
template<typename T >
bool dnf_composer::tools::math::compareVectors (const std::vector< T > &vec1, const std::vector< T > &vec2, T threshold)
 
std::array< int, 2 > dnf_composer::tools::math::computeKernelRange (double sigma, int cutOfFactor, int fieldSize, bool circular)
 
template<typename T >
std::vector< T > dnf_composer::tools::math::conv (std::vector< T > const &f, std::vector< T > const &g)
 
template<typename T >
std::vector< T > dnf_composer::tools::math::conv2d_separable (const std::vector< T > &field, const std::vector< T > &kernel_x, const std::vector< T > &kernel_y, int size_x, int size_y, const std::vector< int > &extIndex_x, const std::vector< int > &extIndex_y)
 
template<typename T >
void dnf_composer::tools::math::conv2d_separable_into (std::vector< T > &out, std::vector< T > &tmp, const std::vector< T > &field, const std::vector< T > &kernel_x, const std::vector< T > &kernel_y, int size_x, int size_y, const std::vector< int > &extIndex_x, const std::vector< int > &extIndex_y)
 
template<typename T >
std::vector< T > dnf_composer::tools::math::conv_same (std::vector< T > const &f, std::vector< T > const &g)
 
template<typename T >
void dnf_composer::tools::math::conv_same_into (std::vector< T > &out, const std::vector< T > &f, const std::vector< T > &g)
 
template<typename T >
std::vector< T > dnf_composer::tools::math::conv_valid (std::vector< T > const &f, std::vector< T > const &g)
 
template<typename T >
void dnf_composer::tools::math::conv_valid_into (std::vector< T > &out, const std::vector< T > &f, const std::vector< T > &g)
 
std::vector< int > dnf_composer::tools::math::createExtendedIndex (int fieldSize, const std::array< int, 2 > &kernelRange)
 
template<typename T >
std::vector< std::vector< T > > dnf_composer::tools::math::deltaLearningRuleKroghHertz (std::vector< std::vector< T > > &weights, const std::vector< T > &input, const std::vector< T > &targetOutput, const std::vector< T > &actualOutput, double learningRate)
 
template<typename T >
std::vector< std::vector< T > > dnf_composer::tools::math::deltaLearningRuleWidrowHoff (std::vector< std::vector< T > > &weights, const std::vector< T > &input, const std::vector< T > &actualOutput, const std::vector< T > &targetOutput, double learningRate)
 
template<typename T >
std::vector< T > dnf_composer::tools::math::flattenMatrix (const std::vector< std::vector< T > > &matrix)
 
template<typename T >
std::vector< T > dnf_composer::tools::math::gauss (const std::vector< int > &rangeX, const T &position, const T &sigma)
 
template<typename T >
std::vector< T > dnf_composer::tools::math::gauss (int size, const T &sigma, const T &position)
 
template<typename T >
std::vector< T > dnf_composer::tools::math::gaussDerivative (const std::vector< int > &rangeX, const T &position, const T &sigma, const T &amplitude)
 
template<typename T >
std::vector< T > dnf_composer::tools::math::gaussDerivativeNorm (const std::vector< int > &rangeX, const T &position, const T &sigma, const T &amplitude)
 
double dnf_composer::tools::math::gaussian_2d (double x, double y, double mu_x, double mu_y, double sigma_x, double sigma_y, double A)
 
double dnf_composer::tools::math::gaussian_2d_periodic (double x, double y, double mu_x, double mu_y, double sigma, double A, double max_x, double max_y)
 
template<typename T >
std::vector< T > dnf_composer::tools::math::gaussNorm (const std::vector< int > &rangeX, const T &position, const T &sigma)
 
std::vector< double > dnf_composer::tools::math::generateNormalVector (int size)
 
template<typename T >
std::vector< T > dnf_composer::tools::math::heaviside (const std::vector< T > &x, T threshold)
 
template<typename T >
std::vector< T > dnf_composer::tools::math::hebbLearningRule (std::vector< T > &weights, const std::vector< T > &input, const std::vector< T > &output, double learningRate)
 
template<typename T >
std::vector< T > dnf_composer::tools::math::nonCircularGauss (uint32_t size, const T &sigma, const T &position)
 
double dnf_composer::tools::math::normalize (const double value, const double min, const double max)
 
template<typename T >
std::vector< T > dnf_composer::tools::math::normalize (const std::vector< T > &vector)
 
template<typename T >
std::vector< T > dnf_composer::tools::math::obtainCircularVector (const std::vector< int > &indices, const std::vector< T > &contents)
 
template<typename T >
void dnf_composer::tools::math::obtainCircularVector_into (std::vector< T > &out, const std::vector< int > &indices, const std::vector< T > &contents)
 
template<typename T >
std::vector< T > dnf_composer::tools::math::ojaLearningRule (std::vector< T > &weights, const std::vector< T > &input, const std::vector< T > &output, double learningRate)
 
template<typename T >
void dnf_composer::tools::math::reduce2DAxis_into (std::vector< T > &out, const std::vector< T > &field, int size_x, int size_y, bool keepX, ReduceOp op)
 
template<typename T >
std::vector< T > dnf_composer::tools::math::resample (const std::vector< T > &input, int outputSize)
 
template<typename T >
void dnf_composer::tools::math::resampleCubicInto (const std::vector< T > &input, std::vector< T > &output)
 
template<typename T >
void dnf_composer::tools::math::resampleInto (const std::vector< T > &input, std::vector< T > &output)
 
template<typename T >
void dnf_composer::tools::math::resampleNearestInto (const std::vector< T > &input, std::vector< T > &output)
 
template<typename T >
std::vector< T > dnf_composer::tools::math::sigmoid (const std::vector< T > &x, T beta, T x0)
 
template<typename T >
std::vector< T > dnf_composer::tools::math::sumGauss (const std::vector< T > &gauss1, const std::vector< T > &gauss2)
 
double dnf_composer::tools::math::wrap (double value, double max_value)