SiGraph: sulcal graphs


adapDescr.h
Go to the documentation of this file.
1
2#ifndef SI_DESCR_ADAPDESCR_H
3#define SI_DESCR_ADAPDESCR_H
4
5
8
9
10namespace sigraph
11{
12 class AdaptiveLeaf;
13 class LearnConstParam;
14
16 {
17 public:
18 GeneratedVector(std::vector<double> vec, double outp,
19 int class_id, int cycle) :
20 _vec(vec), _outp(outp), _class_id(class_id), _cycle(cycle) {};
21
22 inline const std::vector<double>& getVector() const { return _vec; }
23 inline double getOutp() const { return _outp; }
24 inline int getClassID() const { return _class_id; }
25 inline int getCycle() const { return _cycle; }
26
27 private:
28 std::vector<double> _vec;
29 double _outp;
30 int _class_id;
31 int _cycle;
32 };
33
36 class AdapDescr : public CliqueDescr
37 {
38 public:
39 virtual ~AdapDescr();
40
41
44 virtual void addGeneratedVector(const LearnConstParam *lp);
45 virtual const std::list<GeneratedVector *>& getGeneratedVectors(void) const
46 {
47 return _generated_vectors;
48 }
49
51 virtual void updateSiDBLearnable(void);
52
54
62 virtual bool makeLearnVector( const Clique* cl, std::vector<double> & vec,
63 carto::GenericObject* model = 0,
64 double outp = 0 );
65 virtual bool makeStatsVector( const Clique* cl, std::vector<double> & vec,
66 carto::GenericObject* model = 0,
67 double outp = 0 );
69 virtual void handleStats( const Clique* cl, std::vector<double> & vec,
70 carto::GenericObject* model = 0,
71 double outp = 0 );
73 virtual void reset() {}
74 virtual void clearDB();
75
76 protected:
78 private:
79 std::list<GeneratedVector *> _generated_vectors;
80 SiDBLearnable *_learnable;
81 };
82
83
84
85 // inline
86
87
88 inline bool
89 AdapDescr::makeStatsVector( const Clique* cl, std::vector<double> & vec,
90 carto::GenericObject* model, double outp )
91 {
92 if( makeLearnVector( cl, vec, model, outp ) )
93 {
94 handleStats( cl, vec, model, outp );
95 return( true );
96 }
97 else return( false );
98 }
99
100
101 inline bool
102 AdapDescr::makeLearnVector( const Clique* cl, std::vector<double> & vec,
103 carto::GenericObject* model, double )
104 {
105 return( makeVector( cl, vec, model ) );
106 }
107
108
109 inline void AdapDescr::handleStats( const Clique*, std::vector<double> &,
110 carto::GenericObject*, double )
111 {
112 }
113
114}
115
116#endif
117
virtual void updateSiDBLearnable(void)
read _generated_vectors and update _learnable, generated vectors are finally deleted
virtual void addGeneratedVector(const LearnConstParam *lp)
Convert (clique, outp, classid) to GeneratedVector and insert it in a list.
virtual void handleStats(const Clique *cl, std::vector< double > &vec, carto::GenericObject *model=0, double outp=0)
Handle stats learning stats.
Definition adapDescr.h:109
virtual ~AdapDescr()
virtual void clearDB()
virtual const std::list< GeneratedVector * > & getGeneratedVectors(void) const
Definition adapDescr.h:45
virtual bool makeLearnVector(const Clique *cl, std::vector< double > &vec, carto::GenericObject *model=0, double outp=0)
Build input vector for lerning (allow noising it with random)
Definition adapDescr.h:102
virtual void reset()
Reset (set to zero) all internal stats.
Definition adapDescr.h:73
virtual bool makeStatsVector(const Clique *cl, std::vector< double > &vec, carto::GenericObject *model=0, double outp=0)
Definition adapDescr.h:89
virtual SiDBLearnable & getSiDBLearnable()
El�ment adaptatif terminal.
virtual bool makeVector(const Clique *cl, std::vector< double > &vec, carto::GenericObject *model=0)
Fabrique le vecteur d'entrées.
Classe Clique.
Definition clique.h:35
GeneratedVector(std::vector< double > vec, double outp, int class_id, int cycle)
Definition adapDescr.h:18
double getOutp() const
Definition adapDescr.h:23
const std::vector< double > & getVector() const
Definition adapDescr.h:22