/****************************************************************************************/ /* */ /* Project : 1D-BRNN */ /* Release : 3.3 */ /* */ /* File : Sequence.h */ /* Description : Sequence data and model predictions for the sequence */ /* */ /* 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 "Import.h" class Sequence { public: // Sequence data int Num_Positions; // Number of positions in the sequence int Num_Classes; // Number of possible target classes int* Classes; // Target class of each position in the sequence float** Targets; // Target outputs of the BRNN for each position float** Features; // Input data features for each position // Propagation data int* Predictions; // Predicted class of each position in the sequence float** Outputs_MAIN; // Outputs of the main network of the BRNN for each position float** Outputs_FWD; // Outputs of the forward network of the BRNN for each position float** Outputs_BWD; // Outputs of the backward network of the BRNN for each position // Back-Propagation data float** BackProp_FWD; // Next values to back propagate in the forward network of the BRNN float** BackProp_BWD; // Next values to back propagate in the backward network of the BRNN // Interface Sequence(); ~Sequence(); void load(istream& is,int feat,int cl); void alloc_propagation(int out_fwd,int out_bwd); void alloc_backpropagation(int out_fwd,int out_bwd); void reset_backpropagation(int out_fwd,int out_bwd); void write_predictions(ostream& os); float prediction_error(int pos); void check_viability(); };