Xmipp  v3.23.11-Nereus
gaussian_kerdensom.h
Go to the documentation of this file.
1 /***************************************************************************
2  *
3  * Authors: Alberto Pascual Montano (pascual@cnb.csic.es)
4  *
5  * Unidad de Bioinformatica of Centro Nacional de Biotecnologia , CSIC
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 2 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
20  * 02111-1307 USA
21  *
22  * All comments concerning this program package may be sent to the
23  * e-mail address 'xmipp@cnb.csic.es'
24  ***************************************************************************/
25 
26 //-----------------------------------------------------------------------------
27 // GaussianKerDenSOM.hh
28 // Implements Smoothly Distributed Kernel Probability Density Estimator Self-Organizing Map
29 // Uses a Gaussian Kernel Function.
30 //-----------------------------------------------------------------------------
31 
32 #ifndef XMIPPTGAUSSIANKERDENSOM_H
33 #define XMIPPTGAUSSIANKERDENSOM_H
34 
35 #include "kerdensom.h"
36 
45 {
46 public:
47 
56  GaussianKerDenSOM(double _reg0, double _reg1, unsigned long _annSteps,
57  double _epsilon, unsigned long _nSteps)
58  : KerDenSOM(_reg0, _reg1, _annSteps, _epsilon, _nSteps)
59  {};
60 
65  {};
66 
67 
75  virtual void train(FuzzyMap& _som, TS& _examples, FileName& _fn_vectors,
76  bool _update = false, double _sigma = 0,
77  bool _saveIntermediate = false);
78 
79 
84  virtual double functional(const TS* _examples, const FuzzyMap* _som, double _sigma, double _reg, double& _likelihood, double& _penalty);
85 
86 
87 protected:
88 
89  // Update Us
90  virtual double updateU(FuzzyMap* _som, const TS* _examples, const double& _sigma, double& _alpha);
91 
92  // Estimate Sigma II
93  virtual double updateSigmaII(FuzzyMap* _som, const TS* _examples, const double& _reg, const double& _alpha);
94 
95  // Estimate the PD (Method 1: Using the code vectors)
96  virtual double codeDens(const FuzzyMap* _som, const FeatureVector* _example, double _sigma) const;
97 #ifdef UNUSED // detected as unused 29.6.2018
98  // Estimate the PD (Method 2: Using the data)
99  virtual double dataDens(const TS* _examples, const FeatureVector* _example, double _sigma) const;
100 #endif
101 };
102 
104 #endif
virtual double updateU(FuzzyMap *_som, const TS *_examples, const double &_sigma, double &_alpha)
Definition: map.h:308
GaussianKerDenSOM(double _reg0, double _reg1, unsigned long _annSteps, double _epsilon, unsigned long _nSteps)
virtual ~GaussianKerDenSOM()
virtual double codeDens(const FuzzyMap *_som, const FeatureVector *_example, double _sigma) const
virtual void train(FuzzyMap &_som, TS &_examples, FileName &_fn_vectors, bool _update=false, double _sigma=0, bool _saveIntermediate=false)
std::vector< floatFeature > FeatureVector
Definition: data_types.h:86
virtual double functional(const TS *_examples, const FuzzyMap *_som, double _sigma, double _reg, double &_likelihood, double &_penalty)
virtual double updateSigmaII(FuzzyMap *_som, const TS *_examples, const double &_reg, const double &_alpha)