Neural
conv_layer.h
Go to the documentation of this file.
1 
7 #pragma once
8 #ifndef CONV_LAYER_H
9 #define CONV_LAYER_H
10 
11 #include <iostream>
12 #include <eigen3/Eigen/Dense>
13 #include <EigenRand/EigenRand>
14 #include "layer.h"
15 #include <chrono>
16 using namespace Eigen;
17 
18 typedef Matrix<double,Dynamic,Dynamic,RowMajor> RowMajMat;
19 
20 namespace Neural
21 {
22  class Conv_Layer : public Layer
23  {
24 
25  public:
26  Conv_Layer(std::tuple<int,int,int> dimensions,
27  std::tuple<int,int,int> filter,
28  int stride,
29  int padding);
30 
31  virtual Eigen::MatrixXd Forward_propagation(Eigen::MatrixXd input);
32  virtual Eigen::MatrixXd Backward_propagation(Eigen::MatrixXd output_error, float learning_rate);
33  virtual Json::Value toJSON();
34  Eigen::MatrixXd Init_filters(int dim, int nb);
35  Eigen::MatrixXd GetWeights();
36  Eigen::MatrixXd GetBias();
37 
38  protected:
39  int m_depth;
40  int m_height;
41  int m_width;
44  int m_stride;
45  int m_padding;
46 
49 
51  };
52 }
53 #endif
RowMajMat
Matrix< double, Dynamic, Dynamic, RowMajor > RowMajMat
Definition: conv_layer.h:18
Neural::Conv_Layer::m_width
int m_width
Definition: conv_layer.h:41
layer.h
This class is the Base class for all Layers types.
Neural::Conv_Layer::m_padding
int m_padding
Definition: conv_layer.h:45
Neural::Conv_Layer::m_filter_size
int m_filter_size
Definition: conv_layer.h:42
Neural::Conv_Layer::m_bias
RowMajMat m_bias
Definition: conv_layer.h:48
Neural::Conv_Layer::m_nb_filters
int m_nb_filters
Definition: conv_layer.h:43
Neural::Conv_Layer::m_height
int m_height
Definition: conv_layer.h:40
RowMajMat
Matrix< double, Dynamic, Dynamic, RowMajor > RowMajMat
Definition: flatten_layer.cpp:16
Neural::Conv_Layer::m_filter
RowMajMat m_filter
Definition: conv_layer.h:50
Neural::Conv_Layer::m_depth
int m_depth
Definition: conv_layer.h:39
Neural::Conv_Layer::m_stride
int m_stride
Definition: conv_layer.h:44
Neural::Layer
Definition: layer.h:18
Neural::Conv_Layer
Definition: conv_layer.h:22
Neural::Conv_Layer::m_weights
RowMajMat m_weights
Definition: conv_layer.h:47
Neural
Definition: activation.h:10