28 template <typename SCALAR, typename TRAIT = typename ct::core::tpl::TraitSelector<SCALAR>::Trait>
51 boost::property_tree::ptree pt;
52 boost::property_tree::read_info(filename, pt);
60 ub_ = pt.get<
SCALAR>(termName +
".upper_bound");
61 }
catch (std::exception& e)
64 std::cout << e.what() << std::endl;
71 lb_ = pt.get<
SCALAR>(termName +
".lower_bound");
72 }
catch (std::exception& e)
75 std::cout << e.what() << std::endl;
82 throw std::runtime_error(
"BarrierActivation: lower bound cannot be greater than upper bound.");
86 throw std::runtime_error(
"BarrierActivation: alpha must be >= 0");
140 std::cout <<
"Barrier Activation with upper bound " <<
ub_ <<
", steepness-multiplier " <<
alpha_ 145 std::cout <<
"Barrier Activation with lower bound " <<
lb_ <<
", steepness-multiplier " <<
alpha_ virtual ~BarrierActivation()
destructor
Definition: BarrierActivation.hpp:47
void setUpperBoundOnly(const SCALAR &ub, const SCALAR &alpha=(SCALAR) 1.0)
activate the upper bound while deactivating the lower bound
Definition: BarrierActivation.hpp:109
virtual void loadConfigFile(const std::string &filename, const std::string &termName, bool verbose=false)
load activations from file
Definition: BarrierActivation.hpp:49
Definition: BarrierActivation.hpp:29
CppAD::AD< CppAD::cg::CG< double > > SCALAR
void setLowerBoundOnly(const SCALAR &lb, const SCALAR &alpha=(SCALAR) 1.0)
activate the lower bound while deactivating the upper bound.
Definition: BarrierActivation.hpp:96
SCALAR lb_
the upper bound
Definition: BarrierActivation.hpp:158
BarrierActivation(const SCALAR &ub, const SCALAR &lb, const SCALAR &alpha=SCALAR(1.0))
constructor with input arguments for upper and lower bound
Definition: BarrierActivation.hpp:42
BarrierActivation()
trivial constructor, which deactivates upper and lower bounds.
Definition: BarrierActivation.hpp:33
Definition: ActivationBase.hpp:18
const bool verbose
Definition: JacobianCGTest.h:19
bool lb_active_
boolean indicating of lower bound is activated
Definition: BarrierActivation.hpp:154
virtual SCALAR computeActivation(const SCALAR x) override
compute activation multiplier based on scalar input
Definition: BarrierActivation.hpp:118
SCALAR alpha_
steepness-multiplier (controls how 'aggressive' the boundary is)
Definition: BarrierActivation.hpp:160
SCALAR ub_
the upper bound
Definition: BarrierActivation.hpp:156
virtual void printInfo()
print to console
Definition: BarrierActivation.hpp:136
virtual SCALAR secondOrderDerivative(const SCALAR x)
second order derivative of this activation
Definition: BarrierActivation.hpp:130
virtual SCALAR firstOrderDerivative(const SCALAR x) override
first order derivative of this activation
Definition: BarrierActivation.hpp:124
bool ub_active_
boolean indicating if upper bound is activated
Definition: BarrierActivation.hpp:152