#include "keras_model.h"
Definition at line 164 of file keras_model.h.
keras::LayerActivation::LayerActivation |
( |
| ) |
|
|
inline |
Implements keras::Layer.
Definition at line 184 of file keras_model.cc.
References keras::DataChunk::get_1d(), keras::DataChunk::get_3d(), keras::DataChunk::get_data_dim(), keras::missing_activation_impl(), keras::DataChunk::set_data(), and y.
187 vector<vector<vector<float> > >
y = dc->
get_3d();
189 for(
unsigned int i = 0; i < y.size(); ++i) {
190 for(
unsigned int j = 0; j < y[0].size(); ++j) {
191 for(
unsigned int k = 0; k < y[0][0].size(); ++k) {
192 if(y[i][j][k] < 0) y[i][j][k] = 0;
197 for(
unsigned int i = 0; i < y.size(); ++i) {
198 for(
unsigned int j = 0; j < y[0].size(); ++j) {
199 for(
unsigned int k = 0; k < y[0][0].size(); ++k) {
200 y[i][j][k] = tanh(y[i][j][k]);
213 vector<float> y = dc->
get_1d();
215 for(
unsigned int k = 0; k < y.size(); ++k) {
216 if(y[k] < 0) y[k] = 0;
220 for(
unsigned int k = 0; k < y.size(); ++k) {
224 for(
unsigned int k = 0; k < y.size(); ++k) {
228 for(
unsigned int k = 0; k < y.size(); ++k) {
232 for(
unsigned int k = 0; k < y.size(); ++k) {
233 y[k] = 1.0F / (1.0F + exp(-y[k]));
243 }
else {
throw "data dim not supported"; }
virtual void set_data(std::vector< std::vector< std::vector< float > > > const &)
virtual std::vector< std::vector< std::vector< float > > > const & get_3d() const
virtual size_t get_data_dim(void) const
std::string m_activation_type
void missing_activation_impl(const std::string &act)
virtual std::vector< float > const & get_1d() const
virtual unsigned int keras::LayerActivation::get_input_cols |
( |
| ) |
const |
|
inlinevirtual |
virtual unsigned int keras::LayerActivation::get_input_rows |
( |
| ) |
const |
|
inlinevirtual |
std::string keras::Layer::get_name |
( |
| ) |
|
|
inlineinherited |
virtual unsigned int keras::LayerActivation::get_output_units |
( |
| ) |
const |
|
inlinevirtual |
void keras::LayerActivation::load_weights |
( |
std::ifstream & |
fin | ) |
|
|
virtual |
Implements keras::Layer.
Definition at line 84 of file keras_model.cc.
86 cout <<
"Activation type " << m_activation_type << endl;
std::string m_activation_type
std::string keras::LayerActivation::m_activation_type |
std::string keras::Layer::m_name |
|
inherited |
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