Xmipp  v3.23.11-Nereus
Public Member Functions | Public Attributes | Protected Member Functions | List of all members
CodeBook Class Reference

#include <code_book.h>

Inheritance diagram for CodeBook:
Inheritance graph
[legend]
Collaboration diagram for CodeBook:
Collaboration graph
[legend]

Public Member Functions

 CodeBook (const bool &_calib=false)
 
 CodeBook (unsigned _n, unsigned _size, bool _cal=false)
 
 CodeBook (unsigned _n, unsigned _size, floatFeature _lower=0, floatFeature _upper=1, bool _cal=false)
 
 CodeBook (unsigned _n, const ClassicTrainingVectors &_ts, const bool _use_rand_cvs)
 
 CodeBook (std::istream &_is)
 
virtual ~CodeBook ()
 
virtual FeatureVectortest (const FeatureVector &_in) const
 
virtual unsigned testIndex (const FeatureVector &_in) const
 
virtual void classify (const ClassicTrainingVectors *_ts)
 
virtual const std::vector< unsigned > & classifAt (const unsigned &_index) const
 
virtual unsigned classifSizeAt (const unsigned &_index) const
 
virtual Label apply (const FeatureVector &_in) const
 
virtual void calibrate (ClassicTrainingVectors &_ts, Label _def="")
 
virtual unsigned output (const FeatureVector &_in) const
 
virtual void printSelf (std::ostream &_os) const
 
virtual void readSelf (std::istream &_is, long _dim=-1, long _size=-1)
 
virtual void saveObject (std::ostream &_os) const
 
virtual void loadObject (std::istream &_is)
 
virtual void Normalize (const std::vector< ClassicTrainingVectors::statsStruct > &_varStats)
 
virtual void unNormalize (const std::vector< ClassicTrainingVectors::statsStruct > &_varStats)
 
virtual void printHistogram (std::ostream &_os) const
 
virtual void printQuantError (std::ostream &_os) const
 
- Public Member Functions inherited from ClassificationDataSet< FeatureVector, Label >
 ClassificationDataSet ()
 
virtual ~ClassificationDataSet ()
 
- Public Member Functions inherited from ClassificationTrainingSet< FeatureVector, Label >
 ClassificationTrainingSet (const bool &_calib=true, unsigned _n=0)
 
 ClassificationTrainingSet (std::istream &_is)
 
virtual ~ClassificationTrainingSet ()
 
void setSplit (float _tp, float _vp)
 
splitIt beginSubset (unsigned _um)
 
splitIt endSubset (unsigned _um)
 Returns an iterator to the end of the subset. More...
 
virtual void add (const FeatureVector &_i, const Label &_tg)
 
virtual void add (const FeatureVector &_i)
 
virtual bool remove (unsigned int _idx)
 
size_t size () const
 
const LabeltargetAt (unsigned _i) const
 
LabeltargetAt (unsigned _i)
 
const FeatureVectoritemAt (unsigned _i) const
 
FeatureVectoritemAt (unsigned _i)
 
bool calibrated () const
 
void calibrated (const bool &_calib)
 
void clear ()
 
virtual void readSelf (std::istream &_is)
 
unsigned numTargets () const
 
virtual bool swapItems (unsigned _i, unsigned _j)
 

Public Attributes

std::vector< std::vector< unsigned > > classifVectors
 
std::vector< double > aveDistances
 
- Public Attributes inherited from ClassificationTrainingSet< FeatureVector, Label >
std::vector< FeatureVectortheItems
 
std::vector< LabeltheTargets
 

Protected Member Functions

void readClassifVectors (std::istream &_is)
 
void writeClassifVectors (std::ostream &_os) const
 
- Protected Member Functions inherited from ClassificationTrainingSet< FeatureVector, Label >
void computeNumTargets ()
 
void checkCalibrated (std::istream &_is)
 
void readItems (std::istream &_is)
 
void writeCalibrated (std::ostream &_os) const
 
void writeItems (std::ostream &_os, bool _delim=false) const
 
void skipComments (std::istream &_is) const
 
std::vector< FeatureVector >::const_iterator itemsBegin () const
 
std::vector< FeatureVector >::const_iterator itemsEnd () const
 
std::vector< Label >::const_iterator targetsBegin () const
 
std::vector< Label >::const_iterator targetsEnd () const
 

Additional Inherited Members

- Public Types inherited from ClassificationDataSet< FeatureVector, Label >
typedef FeatureVector In
 Class of input vectors. Usually a FeatureVector (vector of Feature) More...
 
typedef Label Out
 Class of the target. Can be a double, string, unsigned, even a vector ... More...
 
typedef ClassificationTrainingSet< In, OutTS
 Training set. Set of vectors (training vectors), probably classified. More...
 
- Public Types inherited from ClassificationTrainingSet< FeatureVector, Label >
enum  splitMode
 Ways the training set can be used. More...
 
enum  useMode
 use of samples More...
 
typedef std::multimap< unsigned, unsigned, std::less< unsigned > > splitTS
 Training sets mode. More...
 
typedef splitTS::iterator splitIt
 iterator More...
 
- Protected Attributes inherited from ClassificationTrainingSet< FeatureVector, Label >
bool isCalibrated
 
splitTS splitTrainingSet
 
unsigned nTargets
 

Detailed Description

This class implements a codebook. A codebook is a set of examples (each of them being a vector). These examples are usually labeled, ie, classified (the codebook is calibrated), but it is not necessary (the codebook is NOT calibrated). A codebook is the result obtained after one has trained some kind of algorithms. The way to classify a data once the algorithm has been trained is to look for the example in the code book that best matches the data to classify. Then, the same label of the example in the codebook is associated to the data wanted to be classified (if it is a calibrated codebook), or the example itself is returned (if it is a NO calibrated codebook) indicating with this that the data belongs to the same 'class' that the returned example.

Definition at line 57 of file code_book.h.

Constructor & Destructor Documentation

◆ CodeBook() [1/5]

CodeBook::CodeBook ( const bool &  _calib = false)
inline

Default constructor Parameter: _calib Calibrated or not, that is, a CB with class labels or not

Definition at line 69 of file code_book.h.

◆ CodeBook() [2/5]

CodeBook::CodeBook ( unsigned  _n,
unsigned  _size,
bool  _cal = false 
)

Constructor. Constructs a codebook with initial code vectors at zero. from an unsigned integer to instantiate the template Parameter: _n Number of vectors Parameter: _size Size of code vectors Parameter: _cal Calibrated or not, that is, a CB with class labels or not

This class implements a codebook. A codebook is a set of examples (each of them being a vector). These examples are usually labeled, ie, classified (the codebook is calibrated), but it is not necessary (the codebook is NOT calibrated). A codebook is the result obtained after one has trained some kind of algorithms. The way to classify a data once the algorithm has been trained is to look for the example in the code book that best matches the data to classify. Then, the same label of the example in the codebook is associated to the data wanted to be classified (if it is a calibrated codebook), or the example itself is returned (if it is a NO calibrated codebook) indicating with this that the data belongs to the same 'class' that the returned example. Constructor. Constructs a codebook with initial code vectors at zero. from an unsigned integer to instantiate the template Parameter: _n Number of vectors Parameter: _size Size of code vectors Parameter: _lower Lower value for random elements Parameter: _upper Upper value for random elements Parameter: _cal Calibrated or not, that is, a CB with class labels or not

Definition at line 59 of file code_book.cpp.

62 {
63  // Fill vectors with zeros
64  theItems.resize(_n);
65  //if (calibrated())
66  theTargets.resize(_n, "");
67  for (unsigned i = 0 ; i < _n ; i++)
68  {
69  FeatureVector v;
70  v.resize(_size, 0);
71  theItems[i] = v;
72  }
73 }
#define i
std::vector< floatFeature > FeatureVector
Definition: data_types.h:86

◆ CodeBook() [3/5]

CodeBook::CodeBook ( unsigned  _n,
unsigned  _size,
floatFeature  _lower = 0,
floatFeature  _upper = 1,
bool  _cal = false 
)

Constructor. Constructs a codebook with random initial code vectors. from an unsigned integer to instantiate the template Parameter: _n Number of vectors Parameter: _size Size of code vectors Parameter: _lower Lower value for random elements Parameter: _upper Upper value for random elements Parameter: _cal Calibrated or not, that is, a CB with class labels or not

Definition at line 87 of file code_book.cpp.

91 {
92  theItems.resize(_n);
93  //if (calibrated())
94  theTargets.resize(_n, "");
95  // Assign random vectors
96  for (unsigned i = 0 ; i < _n ; i++)
97  {
98  std::vector<floatFeature> v;
99  v = randomVector(_size, _lower, _upper);
100  theItems[i] = v;
101  }
102 }
#define i
std::vector< T > randomVector(const unsigned &_size, const T &_lower, const T &_upper)
Definition: vector_ops.h:175

◆ CodeBook() [4/5]

CodeBook::CodeBook ( unsigned  _n,
const ClassicTrainingVectors _ts,
const bool  _use_rand_cvs 
)

Constructor. Constructs a codebook with initial code vectors taken randomly from the training file. from an unsigned integer to instantiate the template Parameter: _n Number of vectors Parameter: _ts Training set; will be used to get initial values Parameter: _use_rand_cvs Use random code vector values

Definition at line 119 of file code_book.cpp.

122 {
123  // Take random samples
124  // RandomUniformGenerator<unsigned> chosen( 0, _ts.size() -1 );
126 
127  theItems.resize(_n);
128  //if (_ts.calibrated())
129  theTargets.resize(_n, "");
130  // Assign random vectors
131  std::vector<floatFeature> v;
132  for (unsigned i = 0 ; i < _n ; i++)
133  {
134  auto index = (int) rnd_unif(0, _ts.size() - 1);
135  v = _ts.theItems[index];
136  if (_use_rand_cvs)
137  {
138  // NT: Scan this vector for the range of pixel values
139  floatFeature minval;
140  floatFeature maxval;
141  std::vector<floatFeature>::const_iterator viter = v.begin();
142  minval = maxval = *viter;
143  for (viter++; viter != v.end(); viter++)
144  {
145  if (*viter < minval)
146  minval = *viter;
147  else if (*viter > maxval)
148  maxval = *viter;
149  }
150  v = randomVector(_ts.theItems[0].size(), minval, maxval);
151  }
152  theItems[i] = v;
153  }
154 
155 }
float floatFeature
Definition: data_types.h:72
#define i
double rnd_unif()
viol index
unsigned int randomize_random_generator()
std::vector< T > randomVector(const unsigned &_size, const T &_lower, const T &_upper)
Definition: vector_ops.h:175

◆ CodeBook() [5/5]

CodeBook::CodeBook ( std::istream &  _is)

Constructs a code book given a stream Parameter: _is The input stream

Exceptions
runtime_errorIf there are problems with the stream

Definition at line 162 of file code_book.cpp.

◆ ~CodeBook()

virtual CodeBook::~CodeBook ( )
inlinevirtual

Virtual destructor needed

Definition at line 117 of file code_book.h.

118  {};

Member Function Documentation

◆ apply()

Label CodeBook::apply ( const FeatureVector _in) const
virtual

Returns the label associated to an input Parameter: _in Sample to classify

Implements ClassificationDataSet< FeatureVector, Label >.

Definition at line 316 of file code_book.cpp.

317 {
318  return theTargets[testIndex(_in)];
319 }
virtual unsigned testIndex(const FeatureVector &_in) const
Definition: code_book.cpp:197

◆ calibrate()

void CodeBook::calibrate ( ClassicTrainingVectors _ts,
Label  _def = "" 
)
virtual

Calibrates the code book Parameter: _ts The calibrated training set Parameter: _def Default target for non-calibrated vectors

Exceptions
runtime_errorIf the training set is not calibrated

Definition at line 328 of file code_book.cpp.

330 {
331  // set the default label
332  for (std::vector<FeatureVector>::const_iterator i = itemsBegin() ;
333  i < itemsEnd() ; i++)
334  theTargets[i - itemsBegin()] = _def;
335  if (_ts.calibrated())
336  {
337  for (unsigned j = 0 ; j < _ts.size() ; j++)
338  theTargets[testIndex(_ts.theItems[j])] = _ts.theTargets[j];
339  calibrated(true);
340  }
341  else
342  calibrated(false);
343 }
std::vector< FeatureVector >::const_iterator itemsBegin() const
Definition: training_set.h:624
virtual unsigned testIndex(const FeatureVector &_in) const
Definition: code_book.cpp:197
#define i
std::vector< Item > theItems
Definition: training_set.h:84
#define j
std::vector< FeatureVector >::const_iterator itemsEnd() const
Definition: training_set.h:633

◆ classifAt()

const std::vector< unsigned > & CodeBook::classifAt ( const unsigned &  _index) const
virtual

Returns the list of input vectors associated to this code vector.

Definition at line 286 of file code_book.cpp.

287 {
288  if (_index < 0 || _index > classifVectors.size())
289  {
290  std::ostringstream msg;
291  msg << "index out of range";
292  throw std::runtime_error(msg.str());
293  }
294  return classifVectors[_index];
295 }
std::vector< std::vector< unsigned > > classifVectors
Definition: code_book.h:61

◆ classifSizeAt()

unsigned CodeBook::classifSizeAt ( const unsigned &  _index) const
virtual

Returns the number of input vectors associated to this code vector.

Definition at line 300 of file code_book.cpp.

301 {
302  if (_index < 0 || _index > classifVectors.size())
303  {
304  std::ostringstream msg;
305  msg << "index out of range";
306  throw std::runtime_error(msg.str());
307  }
308  return classifVectors[_index].size();
309 }
std::vector< std::vector< unsigned > > classifVectors
Definition: code_book.h:61

◆ classify()

void CodeBook::classify ( const ClassicTrainingVectors _ts)
virtual

Fills the classifVectors with the list of the best input vectors associated to it. Parameter: _ts Sample list to classify

Reimplemented in FuzzyCodeBook.

Definition at line 238 of file code_book.cpp.

239 {
240  classifVectors.clear(); // clear previous classification.
241  classifVectors.resize(size());
242  aveDistances.clear(); // clear previous classification.
243  aveDistances.resize(size());
244  for (unsigned j = 0 ; j < _ts->size() ; j++)
245  classifVectors[testIndex(_ts->theItems[j])].push_back(j);
246 
247  for (unsigned i = 0 ; i < size() ; i++)
248  {
249  double aveDist = 0;
250  for (unsigned j = 0 ; j < classifVectors[i].size() ; j++)
251  aveDist += euclideanDistance(theItems[i], _ts->theItems[classifVectors[i][j]]);
252  if (classifVectors[i].size() != 0)
253  aveDist /= (double) classifVectors[i].size();
254  aveDistances[i] = (double) aveDist;
255  }
256 
257 }
double euclideanDistance(const std::vector< T > &_v1, const std::vector< T > &_v2)
Definition: vector_ops.h:377
virtual unsigned testIndex(const FeatureVector &_in) const
Definition: code_book.cpp:197
#define i
std::vector< Item > theItems
Definition: training_set.h:84
std::vector< double > aveDistances
Definition: code_book.h:62
#define j
std::vector< std::vector< unsigned > > classifVectors
Definition: code_book.h:61

◆ loadObject()

void CodeBook::loadObject ( std::istream &  _is)
virtual

Loads the xmippCodeBook class from a stream. this method can be used to load the status of the class. Parameter: _is The output stream

Loads the CodeBook class from a stream. this method can be used to load the status of the class. Parameter: _is The output stream

Reimplemented from ClassificationTrainingSet< FeatureVector, Label >.

Reimplemented in FuzzyMap, ClassificationMap, and FuzzyCodeBook.

Definition at line 478 of file code_book.cpp.

479 {
480  clear();
481  readClassifVectors(_is);
483 }
void readClassifVectors(std::istream &_is)
Definition: code_book.cpp:439
virtual void loadObject(std::istream &_is)
Definition: training_set.h:360

◆ Normalize()

void CodeBook::Normalize ( const std::vector< ClassicTrainingVectors::statsStruct > &  _varStats)
virtual

Normalize all features in the codebook Parameter: _varStats The normalization information

Definition at line 516 of file code_book.cpp.

517 {
518  using namespace std;
519  if (_varStats.size() != theItems[0].size())
520  {
521  std::ostringstream msg;
522  msg << "Normalization information does not coincide with codebook structure";
523  throw std::runtime_error(msg.str());
524  }
525  for (unsigned it = 0; it < size(); it++)
526  {
527  for (unsigned i = 0; i < theItems[0].size(); i++)
528  {
529  if (!isnan(theItems[it][i]))
530  {
531  if (_varStats[i].sd != 0)
532  theItems[it][i] = (theItems[it][i] - _varStats[i].mean) / _varStats[i].sd;
533  }
534  }
535  }
536 }
#define i

◆ output()

unsigned CodeBook::output ( const FeatureVector _in) const
virtual

Returns the index of the codevector closest to an input. This is the method used to classify inputs Parameter: _in Sample to classify.

Implements ClassificationDataSet< FeatureVector, Label >.

Definition at line 350 of file code_book.cpp.

352 {
353  return testIndex(_in);
354 }
virtual unsigned testIndex(const FeatureVector &_in) const
Definition: code_book.cpp:197

◆ printHistogram()

void CodeBook::printHistogram ( std::ostream &  _os) const
virtual

Prints the histogram values of each codevector. Parameter: _os The the output stream

Prints the histogram values of each Fuzzy codevector. Parameter: _os The the output stream

Definition at line 264 of file code_book.cpp.

265 {
266  _os << "1 " << size() << std::endl;
267  for (size_t j = 0; j < size(); j++)
268  _os << j << " " << classifSizeAt(j) << std::endl;
269 }
#define j
virtual unsigned classifSizeAt(const unsigned &_index) const
Definition: code_book.cpp:300

◆ printQuantError()

void CodeBook::printQuantError ( std::ostream &  _os) const
virtual

Prints the Average Quantization Error of each codevector. Parameter: _os The the output stream

Definition at line 276 of file code_book.cpp.

277 {
278  _os << "1 " << size() << std::endl;
279  for (size_t j = 0; j < size(); j++)
280  _os << j << " " << aveDistances[j] << std::endl;
281 }
std::vector< double > aveDistances
Definition: code_book.h:62
#define j

◆ printSelf()

void CodeBook::printSelf ( std::ostream &  _os) const
virtual

Standard output for a code book Parameter: _os The output stream

Standard output for a codebook Parameter: _os The output stream

Reimplemented from ClassificationTrainingSet< FeatureVector, Label >.

Reimplemented in FuzzyMap, and ClassificationMap.

Definition at line 361 of file code_book.cpp.

362 {
364 }
virtual void printSelf(std::ostream &_os) const
Definition: training_set.h:330

◆ readClassifVectors()

void CodeBook::readClassifVectors ( std::istream &  _is)
protected

Reads the classif vectors from a stream. Parameter: _is The input stream

Definition at line 439 of file code_book.cpp.

440 {
441  int dim;
442  _is >> dim;
443  classifVectors.resize(dim);
444  for (size_t i = 0; i < classifVectors.size(); i++)
445  _is >> classifVectors[i];
446 }
#define i
std::vector< std::vector< unsigned > > classifVectors
Definition: code_book.h:61

◆ readSelf()

void CodeBook::readSelf ( std::istream &  _is,
long  _dim = -1,
long  _size = -1 
)
virtual

Standard input for a code book Parameter: _is The input stream

Standard input for a codebook Parameter: _is The input stream

Definition at line 370 of file code_book.cpp.

371 {
372 
373 #ifndef _NO_EXCEPTION
374  try
375  {
376 #endif
377  clear();
378  std::string line;
379 
380  // Determines the number of rows and columns in the training set
381 
382  long dim;
383  long size;
384  if (_dim == -1)
385  {
386  _is >> dim;
387  }
388  else
389  dim = _dim;
390  if (_size == -1)
391  {
392  _is >> line;
393  if (!sscanf(line.c_str(), "%ld", &size))
394  {
395  int x;
396  int y;
397  _is >> x;
398  _is >> y;
399  size = x * y;
400  }
401  }
402  else
403  size = _size;
404  getline(_is, line);
405  theItems.resize(size);
406  theTargets.resize(size);
407 
408  for (int i = 0; i < size; i++)
409  {
410  std::vector<floatFeature> v;
411  v.resize(dim);
412  for (int j = 0; j < dim; j++)
413  {
414  floatFeature var;
415  _is >> var;
416  v[j] = var;
417  }
418  getline(_is, line);
419  theItems[i] = v;
420  theTargets[i] = line;
421  }
422 #ifndef _NO_EXCEPTION
423 
424  }
425  catch (std::exception& e)
426  {
427  std::ostringstream msg;
428  msg << e.what() << std::endl << "Error reading the code book";
429  throw std::runtime_error(msg.str());
430  }
431 #endif
432 }
static double * y
float floatFeature
Definition: data_types.h:72
doublereal * x
#define i
#define j

◆ saveObject()

void CodeBook::saveObject ( std::ostream &  _os) const
virtual

Saves the xmippCodeBook class into a stream. this method can be used to save the status of the class. Parameter: _os The output stream

Saves the CodeBook class into a stream. this method can be used to save the status of the class. Parameter: _os The output stream

Reimplemented from ClassificationTrainingSet< FeatureVector, Label >.

Reimplemented in FuzzyMap, ClassificationMap, and FuzzyCodeBook.

Definition at line 466 of file code_book.cpp.

467 {
468  writeClassifVectors(_os);
470 }
void writeClassifVectors(std::ostream &_os) const
Definition: code_book.cpp:453
virtual void saveObject(std::ostream &_os) const
Definition: training_set.h:349

◆ test()

FeatureVector & CodeBook::test ( const FeatureVector _in) const
virtual

Returns the code vector that represents the input in the codebook Parameter: _in Sample to classify

Definition at line 172 of file code_book.cpp.

173 {
174  // eval the first one to init best & bestDist
175  std::vector<FeatureVector>::const_iterator i = itemsBegin();
176  std::vector<FeatureVector>::const_iterator best = i;
177  double bestDist = euclideanDistance(*i, _in);
178 
179  // eval the rest
180  for (i++ ; i < itemsEnd() ; i++)
181  {
182  double dist = euclideanDistance(*i, _in);
183  if (dist < bestDist)
184  {
185  bestDist = dist;
186  best = i;
187  }
188  }
189 
190  return (FeatureVector&)*best;
191 }
std::vector< FeatureVector >::const_iterator itemsBegin() const
Definition: training_set.h:624
double euclideanDistance(const std::vector< T > &_v1, const std::vector< T > &_v2)
Definition: vector_ops.h:377
#define i
std::vector< FeatureVector >::const_iterator itemsEnd() const
Definition: training_set.h:633
std::vector< floatFeature > FeatureVector
Definition: data_types.h:86

◆ testIndex()

unsigned CodeBook::testIndex ( const FeatureVector _in) const
virtual

Returns the index to the code vector that represents the input in the codebook Parameter: _in Sample to classify

Definition at line 197 of file code_book.cpp.

198 {
199  // eval the first one to init best & bestDist
200  std::vector<FeatureVector>::const_iterator i = itemsBegin();
201  std::vector<FeatureVector>::const_iterator best = i;
202  double bestDist = euclideanDistance(*i, _in);
203 
204  // eval the rest
205  unsigned bestIndex = 0;
206  unsigned index = 1;
207  for (i++ ; i < itemsEnd() ; i++)
208  {
209  double dist = euclideanDistance(*i, _in);
210  if (dist < bestDist)
211  {
212  bestDist = dist;
213  best = i;
214  bestIndex = index;
215  }
216  index++;
217  }
218 
219  return bestIndex;
220 }
std::vector< FeatureVector >::const_iterator itemsBegin() const
Definition: training_set.h:624
double euclideanDistance(const std::vector< T > &_v1, const std::vector< T > &_v2)
Definition: vector_ops.h:377
#define i
viol index
std::vector< FeatureVector >::const_iterator itemsEnd() const
Definition: training_set.h:633

◆ unNormalize()

void CodeBook::unNormalize ( const std::vector< ClassicTrainingVectors::statsStruct > &  _varStats)
virtual

UnNormalize all features in the codebook Parameter: _varStats The normalization information

Definition at line 491 of file code_book.cpp.

492 {
493  using namespace std;
494  if (_varStats.size() != theItems[0].size())
495  {
496  std::ostringstream msg;
497  msg << "Normalization information does not coincide with codebook structure";
498  throw std::runtime_error(msg.str());
499  }
500  for (unsigned it = 0; it < size(); it++)
501  {
502  for (unsigned i = 0; i < theItems[0].size(); i++)
503  {
504  if (!isnan(theItems[it][i]))
505  theItems[it][i] = theItems[it][i] * _varStats[i].sd + _varStats[i].mean;
506  }
507  }
508 }
#define i

◆ writeClassifVectors()

void CodeBook::writeClassifVectors ( std::ostream &  _os) const
protected

Writes the classif vectors to a stream Parameter: _os The output stream

Definition at line 453 of file code_book.cpp.

454 {
455  _os << classifVectors.size() << std::endl;
456  for (size_t i = 0; i < classifVectors.size(); i++)
457  _os << classifVectors[i] << std::endl;
458 }
#define i
std::vector< std::vector< unsigned > > classifVectors
Definition: code_book.h:61

Member Data Documentation

◆ aveDistances

std::vector< double > CodeBook::aveDistances

Definition at line 62 of file code_book.h.

◆ classifVectors

std::vector< std::vector <unsigned> > CodeBook::classifVectors

Definition at line 61 of file code_book.h.


The documentation for this class was generated from the following files: