#ifndef LAYER_FULLCONNECTED_HPP
#define LAYER_FULLCONNECTED_HPP

#include <random>
#include "layer.hpp"

namespace Layer{
  class FullConnected:public Layer{
  public:
    //9using Layer::x_out;
    Vector b;
    Vector w;
    Vector nabla_b;
    Vector nabla_w;
  public:
    FullConnected(size_t n_in,size_t n_out);
    ~FullConnected();
    void init(Real m,Real d);
    void init_standard();
    Vector feed_forward(Vector x);
    void init_nabla();
    Vector back_propagation(Vector d);
    void update(Real eta);
  };

  inline
  FullConnected::FullConnected(size_t n_in,size_t n_out):Layer(n_in,n_out){
    b=init_vector(n_out);
    w=init_vector(n_out*n_in);
    nabla_b=init_vector(n_out);
    nabla_w=init_vector(n_out*n_in);
  }

  inline
  FullConnected::~FullConnected(){
    delete_vector(b);
    delete_vector(w);
    delete_vector(nabla_b);
    delete_vector(nabla_w);
  }

}

#endif
