SHOGUN  v3.2.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
RandomFourierDotFeatures.h
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) 2013 Evangelos Anagnostopoulos
00008  * Copyright (C) 2013 Evangelos Anagnostopoulos
00009  */
00010 
00011 #ifndef _RANDOMFOURIER_DOTFEATURES__H__
00012 #define _RANDOMFOURIER_DOTFEATURES__H__
00013 
00014 #include <shogun/features/RandomKitchenSinksDotFeatures.h>
00015 #include <shogun/features/DenseFeatures.h>
00016 #include <shogun/features/DotFeatures.h>
00017 
00018 namespace shogun
00019 {
00020 template <class ST> class CDenseFeatures;
00021 class CDotFeatures;
00022 
00024 enum KernelName
00025 {
00030     GAUSSIAN,
00031 
00033     NOT_SPECIFIED
00034 };
00035 
00046 class CRandomFourierDotFeatures : public CRandomKitchenSinksDotFeatures
00047 {
00048 public:
00049 
00051     CRandomFourierDotFeatures();
00052 
00061     CRandomFourierDotFeatures(CDotFeatures* features, int32_t D, KernelName kernel_name,
00062             SGVector<float64_t> params);
00063 
00072     CRandomFourierDotFeatures(CDotFeatures* features, int32_t D, KernelName kernel_name,
00073             SGVector<float64_t> params, SGMatrix<float64_t> coeff);
00074 
00079     CRandomFourierDotFeatures(CFile* loader);
00080 
00082     CRandomFourierDotFeatures(const CRandomFourierDotFeatures& orig);
00083 
00085     virtual CFeatures* duplicate() const;
00086 
00088     virtual ~CRandomFourierDotFeatures();
00089 
00091     virtual const char* get_name() const;
00092 
00093 protected:
00094 
00102     virtual float64_t post_dot(float64_t dot_result, index_t par_idx);
00103 
00108     virtual SGVector<float64_t> generate_random_parameter_vector();
00109 
00110 private:
00111     void init(KernelName kernel_name, SGVector<float64_t> params);
00112 
00113 private:
00115     KernelName kernel;
00116 
00118     SGVector<float64_t> kernel_params;
00119 
00121     float64_t constant;
00122 };
00123 }
00124 
00125 #endif // _RANDOMFOURIER_DOTFEATURES__H__
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

SHOGUN Machine Learning Toolbox - Documentation