SHOGUN  4.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
SigmoidKernel.cpp
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or modify
3  * it under the terms of the GNU General Public License as published by
4  * the Free Software Foundation; either version 3 of the License, or
5  * (at your option) any later version.
6  *
7  * Written (W) 1999-2010 Soeren Sonnenburg
8  * Copyright (C) 1999-2009 Fraunhofer Institute FIRST and Max-Planck-Society
9  * Copyright (C) 2010 Berlin Institute of Technology
10  */
11 
12 #include <shogun/lib/common.h>
14 
15 using namespace shogun;
16 
18 {
19  init();
20 }
21 
23 : CDotKernel(size)
24 {
25  init();
26 
27  gamma=g;
28  coef0=c;
29 }
30 
32  CDotFeatures* l, CDotFeatures* r, int32_t size, float64_t g, float64_t c)
33 : CDotKernel(size)
34 {
35  init();
36 
37  gamma=g;
38  coef0=c;
39 
40  init(l,r);
41 }
42 
44 {
45  cleanup();
46 }
47 
49 {
50 }
51 
52 bool CSigmoidKernel::init(CFeatures* l, CFeatures* r)
53 {
54  CDotKernel::init(l, r);
55  return init_normalizer();
56 }
57 
58 void CSigmoidKernel::init()
59 {
60  gamma=0.0;
61  coef0=0.0;
62 
63  SG_ADD(&gamma, "gamma", "Gamma.", MS_AVAILABLE);
64  SG_ADD(&coef0, "coef0", "Coefficient 0.", MS_AVAILABLE);
65 }
virtual void cleanup()
Features that support dot products among other operations.
Definition: DotFeatures.h:44
Template class DotKernel is the base class for kernels working on DotFeatures.
Definition: DotKernel.h:31
double float64_t
Definition: common.h:50
virtual bool init_normalizer()
Definition: Kernel.cpp:157
all of classes and functions are contained in the shogun namespace
Definition: class_list.h:18
The class Features is the base class of all feature objects.
Definition: Features.h:68
#define SG_ADD(...)
Definition: SGObject.h:81
virtual bool init(CFeatures *l, CFeatures *r)

SHOGUN Machine Learning Toolbox - Documentation