#include "keras_model.h"
Definition at line 212 of file keras_model.h.
keras::LayerDense::LayerDense |
( |
| ) |
|
|
inline |
Implements keras::Layer.
Definition at line 381 of file keras_model.cc.
References keras::DataChunk::get_1d(), keras::DataChunkFlat::get_1d_rw(), util::size(), and w.
387 size_t size8 = size >> 3;
392 auto const& im = dc->
get_1d();
394 for (
size_t j = 0; j <
m_weights.size(); ++j) {
398 for (
size_t i = 0; i < size8; ++i) {
399 y_ret[k] += w[k] * p;
400 y_ret[k + 1] += w[k + 1] * p;
401 y_ret[k + 2] += w[k + 2] * p;
402 y_ret[k + 3] += w[k + 3] * p;
403 y_ret[k + 4] += w[k + 4] * p;
404 y_ret[k + 5] += w[k + 5] * p;
405 y_ret[k + 6] += w[k + 6] * p;
406 y_ret[k + 7] += w[k + 7] * p;
410 y_ret[k] += w[k] * p;
414 for (
size_t i = 0; i <
size; ++i) {
std::vector< std::vector< float > > m_weights
decltype(auto) constexpr size(T &&obj)
ADL-aware version of std::size.
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 98 of file keras_model.cc.
References n.
108 tmp_n.push_back(tmp_float);
113 cout <<
"weights " <<
m_weights.size() << endl;
117 m_bias.push_back(tmp_float);
120 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:
- larrecodnn/v09_23_00/source/larrecodnn/ImagePatternAlgs/Keras/keras_model.h
- larrecodnn/v09_23_00/source/larrecodnn/ImagePatternAlgs/Keras/keras_model.cc