#include "keras_model.h"
Definition at line 197 of file keras_model.h.
keras::LayerDense::LayerDense |
( |
| ) |
|
|
inline |
Implements keras::Layer.
Definition at line 366 of file keras_model.cc.
References keras::DataChunk::get_1d(), keras::DataChunkFlat::get_1d_rw(), and w.
371 size_t size8 = size >> 3;
376 auto const & im = dc->
get_1d();
378 for (
size_t j = 0; j <
m_weights.size(); ++j) {
382 for (
size_t i = 0; i < size8; ++i) {
383 y_ret[k] += w[k] * p;
384 y_ret[k+1] += w[k+1] * p;
385 y_ret[k+2] += w[k+2] * p;
386 y_ret[k+3] += w[k+3] * p;
387 y_ret[k+4] += w[k+4] * p;
388 y_ret[k+5] += w[k+5] * p;
389 y_ret[k+6] += w[k+6] * p;
390 y_ret[k+7] += w[k+7] * p;
393 while (k < size) { y_ret[k] += w[k] * p; ++k; }
395 for (
size_t i = 0; i < size; ++i) {
std::vector< std::vector< float > > m_weights
std::vector< float > & get_1d_rw()
std::vector< float > m_bias
virtual std::vector< float > const & get_1d() const
virtual unsigned int keras::LayerDense::get_input_cols |
( |
| ) |
const |
|
inlinevirtual |
virtual unsigned int keras::LayerDense::get_input_rows |
( |
| ) |
const |
|
inlinevirtual |
std::string keras::Layer::get_name |
( |
| ) |
|
|
inlineinherited |
virtual unsigned int keras::LayerDense::get_output_units |
( |
| ) |
const |
|
inlinevirtual |
void keras::LayerDense::load_weights |
( |
std::ifstream & |
fin | ) |
|
|
virtual |
Implements keras::Layer.
Definition at line 94 of file keras_model.cc.
References n.
103 tmp_n.push_back(tmp_float);
108 cout <<
"weights " <<
m_weights.size() << endl;
112 m_bias.push_back(tmp_float);
115 cout <<
"bias " <<
m_bias.size() << endl;
std::vector< std::vector< float > > m_weights
std::vector< float > m_bias
std::vector<float> keras::LayerDense::m_bias |
int keras::LayerDense::m_input_cnt |
std::string keras::Layer::m_name |
|
inherited |
int keras::LayerDense::m_neurons |
std::vector<std::vector<float> > keras::LayerDense::m_weights |
The documentation for this class was generated from the following files:
- larreco/v06_64_02/source/larreco/RecoAlg/ImagePatternAlgs/Keras/keras_model.h
- larreco/v06_64_02/source/larreco/RecoAlg/ImagePatternAlgs/Keras/keras_model.cc