#include <keras_model.h>
Definition at line 177 of file keras_model.h.
keras::LayerConv2D::LayerConv2D |
( |
| ) |
|
|
inline |
Implements keras::Layer.
Definition at line 307 of file keras_model.cc.
308 unsigned int st_x = (
m_kernels[0][0].size()-1) >> 1;
309 unsigned int st_y = (
m_kernels[0][0][0].size()-1) >> 1;
322 tbb::parallel_for(
size_t(0),
size_t(
m_kernels.size()), [&](
size_t j ) {
324 for(
unsigned int m = 0;
m <
im.size(); ++
m) {
331 for(
unsigned int x = 0;
x < y_ret[0].size(); ++
x) {
333 size_t size = y_ret[0][0].size();
337 for(
unsigned int y = 0;
y < size/8; ++
y) {
338 y_ret[j][
x][
k] += bias;
339 y_ret[j][
x][k+1] += bias;
340 y_ret[j][
x][k+2] += bias;
341 y_ret[j][
x][k+3] += bias;
342 y_ret[j][
x][k+4] += bias;
343 y_ret[j][
x][k+5] += bias;
344 y_ret[j][
x][k+6] += bias;
345 y_ret[j][
x][k+7] += bias;
348 while (k < size) { y_ret[j][
x][
k] += bias; ++
k; }
void conv_single_depth_valid(std::vector< std::vector< float > > &y, std::vector< std::vector< float > > const &im, std::vector< std::vector< float > > const &k)
std::vector< std::vector< std::vector< std::vector< float > > > > m_kernels
virtual std::vector< std::vector< std::vector< float > > > const & get_3d() const
decltype(auto) constexpr size(T &&obj)
ADL-aware version of std::size.
std::vector< float > m_bias
std::string m_border_mode
std::vector< std::vector< std::vector< float > > > & get_3d_rw()
void conv_single_depth_same(std::vector< std::vector< float > > &y, std::vector< std::vector< float > > const &im, std::vector< std::vector< float > > const &k)
virtual unsigned int keras::LayerConv2D::get_input_cols |
( |
| ) |
const |
|
inlinevirtual |
virtual unsigned int keras::LayerConv2D::get_input_rows |
( |
| ) |
const |
|
inlinevirtual |
virtual unsigned int keras::LayerConv2D::get_output_units |
( |
| ) |
const |
|
inlinevirtual |
void keras::LayerConv2D::load_weights |
( |
std::ifstream & |
fin | ) |
|
|
virtual |
Implements keras::Layer.
Definition at line 40 of file keras_model.cc.
46 if (m_border_mode ==
"[") { m_border_mode =
"valid"; skip =
true; }
52 vector<vector<vector<float> > > tmp_depths;
54 vector<vector<float> > tmp_single_depth;
56 if (!skip) { fin >> tmp_char; }
57 else { skip =
false; }
58 vector<float> tmp_row;
62 tmp_row.push_back(tmp_float);
65 tmp_single_depth.push_back(tmp_row);
67 tmp_depths.push_back(tmp_single_depth);
75 m_bias.push_back(tmp_float);
std::vector< std::vector< std::vector< std::vector< float > > > > m_kernels
std::vector< float > m_bias
std::string m_border_mode
QTextStream & endl(QTextStream &s)
int keras::LayerConv2D::m_cols |
int keras::LayerConv2D::m_depth |
int keras::LayerConv2D::m_kernels_cnt |
int keras::LayerConv2D::m_rows |
The documentation for this class was generated from the following files: