00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032 #ifndef EBLLAYERS_H_
00033 #define EBLLAYERS_H_
00034
00035 #include "Defines.h"
00036 #include "Idx.h"
00037 #include "Blas.h"
00038 #include "EblStates.h"
00039 #include "EblBasic.h"
00040 #include "EblArch.h"
00041 #include "EblNonLinearity.h"
00042
00043 #ifdef __GUI__
00044 #include "libidxgui.h"
00045 #endif
00046
00047 namespace ebl {
00048
00051 class nn_layer_full: public module_1_1<state_idx, state_idx> {
00052 public:
00053 linear_module_replicable linear;
00054 addc_module adder;
00055 tanh_module sigmoid;
00056 state_idx *sum;
00057
00061 nn_layer_full(parameter &p, intg indim0, intg noutputs);
00062 virtual ~nn_layer_full();
00064 void fprop(state_idx &in, state_idx &out);
00066 void bprop(state_idx &in, state_idx &out);
00068 void bbprop(state_idx &in, state_idx &out);
00070 void forget(forget_param_linear &fp);
00072 void display_fprop(state_idx &in, state_idx &out,
00073 unsigned int &h0, unsigned int &w0, double zoom,
00074 bool show_out = false);
00075 };
00076
00079 class nn_layer_convolution: public module_1_1<state_idx, state_idx> {
00080 public:
00082 convolution_module_2D_replicable convol;
00083 addc_module adder;
00084 tanh_module sigmoid;
00085 state_idx *sum;
00086
00090 nn_layer_convolution(parameter &p, intg kerneli, intg kernelj,
00091 intg ri, intg rj, Idx<intg> &tbl, intg thick);
00092 virtual ~nn_layer_convolution();
00094 void fprop(state_idx &in, state_idx &out);
00096 void bprop(state_idx &in, state_idx &out);
00098 void bbprop(state_idx &in, state_idx &out);
00100 void forget(forget_param_linear &fp);
00102 void display_fprop(state_idx &in, state_idx &out,
00103 unsigned int &h0, unsigned int &w0, double zoom,
00104 bool show_out = false);
00105 };
00106
00109 class nn_layer_subsampling: public module_1_1<state_idx, state_idx> {
00110 public:
00111 subsampling_module_2D_replicable subsampler;
00112 addc_module adder;
00113 tanh_module sigmoid;
00114 state_idx *sum;
00115
00119 nn_layer_subsampling(parameter &p, intg stridei, intg stridej,
00120 intg subi, intg subj,
00121 intg thick);
00122 virtual ~nn_layer_subsampling();
00124 void fprop(state_idx &in, state_idx &out);
00126 void bprop(state_idx &in, state_idx &out);
00128 void bbprop(state_idx &in, state_idx &out);
00130 void forget(forget_param_linear &fp);
00132 void display_fprop(state_idx &in, state_idx &out,
00133 unsigned int &h0, unsigned int &w0, double zoom,
00134 bool show_out = false);
00135 };
00136
00137 }
00138
00139 #endif