#include "keras_model.h"
Definition at line 176 of file keras_model.h.
keras::LayerActivation::LayerActivation |
( |
| ) |
|
|
inline |
Implements keras::Layer.
Definition at line 190 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(), sum, and y.
194 vector<vector<vector<float>>>
y = dc->
get_3d();
196 for (
unsigned int i = 0; i < y.size(); ++i) {
197 for (
unsigned int j = 0; j < y[0].size(); ++j) {
198 for (
unsigned int k = 0; k < y[0][0].size(); ++k) {
199 if (y[i][j][k] < 0) y[i][j][k] = 0;
205 for (
unsigned int i = 0; i < y.size(); ++i) {
206 for (
unsigned int j = 0; j < y[0].size(); ++j) {
207 for (
unsigned int k = 0; k < y[0][0].size(); ++k) {
208 y[i][j][k] = tanh(y[i][j][k]);
222 vector<float> y = dc->
get_1d();
224 for (
unsigned int k = 0; k < y.size(); ++k) {
225 if (y[k] < 0) y[k] = 0;
230 for (
unsigned int k = 0; k < y.size(); ++k) {
234 for (
unsigned int k = 0; k < y.size(); ++k) {
239 for (
unsigned int k = 0; k < y.size(); ++k) {
244 for (
unsigned int k = 0; k < y.size(); ++k) {
245 y[k] = 1.0F / (1.0F + exp(-y[k]));
257 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 86 of file keras_model.cc.
89 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:
- larrecodnn/v09_23_00/source/larrecodnn/ImagePatternAlgs/Keras/keras_model.h
- larrecodnn/v09_23_00/source/larrecodnn/ImagePatternAlgs/Keras/keras_model.cc