/****************************************************************************************/ /* */ /* Project : 1D-BRNN */ /* Release : 3.3 */ /* */ /* File : Network.h */ /* Description : Single neural network with one hidden layer */ /* */ /* Author(s) : Christophe Magnan (2013) - New generic version */ /* : Jianlin Cheng (2003) - New custom version for SCRATCH */ /* : Gianluca Pollastri (2001) - Customized version for SCRATCH */ /* : Paolo Frasconi (1997) - Initial generic version */ /* */ /* Copyright : Institute for Genomics and Bioinformatics */ /* University of California, Irvine */ /* */ /* Modified : 2015/07/01 */ /* */ /****************************************************************************************/ #include "Layer.h" class Network { public: // Network parameters int Num_Inputs; // Number of features in input of the network int Num_Hidden; // Number of hidden nodes in the network int Num_Outputs; // Number of output nodes in the network // Network data Layer* Output_Layer; // Output layer of the network Layer* Hidden_Layer; // Hidden layer of the network // Propagation data float* Outputs; // Outputs of the network after the last propagation // Back-Propagation data float* Back_Prop; // Next values to back-propagate in lower networks // Interface Network(); ~Network(); void write(ostream& os); void load(istream& is); void initialize(int inputs,int hidden,int outputs); void alloc_backpropagation(); void reset_gradient(); void propagate(float* inputs); void back_propagate(float* target); void update_gradient(float* inputs); void update_weights(float epsilon); void check_viability(); };