#ifndef Layer_h #define Layer_h 1 #include "General.h" #include // Layer ver 2.0 // // ANN Layers // Linear, tanh and softmax outputs // Categorical (one-hot), real-valued and mixed inputs. class Layer { protected: int NY; int NU; int NUr; int* NK; Float* Y; Float* A; Float* U; //NU*NK Float* delta; //NY Float* backprop; //NU*NK Float*** W; Float*** dW; Float* B; //NY Float* dB; //NY int level; //1=in,2=out void alloc(int NY, int NU, int* NK); public: void softmax(); void squash(); // Constructor // Categorical inputs Layer(int t_NY, int* t_NK, int t_NU) : NY(t_NY), NU(t_NU) { NK=new int[NU]; for (int i=0; i