7 #include "../activations/ActivationBase.hpp" 14 template <typename SCALAR, typename TRAIT = typename ct::core::tpl::TraitSelector<SCALAR>::Trait>
21 sigma2inv_ =
SCALAR(1.0) / (
SCALAR(2.0) * sigma_ * sigma_);
22 factor_ =
SCALAR(1.0) / sqrt(
SCALAR(2.0) * M_PI * sigma_ * sigma_);
26 : mu_(arg.mu_), sigma_(arg.sigma_), sigma2inv_(arg.sigma2inv_), factor_(arg.factor_)
30 virtual void loadConfigFile(
const std::string& filename,
const std::string& termName,
bool verbose =
false)
override 32 boost::property_tree::ptree pt;
33 boost::property_tree::read_info(filename, pt);
34 mu_ = pt.get<
SCALAR>(termName +
".mu");
35 sigma_ = pt.get<
SCALAR>(termName +
".sigma");
37 sigma2inv_ = -
SCALAR(1.0) / (
SCALAR(2.0) * sigma_ * sigma_);
38 factor_ =
SCALAR(1.0) / sqrt(
SCALAR(2.0) * M_PI * sigma_ * sigma_);
44 return factor_ * exp((t - mu_) * (t - mu_) * sigma2inv_);
49 std::cout <<
"RBF costfunction time activation" << std::endl;
50 std::cout <<
"mu: " << mu_ <<
"s \t sigma: " << sigma_ <<
"s" << std::endl;
RBFGaussActivation(const SCALAR mu, const SCALAR sigma)
Definition: RBFGaussActivation.h:19
virtual bool isActive(const SCALAR t) override
return if term is active
Definition: RBFGaussActivation.h:41
RBFGaussActivation()
Definition: RBFGaussActivation.h:18
virtual void loadConfigFile(const std::string &filename, const std::string &termName, bool verbose=false) override
load activations from file
Definition: RBFGaussActivation.h:30
RBFGaussActivation(const RBFGaussActivation &arg)
Definition: RBFGaussActivation.h:25
Definition: RBFGaussActivation.h:15
CppAD::AD< CppAD::cg::CG< double > > SCALAR
virtual ~RBFGaussActivation()
Definition: RBFGaussActivation.h:24
Definition: ActivationBase.hpp:18
const bool verbose
Definition: JacobianCGTest.h:19
virtual void printInfo() override
print to console
Definition: RBFGaussActivation.h:47
virtual SCALAR computeActivation(const SCALAR t) override
compute activation multiplier based on scalar input
Definition: RBFGaussActivation.h:42