IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit
SigmoidKernel.h
1 // SigmoidKernel.h:
3 // ----------------
4 //
16 
17 #ifndef __IPSDKMATH_SIGMOIDKERNEL_H__
18 #define __IPSDKMATH_SIGMOIDKERNEL_H__
19 
24 
25 namespace ipsdk {
26 namespace math {
27 namespace clustering {
28 
31 
33 {
34 protected:
36  SigmoidKernel(const ipReal64 gamma,
37  const ipReal64 theta);
38 
39 public:
41  ~SigmoidKernel();
42 
43 // methods
44 public:
46  static SigmoidKernel createKernel(const ipReal64 gamma,
47  const ipReal64 theta);
48 
49 // methods
50 public:
52  inline ipReal64 getGamma() const
53  {
54  return _gamma;
55  }
56 
58  inline ipReal64 getTheta() const
59  {
60  return _theta;
61  }
62 
64  IPSDK_FORCEINLINE ipReal64 value(const Vector& v) const
65  {
66  return value(v, v);
67  }
68 
71  IPSDK_FORCEINLINE ipReal64 value(const Vector& v0,
72  const Vector& v1) const
73  {
74  // compute dot product between elements
75  const ipReal64 dotProd = boost::numeric::ublas::inner_prod(v0, v1);
76 
77  return std::tanh(_gamma*dotProd + _theta);
78  }
79 
80 // attributes
81 protected:
84 
87 };
88 
91 
92 } // end of namespace clustering
93 } // end of namespace math
94 } // end of namespace ipsdk
95 
96 #endif // __IPSDKMATH_SIGMOIDKERNEL_H__
ipReal64 getTheta() const
retrieve theta additive factor for sigmoid function
Definition: SigmoidKernel.h:58
Definition of import/export macro for library.
Defines the IPSDK_FORCEINLINE.
Main namespace for IPSDK library.
Definition: AlgorithmFunctionEfficiency.h:22
ipReal64 getGamma() const
retrieve gamma multiplicative factor for sigmoid function
Definition: SigmoidKernel.h:52
double ipReal64
Base types definition.
Definition: BaseTypes.h:57
ipReal64 _gamma
gamma multiplicative factor for sigmoid function
Definition: SigmoidKernel.h:83
boost::numeric::ublas::vector< ipReal64 > Vector
vector type associated to library
Definition: LinearAlgebraTypes.h:36
Definition: SigmoidKernel.h:32
#define IPSDKMATH_API
Import/Export macro for library IPSDKMath.
Definition: IPSDKMathExports.h:27
ipReal64 _theta
theta additive factor for sigmoid function
Definition: SigmoidKernel.h:86
Predefined types for clustering algorithm.
Utility functions for linear algebra operations management.