Functions | |
real VERVE_CALL | getAttributeReal (const TiXmlNode *nodePtr, const std::string &name) |
int VERVE_CALL | getAttributeInt (const TiXmlNode *nodePtr, const std::string &name) |
bool VERVE_CALL | getAttributeBool (const TiXmlNode *nodePtr, const std::string &name) |
std::string VERVE_CALL | getAttributeString (const TiXmlNode *nodePtr, const std::string &name) |
real | abs (real value) |
real | sqrt (real value) |
real | exp (real exponent) |
real | pow (real base, real exponent) |
int | roundToInt (real value) |
real | checkParamValid (real value, real rangeMin, real rangeMax, const std::string &callingFunction) |
real | calcDecayConstant (real decayPercent, real decayTime, real dt) |
real | calcDecayConstant (real timeConstant, real dt) |
bool | randomBool () |
int | randomIntUniform (int min, int max) |
real | randomRealUniform (real min, real max) |
real | randomRealGauss (real variance) |
real | scaleZeroToOne (real value, real rangeMin, real rangeMax) |
real | scaleNegOneToOne (real value, real rangeMin, real rangeMax) |
|
Returns the absolute value of a real number.
|
|
Another method of calculating decay constants that uses time constants instead of "decay percents" and "decay times.".
Definition at line 168 of file Globals.h. References calcDecayConstant(), and verve::VERVE_E. |
|
This decay function calculates the decay constant necessary to reduce a value across the given dt at a rate of decayPercent per decayTime seconds. For example, to decay some parameter p by 10% per 0.2 seconds across a dt of 0.01, simply call p *= calcDecayConstant(0.1, 0.2, 0.01). Here, p will asymptote to 0. Another way to use it is to decay the error between a desired/equilibrium value and the actual value: p += (1-calcDecayConstant(0.1, 0.2, 0.01)) * (desiredValue - p). This reduces the error between p's desired and actual value by 10% per 0.2 seconds across a dt of 0.01. Here, p will asymptote to its desired value. A constant for a faster rate of decay can be calculated by using a higher decayPercent and/or a lower decayTime (the combination of the two helps achieve a wider range of decay constants with limited numerical precision). Note that a decayPercent of 1 or a decayTime of 0 will always return 0, instantly decaying the parameter to 0. Definition at line 146 of file Globals.h. References pow(). Referenced by calcDecayConstant(), verve::PredictiveModel::setDeltaLearningRate(), verve::RLModule::setETraceTimeConstant(), verve::RLModule::setTDDiscountTimeConstant(), and verve::RLModule::setTDLearningRate(). |
|
Checks whether the given value is within its acceptable range. If not, it clamps the value and logs a warning message. Returns the (possibly clamped) value. Definition at line 102 of file Globals.h. References VERVE_LOGGER. |
|
Returns the value of e raised to the given exponent.
Definition at line 57 of file Globals.h. Referenced by verve::Neuron::updateFiringRateSigmoid(). |
|
Returns the boolean attribute value of the given name from the given XML node. Valid string values are "true", "false", "1", and "0". Returns false and prints an error message if the attribute doesn't exist or if its value is not a valid string. Definition at line 75 of file Globals.cpp. References VERVE_LOGGER. |
|
Returns the integer attribute value of the given name from the given XML node. Returns 0 and prints an error message if the attribute doesn't exist. Definition at line 53 of file Globals.cpp. References VERVE_LOGGER. |
|
Returns the real attribute value of the given name from the given XML node. Returns 0 and prints an error message if the attribute doesn't exist. Definition at line 31 of file Globals.cpp. References VERVE_LOGGER. |
|
Returns the string attribute value of the given name from the given XML node. Returns an empty string and prints an error message if the attribute doesn't exist. Definition at line 115 of file Globals.cpp. References VERVE_LOGGER. |
|
Returns the value of the given base raised to the given exponent.
Definition at line 67 of file Globals.h. Referenced by calcDecayConstant(), verve::RBFPopulation::computeMaxActivationSum(), and verve::RBFInputData::computeNumUniqueStates(). |
|
Returns a random boolean value with equal probability of being true or false.
|
|
Returns a random integer between min and max using a uniform probability distribution.
|
|
Returns a random real value using a normal (Gaussian) probability distribution with mean 0 and the given variance. Variance = standard deviation^2. Originally from Numerical Recipes in C, Second Edition. Definition at line 212 of file Globals.h. References sqrt(). Referenced by verve::Projection::setInitialConnectionWeight(). |
|
Returns a random real value between min and max using a uniform probability distribution.
|
|
Rounds the value to the closest integer.
|
|
Scales a real value linearly to the interval [-1, 1], given some range of possible values. If the range is zero, returns zero. Values outside the given range will be clamped. Definition at line 281 of file Globals.h. References scaleZeroToOne(). |
|
Scales a real value linearly to the interval [0, 1], given some range of possible values. If the range is zero, returns zero. Values outside the given range will be clamped. Definition at line 245 of file Globals.h. Referenced by scaleNegOneToOne(). |
|
Returns the square root of a real number.
Definition at line 47 of file Globals.h. Referenced by randomRealGauss(). |