Image Component Library (ICL)
StochasticOptimizer.h
Go to the documentation of this file.
1 /********************************************************************
2 ** Image Component Library (ICL) **
3 ** **
4 ** Copyright (C) 2006-2013 CITEC, University of Bielefeld **
5 ** Neuroinformatics Group **
6 ** Website: www.iclcv.org and **
7 ** http://opensource.cit-ec.de/projects/icl **
8 ** **
9 ** File : ICLMath/src/ICLMath/StochasticOptimizer.h **
10 ** Module : ICLMath **
11 ** Authors: Christof Elbrechter **
12 ** **
13 ** **
14 ** GNU LESSER GENERAL PUBLIC LICENSE **
15 ** This file may be used under the terms of the GNU Lesser General **
16 ** Public License version 3.0 as published by the **
17 ** **
18 ** Free Software Foundation and appearing in the file LICENSE.LGPL **
19 ** included in the packaging of this file. Please review the **
20 ** following information to ensure the license requirements will **
21 ** be met: http://www.gnu.org/licenses/lgpl-3.0.txt **
22 ** **
23 ** The development of this software was supported by the **
24 ** Excellence Cluster EXC 277 Cognitive Interaction Technology. **
25 ** The Excellence Cluster EXC 277 is a grant of the Deutsche **
26 ** Forschungsgemeinschaft (DFG) in the context of the German **
27 ** Excellence Initiative. **
28 ** **
29 ********************************************************************/
30 
31 #pragma once
32 
33 #include <ICLUtils/CompatMacros.h>
34 
35 namespace icl{
36  namespace math{
37 
39  template<class T>
42  StochasticOptimizerResult(const T *data=0,T error=0, T startError=0, int steps=0);
43  const T *data;
44  T error;
46  int steps;
47  };
48 
50 
62  template<class T=float>
64  public:
67 
69  StochasticOptimizer(int dataDim);
70 
72  Result optimize(int maxTimeSteps){
73  return optimize(-1,maxTimeSteps);
74  }
75 
77  Result optimize(T minError, int maxSteps);
78 
79  protected:
81 
84  virtual T *getData() = 0;
85 
87 
88  virtual T getError(const T *data)=0;
89 
91 
93  virtual const T *getNoise(int currentTime, int endTime)=0;
94 
96 
97  virtual void reinitialize() = 0;
98 
100  virtual void notifyProgress(int t, int numSteps, int startError,
101  int currBestError, int currError,const T *data, int dataDim);
102 
103  private:
106  };
107 
108  } // namespace math
109 }
110 
undocument this line if you encounter any issues!
Definition: Any.h:37
T error
reached minimum error
Definition: StochasticOptimizer.h:44
The StochasticOptimizer is a tiny frame-work for simple stochastic optimization processes.
Definition: StochasticOptimizer.h:63
Result optimize(int maxTimeSteps)
start optimization process with given step count
Definition: StochasticOptimizer.h:72
int steps
steps iterated!
Definition: StochasticOptimizer.h:46
ICLQt_API ImgROI data(ImgQ &r)
creates full ROI ROI-struct
int m_dataDim
internal data-dimension variable
Definition: StochasticOptimizer.h:105
const T * data
resulting optimized data vector
Definition: StochasticOptimizer.h:43
T startError
first error measurement (reached with initial data vector)
Definition: StochasticOptimizer.h:45
Utility structure for the stochastic optimizer class.
Definition: StochasticOptimizer.h:40
#define ICLMath_IMP
Definition: CompatMacros.h:172
StochasticOptimizerResult< T > Result
Result structure.
Definition: StochasticOptimizer.h:66
StochasticOptimizerResult(const T *data=0, T error=0, T startError=0, int steps=0)
creates a new result structure (internally used only)