MLPACK  1.0.7
hyperbolic_tangent_kernel.hpp
Go to the documentation of this file.
1 
22 #ifndef __MLPACK_CORE_KERNELS_HYPERBOLIC_TANGENT_KERNEL_HPP
23 #define __MLPACK_CORE_KERNELS_HYPERBOLIC_TANGENT_KERNEL_HPP
24 
25 #include <mlpack/core.hpp>
26 
27 namespace mlpack {
28 namespace kernel {
29 
39 {
40  public:
45  { }
46 
55  scale(scale), offset(offset)
56  { }
57 
67  template<typename VecType>
68  double Evaluate(const VecType& a, const VecType& b)
69  {
70  return tanh(scale * arma::dot(a, b) + offset);
71  }
72 
74  double Scale() const { return scale; }
76  double& Scale() { return scale; }
77 
79  double Offset() const { return offset; }
81  double& Offset() { return offset; }
82 
83  private:
84  double scale;
85  double offset;
86 };
87 
88 }; // namespace kernel
89 }; // namespace mlpack
90 
91 #endif