better network model

This commit is contained in:
Francesco Gatti
2017-08-01 23:03:02 +02:00
parent 300b0af5dd
commit e8355cee67
22 changed files with 166 additions and 179 deletions
+30 -2
View File
@@ -5,14 +5,39 @@
namespace tkDNN {
struct dataDim_t;
/**
Data rapresentation beetween layers
n = batch size
c = channels
h = heigth (lines)
w = width (rows)
l = lenght (3rd dimension)
*/
struct dataDim_t {
int n, c, h, w, l;
dataDim_t() : n(1), c(1), h(1), w(1), l(1) {};
dataDim_t(int _n, int _c, int _h, int _w, int _l = 1) :
n(_n), c(_c), h(_h), w(_w), l(_l) {};
void print() {
std::cout<<"Data dim: "<<n<<" "<<c<<" "<<h<<" "<<w<<" "<<l<<"\n";
}
int tot() {
return n*c*h*w*l;
}
};
class Layer;
const int MAX_LAYERS = 256;
class Network {
public:
Network();
Network(dataDim_t input_dim);
virtual ~Network();
/**
@@ -29,6 +54,9 @@ public:
Layer* layers[MAX_LAYERS]; //contains layers of the net
int num_layers; //current number of layers
dataDim_t input_dim;
dataDim_t getOutputDim();
};
}