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

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

Inheritance diagram for keras::LayerFlatten:
keras::Layer keras::Layer

Public Member Functions

 LayerFlatten ()
 
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
 
 LayerFlatten ()
 
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

std::string m_name
 

Detailed Description

Definition at line 123 of file KerasModel.h.

Constructor & Destructor Documentation

keras::LayerFlatten::LayerFlatten ( )
inline

Definition at line 125 of file KerasModel.h.

125 : Layer("Flatten") {}
Layer(std::string name)
Definition: KerasModel.h:111
keras::LayerFlatten::LayerFlatten ( )
inline

Definition at line 123 of file KerasModel.h.

123 : Layer("Flatten") {}
Layer(std::string name)
Definition: KerasModel.h:111

Member Function Documentation

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

Implements keras::Layer.

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

Implements keras::Layer.

Definition at line 114 of file KerasModel.cxx.

References dst, keras::DataChunkFlat::get_1d_rw(), keras::DataChunk::get_3d(), MECModelEnuComparisons::i, calib::j, confusionMatrixTree::out, check_grl::row, and gen_hdf5record::size.

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

114  {
115  vector<vector<vector<float> > > im = dc->get_3d();
116 
117  size_t csize = im[0].size();
118  size_t rsize = im[0][0].size();
119  size_t size = im.size() * csize * rsize;
120  keras::DataChunkFlat *out = new DataChunkFlat(size);
121  float * y_ret = out->get_1d_rw().data();
122  for(size_t i = 0, dst = 0; i < im.size(); ++i) {
123  for(size_t j = 0; j < csize; ++j) {
124  float * row = im[i][j].data();
125  for(size_t k = 0; k < rsize; ++k) {
126  y_ret[dst++] = row[k];
127  }
128  }
129  }
130 
131  return out;
132 }
char * dst
Definition: lz4.h:458
virtual std::vector< std::vector< std::vector< float > > > const & get_3d() const
Definition: KerasModel.h:37
const double j
Definition: BetheBloch.cxx:29
std::vector< float > & get_1d_rw()
Definition: KerasModel.h:89
virtual unsigned int keras::LayerFlatten::get_input_cols ( ) const
inlinevirtual

Implements keras::Layer.

Definition at line 128 of file KerasModel.h.

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

Implements keras::Layer.

Definition at line 130 of file KerasModel.h.

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

Implements keras::Layer.

Definition at line 127 of file KerasModel.h.

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

Implements keras::Layer.

Definition at line 129 of file KerasModel.h.

129 { 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::LayerFlatten::get_output_units ( ) const
inlinevirtual

Implements keras::Layer.

Definition at line 129 of file KerasModel.h.

129 { return 0; }
virtual unsigned int keras::LayerFlatten::get_output_units ( ) const
inlinevirtual

Implements keras::Layer.

Definition at line 131 of file KerasModel.h.

131 { return 0; }
void keras::LayerFlatten::load_weights ( std::ifstream &  fin)
inlinevirtual

Implements keras::Layer.

Definition at line 124 of file KerasModel.h.

124 {};
void keras::LayerFlatten::load_weights ( std::ifstream &  fin)
inlinevirtual

Implements keras::Layer.

Definition at line 126 of file KerasModel.h.

126 {};

Member Data Documentation

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

Definition at line 119 of file KerasModel.h.


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