RoboidControl-cpp/Activation.h
2024-01-02 11:52:14 +01:00

32 lines
869 B
C++

#ifndef RC_ACTIVATION_H
#define RC_ACTIVATION_H
#include <math.h>
namespace Passer {
namespace RoboidControl {
/// @brief Activation function for control
/// @note This is mainly for future use :-)
class Activation {
public:
static float HeavisideStep(float inputValue, float bias = 0); // Range: {0,1}
static float Tanh(float inputValue); // Range: (-1, 1)
static float Sigmoid(float inputValue); // Range: (0, 1)
static float Linear(float inputValue, float bias = 0, float range = 0);
static float Quadratic(float inputValue, float bias = 0,
float range = 0); // minValue = bias
static float ParticleLife(float minValue, float maxValue, float attraction,
float inputValue); // minValue = bias
};
} // namespace RoboidControl
} // namespace Passer
using namespace Passer::RoboidControl;
#endif