#include "keras_model.h"
Definition at line 214 of file keras_model.h.
keras::KerasModel::KerasModel |
( |
const std::string & |
input_fname | ) |
|
Definition at line 119 of file keras_model.cc.
void load_weights(const std::string &input_fname)
keras::KerasModel::~KerasModel |
( |
| ) |
|
Definition at line 472 of file keras_model.cc.
473 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 221 of file keras_model.h.
221 {
return m_layers.front()->get_input_cols(); }
std::vector< Layer * > m_layers
unsigned int keras::KerasModel::get_input_rows |
( |
| ) |
const |
|
inline |
Definition at line 220 of file keras_model.h.
220 {
return m_layers.front()->get_input_rows(); }
std::vector< Layer * > m_layers
int keras::KerasModel::get_output_length |
( |
| ) |
const |
Definition at line 478 of file keras_model.cc.
481 while ((i > 0) && (
m_layers[i]->get_output_units() == 0)) --i;
482 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 433 of file keras_model.cc.
References fin, and keras::Layer::load_weights().
434 cout <<
"Reading model from " << input_fname << endl;
435 ifstream
fin(input_fname.c_str());
436 string layer_type =
"";
441 cout <<
"Layers " << m_layers_cnt << endl;
444 fin >> tmp_str >> tmp_int >> layer_type;
445 cout <<
"Layer " << tmp_int <<
" " << layer_type << endl;
448 if(layer_type ==
"Convolution2D") {
449 l =
new LayerConv2D();
450 }
else if(layer_type ==
"Activation") {
451 l =
new LayerActivation();
452 }
else if(layer_type ==
"MaxPooling2D") {
453 l =
new LayerMaxPooling();
454 }
else if(layer_type ==
"Flatten") {
455 l =
new LayerFlatten();
456 }
else if(layer_type ==
"Dense") {
457 l =
new LayerDense();
458 }
else if(layer_type ==
"Dropout") {
462 cout <<
"Layer is empty, maybe it is not defined? Cannot define network." << endl;
465 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:
- larreco/v06_64_02/source/larreco/RecoAlg/ImagePatternAlgs/Keras/keras_model.h
- larreco/v06_64_02/source/larreco/RecoAlg/ImagePatternAlgs/Keras/keras_model.cc