SigmoidKernel.cpp

Go to the documentation of this file.
00001 /*
00002  * This program is free software; you can redistribute it and/or modify
00003  * it under the terms of the GNU General Public License as published by
00004  * the Free Software Foundation; either version 3 of the License, or
00005  * (at your option) any later version.
00006  *
00007  * Written (W) 1999-2010 Soeren Sonnenburg
00008  * Copyright (C) 1999-2009 Fraunhofer Institute FIRST and Max-Planck-Society
00009  * Copyright (C) 2010 Berlin Institute of Technology
00010  */
00011 
00012 #include <shogun/lib/common.h>
00013 #include <shogun/kernel/SigmoidKernel.h>
00014 
00015 using namespace shogun;
00016 
00017 CSigmoidKernel::CSigmoidKernel() : CDotKernel()
00018 {
00019     init();
00020 }
00021 
00022 CSigmoidKernel::CSigmoidKernel(int32_t size, float64_t g, float64_t c)
00023 : CDotKernel(size)
00024 {
00025     init();
00026 
00027     gamma=g;
00028     coef0=c;
00029 }
00030 
00031 CSigmoidKernel::CSigmoidKernel(
00032     CDotFeatures* l, CDotFeatures* r, int32_t size, float64_t g, float64_t c)
00033 : CDotKernel(size)
00034 {
00035     init();
00036 
00037     gamma=g;
00038     coef0=c;
00039 
00040     init(l,r);
00041 }
00042 
00043 CSigmoidKernel::~CSigmoidKernel()
00044 {
00045     cleanup();
00046 }
00047 
00048 void CSigmoidKernel::cleanup()
00049 {
00050 }
00051 
00052 bool CSigmoidKernel::init(CFeatures* l, CFeatures* r)
00053 {
00054     CDotKernel::init(l, r);
00055     return init_normalizer();
00056 }
00057 
00058 void CSigmoidKernel::init()
00059 {
00060     gamma=0.0;
00061     coef0=0.0;
00062 
00063     SG_ADD(&gamma, "gamma", "Gamma.", MS_AVAILABLE);
00064     SG_ADD(&coef0, "coef0", "Coefficient 0.", MS_AVAILABLE);
00065 }
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

SHOGUN Machine Learning Toolbox - Documentation