#include <iomanip>
#include "layers/layers.hpp"
#include "network.hpp"
#include "mnist/mnist.hpp"


int main(int argc,char** argv){
  Network N;
    size_t nf=4;
    Layer::Convolution L1(1,28,28,5,5,nf);
    L1.init(0,1);
    Layer::Activation<Layer::Sigmoid> L2(nf*24*24);
    //Layer::Pooling L3(nf,24,24,2,2);
    Layer::FullConnected L4(nf*24*24,10);
    L4.init_standard();
    Layer::Activation<Layer::Sigmoid> L5(10);
    L1.name="[Convolutionnal]";
    L2.name="[Sigmoid of convolutionnal]";
    //L3.name="[Pooling]";
    L4.name="[Full connected]";
    L5.name="[Sigmoid of full]";

    N.push_layer(&L1);
    N.push_layer(&L2);
//    N.push_layer(&L3);
    N.push_layer(&L4);
    N.push_layer(&L5);
    N.is_done();
    Mnist dataset;
    N.train(&dataset,10,10,0.1);


  //exit(0);
/*  Network N;
  size_t nf=4;
  Layer::Convolution L1(1,28,28,5,5,nf);
  L1.init(0,1);
  Layer::Activation<Layer::Sigmoid> L2(nf*24*24);
  Layer::FullConnected L3(nf*24*24,10);
  L3.init_standard();
  Layer::Activation<Layer::Sigmoid> L4(10);
  L1.name="[Convolutionnal]";
  L2.name="[Sigmoid of convolutionnal]";
  L3.name="[Full connected]";
  L4.name="[Sigmoid of full]";

  N.push_layer(&L1);
  N.push_layer(&L2);
  N.push_layer(&L3);
  N.push_layer(&L4);
  N.is_done();
  cout<<"Network out size = "<<N.n_out<<endl;
  Mnist dataset;
 N.train(&dataset,20,10,0.1);
*/
/*  Network N;
  size_t n=20;
  Layer::FullConnected L0(28*28,n);
  L0.init_standard();
  Layer::Activation<Layer::Sigmoid> L1(n);
  Layer::FullConnected L2(n,10);
  L2.init_standard();
  Layer::Activation<Layer::Sigmoid> L3(10);
  L0.name="[Full 0]";
  L1.name="[Sigmoid 0]";
  L2.name="[Full 1]";
  L3.name="[Sigmoid 1]";

  N.push_layer(&L0);
  N.push_layer(&L1);
  N.push_layer(&L2);
  N.push_layer(&L3);
  N.is_done();
  cout<<"Network out size = "<<N.n_out<<endl;
  Mnist dataset;
  N.train(&dataset,20,10,3.0);*/
}
