Public Member Functions | Public Attributes | List of all members
keras::DataChunk2D Class Reference

#include "/cvmfs/nova-development.opensciencegrid.org/novasoft/releases/N21-05-05/ExoticsTriggers/KerasModel.h"

Inheritance diagram for keras::DataChunk2D:
keras::DataChunk keras::DataChunk

Public Member Functions

std::vector< std::vector< std::vector< float > > > const & get_3d () const
 
virtual void set_data (std::vector< std::vector< std::vector< float > > > const &d)
 
size_t get_data_dim (void) const
 
void show_name ()
 
void show_values ()
 
void read_from_file (const std::string &fname)
 
std::vector< std::vector< std::vector< float > > > const & get_3d () const
 
virtual void set_data (std::vector< std::vector< std::vector< float > > > const &d)
 
size_t get_data_dim (void) const
 
void show_name ()
 
void show_values ()
 
void read_from_file (const std::string &fname)
 
virtual std::vector< float > const & get_1d () const
 
virtual std::vector< float > const & get_1d () const
 
virtual void set_data (std::vector< float > const &)
 

Public Attributes

std::vector< std::vector< std::vector< float > > > data
 
int m_depth
 
int m_rows
 
int m_cols
 

Detailed Description

Definition at line 46 of file KerasModel.h.

Member Function Documentation

virtual std::vector<float> const& keras::DataChunk::get_1d ( ) const
inlinevirtualinherited

Reimplemented in keras::DataChunkFlat, and keras::DataChunkFlat.

Definition at line 34 of file KerasModel.h.

34 { throw "not implemented"; };
virtual std::vector<float> const& keras::DataChunk::get_1d ( ) const
inlinevirtualinherited
std::vector< std::vector< std::vector<float> > > const& keras::DataChunk2D::get_3d ( ) const
inlinevirtual

Reimplemented from keras::DataChunk.

Definition at line 47 of file KerasModel.h.

47 { return data; };
std::vector< std::vector< std::vector< float > > > data
Definition: KerasModel.h:75
std::vector< std::vector< std::vector<float> > > const& keras::DataChunk2D::get_3d ( ) const
inlinevirtual

Reimplemented from keras::DataChunk.

Definition at line 49 of file KerasModel.h.

49 { return data; };
std::vector< std::vector< std::vector< float > > > data
Definition: KerasModel.h:75
size_t keras::DataChunk2D::get_data_dim ( void  ) const
inlinevirtual

Reimplemented from keras::DataChunk.

Definition at line 49 of file KerasModel.h.

49 { return 3; }
size_t keras::DataChunk2D::get_data_dim ( void  ) const
inlinevirtual

Reimplemented from keras::DataChunk.

Definition at line 52 of file KerasModel.h.

52 { return 3; }
void keras::DataChunk2D::read_from_file ( const std::string fname)
virtual

Reimplemented from keras::DataChunk.

void keras::DataChunk2D::read_from_file ( const std::string fname)
virtual

Reimplemented from keras::DataChunk.

Definition at line 24 of file KerasModel.cxx.

References d, fin, r(), and keras::read_1d_array().

24  {
25  ifstream fin(fname.c_str());
26  fin >> m_depth >> m_rows >> m_cols;
27 
28  for(int d = 0; d < m_depth; ++d) {
29  vector<vector<float> > tmp_single_depth;
30  for(int r = 0; r < m_rows; ++r) {
31  vector<float> tmp_row = keras::read_1d_array(fin, m_cols);
32  tmp_single_depth.push_back(tmp_row);
33  }
34  data.push_back(tmp_single_depth);
35  }
36  fin.close();
37 }
TString fin
Definition: Style.C:24
const XML_Char const XML_Char * data
Definition: expat.h:268
Float_t d
Definition: plot.C:236
TRandom3 r(0)
std::vector< float > read_1d_array(std::ifstream &fin, int cols)
Definition: KerasModel.cxx:11
virtual void keras::DataChunk::set_data ( std::vector< float > const &  )
inlinevirtualinherited

Reimplemented in keras::DataChunkFlat, and keras::DataChunkFlat.

Definition at line 39 of file KerasModel.h.

39 {};
virtual void keras::DataChunk2D::set_data ( std::vector< std::vector< std::vector< float > > > const &  d)
inlinevirtual

Reimplemented from keras::DataChunk.

Definition at line 48 of file KerasModel.h.

References d.

48 { data = d; };
const XML_Char const XML_Char * data
Definition: expat.h:268
Float_t d
Definition: plot.C:236
virtual void keras::DataChunk2D::set_data ( std::vector< std::vector< std::vector< float > > > const &  d)
inlinevirtual

Reimplemented from keras::DataChunk.

Definition at line 51 of file KerasModel.h.

References d.

51 { data = d; };
const XML_Char const XML_Char * data
Definition: expat.h:268
Float_t d
Definition: plot.C:236
void keras::DataChunk2D::show_name ( )
inlinevirtual

Implements keras::DataChunk.

Definition at line 51 of file KerasModel.h.

References om::cout, and allTimeWatchdog::endl.

51  {
52  std::cout << "DataChunk2D " << data.size() << "x" << data[0].size() << "x" << data[0][0].size() << std::endl;
53  }
const XML_Char const XML_Char * data
Definition: expat.h:268
OStream cout
Definition: OStream.cxx:6
void keras::DataChunk2D::show_name ( )
inlinevirtual

Implements keras::DataChunk.

Definition at line 54 of file KerasModel.h.

54  {
55  // std::cout << "DataChunk2D " << data.size() << "x" << data[0].size() << "x" << data[0][0].size() << std::endl;
56  }
void keras::DataChunk2D::show_values ( )
inlinevirtual

Implements keras::DataChunk.

Definition at line 55 of file KerasModel.h.

References om::cout, allTimeWatchdog::endl, plot_validation_datamc::fname, MECModelEnuComparisons::i, calib::j, keras::DataChunk::read_from_file(), keras::DataChunk::set_data(), and string.

55  {
56  std::cout << "DataChunk2D values:" << std::endl;
57  for(size_t i = 0; i < data.size(); ++i) {
58  std::cout << "Kernel " << i << std::endl;
59  for(size_t j = 0; j < data[0].size(); ++j) {
60  for(size_t k = 0; k < data[0][0].size(); ++k) {
61  std::cout << data[i][j][k] << " ";
62  }
64  }
65  }
66  }
const XML_Char const XML_Char * data
Definition: expat.h:268
const double j
Definition: BetheBloch.cxx:29
OStream cout
Definition: OStream.cxx:6
void keras::DataChunk2D::show_values ( )
inlinevirtual

Implements keras::DataChunk.

Definition at line 58 of file KerasModel.h.

References plot_validation_datamc::fname, MECModelEnuComparisons::i, calib::j, keras::DataChunk::read_from_file(), and string.

58  {
59  //std::cout << "DataChunk2D values:" << std::endl;
60  for(size_t i = 0; i < data.size(); ++i) {
61  // std::cout << "Kernel " << i << std::endl;
62  for(size_t j = 0; j < data[0].size(); ++j) {
63  for(size_t k = 0; k < data[0][0].size(); ++k) {
64  // std::cout << data[i][j][k] << " ";
65  }
66  // std::cout << std::endl;
67  }
68  }
69  }
const XML_Char const XML_Char * data
Definition: expat.h:268
const double j
Definition: BetheBloch.cxx:29

Member Data Documentation

std::vector< std::vector< std::vector< float > > > keras::DataChunk2D::data

Definition at line 75 of file KerasModel.h.

int keras::DataChunk2D::m_cols

Definition at line 79 of file KerasModel.h.

int keras::DataChunk2D::m_depth

Definition at line 77 of file KerasModel.h.

int keras::DataChunk2D::m_rows

Definition at line 78 of file KerasModel.h.


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