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

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

Inheritance diagram for keras::LayerMaxPooling:
keras::Layer keras::Layer

Public Member Functions

 LayerMaxPooling ()
 
void load_weights (std::ifstream &fin)
 
keras::DataChunkcompute_output (keras::DataChunk *)
 
virtual unsigned int get_input_rows () const
 
virtual unsigned int get_input_cols () const
 
virtual unsigned int get_output_units () const
 
 LayerMaxPooling ()
 
void load_weights (std::ifstream &fin)
 
keras::DataChunkcompute_output (keras::DataChunk *)
 
virtual unsigned int get_input_rows () const
 
virtual unsigned int get_input_cols () const
 
virtual unsigned int get_output_units () const
 
std::string get_name ()
 
std::string get_name ()
 

Public Attributes

int m_pool_x
 
int m_pool_y
 
std::string m_name
 

Detailed Description

Definition at line 135 of file KerasModel.h.

Constructor & Destructor Documentation

keras::LayerMaxPooling::LayerMaxPooling ( )
inline

Definition at line 137 of file KerasModel.h.

References fin.

137 : Layer("MaxPooling2D") {};
Layer(std::string name)
Definition: KerasModel.h:111
keras::LayerMaxPooling::LayerMaxPooling ( )
inline

Definition at line 135 of file KerasModel.h.

References fin.

135 : Layer("MaxPooling2D") {};
Layer(std::string name)
Definition: KerasModel.h:111

Member Function Documentation

keras::DataChunk* keras::LayerMaxPooling::compute_output ( keras::DataChunk )
virtual

Implements keras::Layer.

keras::DataChunk * keras::LayerMaxPooling::compute_output ( keras::DataChunk dc)
virtual

Implements keras::Layer.

Definition at line 135 of file KerasModel.cxx.

References om::cout, d, allTimeWatchdog::endl, exit(), keras::DataChunk::get_3d(), MECModelEnuComparisons::i, makeTrainCVSamples::int, calib::j, keras::missing_activation_impl(), confusionMatrixTree::out, gen_hdf5record::size, train_latest_snapshot::values, submit_syst::x, and submit_syst::y.

Referenced by keras::KerasModel::KerasModel().

135  {
136  vector<vector<vector<float> > > im = dc->get_3d();
137  vector<vector<vector<float> > > y_ret;
138  for(unsigned int i = 0; i < im.size(); ++i) {
139  vector<vector<float> > tmp_y;
140  for(unsigned int j = 0; j < (unsigned int)(im[0].size()/m_pool_x); ++j) {
141  tmp_y.push_back(vector<float>((int)(im[0][0].size()/m_pool_y), 0.0));
142  }
143  y_ret.push_back(tmp_y);
144  }
145  for(unsigned int d = 0; d < y_ret.size(); ++d) {
146  for(unsigned int x = 0; x < y_ret[0].size(); ++x) {
147  unsigned int start_x = x*m_pool_x;
148  unsigned int end_x = start_x + m_pool_x;
149  for(unsigned int y = 0; y < y_ret[0][0].size(); ++y) {
150  unsigned int start_y = y*m_pool_y;
151  unsigned int end_y = start_y + m_pool_y;
152 
153  vector<float> values;
154  for(unsigned int i = start_x; i < end_x; ++i) {
155  for(unsigned int j = start_y; j < end_y; ++j) {
156  values.push_back(im[d][i][j]);
157  }
158  }
159  y_ret[d][x][y] = *max_element(values.begin(), values.end());
160  }
161  }
162  }
164  out->set_data(y_ret);
165  return out;
166 }
virtual std::vector< std::vector< std::vector< float > > > const & get_3d() const
Definition: KerasModel.h:37
Float_t d
Definition: plot.C:236
const double j
Definition: BetheBloch.cxx:29
virtual unsigned int keras::LayerMaxPooling::get_input_cols ( ) const
inlinevirtual

Implements keras::Layer.

Definition at line 141 of file KerasModel.h.

141 { return 0; } // same as for rows
virtual unsigned int keras::LayerMaxPooling::get_input_cols ( ) const
inlinevirtual

Implements keras::Layer.

Definition at line 143 of file KerasModel.h.

143 { return 0; } // same as for rows
virtual unsigned int keras::LayerMaxPooling::get_input_rows ( ) const
inlinevirtual

Implements keras::Layer.

Definition at line 140 of file KerasModel.h.

140 { return 0; } // look for the value in the preceding layer
virtual unsigned int keras::LayerMaxPooling::get_input_rows ( ) const
inlinevirtual

Implements keras::Layer.

Definition at line 142 of file KerasModel.h.

142 { return 0; } // look for the value in the preceding layer
std::string keras::Layer::get_name ( )
inlineinherited

Definition at line 116 of file KerasModel.h.

References string.

116 { return m_name; }
std::string m_name
Definition: KerasModel.h:119
std::string keras::Layer::get_name ( )
inlineinherited

Definition at line 118 of file KerasModel.h.

118 { return m_name; }
std::string m_name
Definition: KerasModel.h:119
virtual unsigned int keras::LayerMaxPooling::get_output_units ( ) const
inlinevirtual

Implements keras::Layer.

Definition at line 142 of file KerasModel.h.

142 { return 0; }
virtual unsigned int keras::LayerMaxPooling::get_output_units ( ) const
inlinevirtual

Implements keras::Layer.

Definition at line 144 of file KerasModel.h.

144 { return 0; }
void keras::LayerMaxPooling::load_weights ( std::ifstream &  fin)
virtual

Implements keras::Layer.

void keras::LayerMaxPooling::load_weights ( std::ifstream &  fin)
virtual

Implements keras::Layer.

Definition at line 82 of file KerasModel.cxx.

82  {
83  fin >> m_pool_x >> m_pool_y;
84 }
TString fin
Definition: Style.C:24

Member Data Documentation

std::string keras::Layer::m_name
inherited

Definition at line 119 of file KerasModel.h.

int keras::LayerMaxPooling::m_pool_x

Definition at line 146 of file KerasModel.h.

int keras::LayerMaxPooling::m_pool_y

Definition at line 147 of file KerasModel.h.


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