#include "keras_model.h"
Definition at line 229 of file keras_model.h.
keras::KerasModel::KerasModel |
( |
const std::string & |
input_fname | ) |
|
Definition at line 123 of file keras_model.cc.
void load_weights(const std::string &input_fname)
keras::KerasModel::~KerasModel |
( |
| ) |
|
Definition at line 495 of file keras_model.cc.
497 for (
int i = 0; i < (int)
m_layers.size(); ++i) {
std::vector< Layer * > m_layers
unsigned int keras::KerasModel::get_input_cols |
( |
| ) |
const |
|
inline |
Definition at line 236 of file keras_model.h.
236 {
return m_layers.front()->get_input_cols(); }
std::vector< Layer * > m_layers
unsigned int keras::KerasModel::get_input_rows |
( |
| ) |
const |
|
inline |
Definition at line 235 of file keras_model.h.
235 {
return m_layers.front()->get_input_rows(); }
std::vector< Layer * > m_layers
int keras::KerasModel::get_output_length |
( |
| ) |
const |
Definition at line 502 of file keras_model.cc.
505 while ((i > 0) && (
m_layers[i]->get_output_units() == 0))
507 return m_layers[i]->get_output_units();
std::vector< Layer * > m_layers
void keras::KerasModel::load_weights |
( |
const std::string & |
input_fname | ) |
|
|
private |
Definition at line 452 of file keras_model.cc.
References fin, and keras::Layer::load_weights().
454 cout <<
"Reading model from " << input_fname << endl;
455 ifstream
fin(input_fname.c_str());
456 string layer_type =
"";
461 cout <<
"Layers " << m_layers_cnt << endl;
464 fin >> tmp_str >> tmp_int >> layer_type;
465 cout <<
"Layer " << tmp_int <<
" " << layer_type << endl;
468 if (layer_type ==
"Convolution2D") { l =
new LayerConv2D(); }
469 else if (layer_type ==
"Activation") {
470 l =
new LayerActivation();
472 else if (layer_type ==
"MaxPooling2D") {
473 l =
new LayerMaxPooling();
475 else if (layer_type ==
"Flatten") {
476 l =
new LayerFlatten();
478 else if (layer_type ==
"Dense") {
479 l =
new LayerDense();
481 else if (layer_type ==
"Dropout") {
485 cout <<
"Layer is empty, maybe it is not defined? Cannot define network." << endl;
488 l->load_weights(
fin);
std::vector< Layer * > m_layers
std::vector<Layer*> keras::KerasModel::m_layers |
|
private |
int keras::KerasModel::m_layers_cnt |
|
private |
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