20 #ifndef TMVA_TREEINFERENCE_OBJECTIVES
21 #define TMVA_TREEINFERENCE_OBJECTIVES
29 namespace Experimental {
30 namespace Objectives {
34 inline T Logistic(T value)
36 return 1.0 / (1.0 + std::exp(-1.0 * value));
41 inline T Identity(T value)
51 inline T Exponential(T value)
53 return std::exp(value);
58 std::function<T(T)> GetFunction(
const std::string &name)
60 if (name.compare(
"identity") == 0)
61 return std::function<T(T)>(Identity<T>);
62 else if (name.compare(
"logistic") == 0)
63 return std::function<T(T)>(Logistic<T>);
64 else if (name.compare(
"softmax") == 0)
65 return std::function<T(T)>(Exponential<T>);
67 throw std::runtime_error(
"Objective function with name \"" + name +
"\" is not implemented.");
74 #endif // TMVA_TREEINFERENCE_OBJECTIVES