📄 main.h
字号:
/* * $Id: main.h 1272 2007-05-09 16:26:20Z mhe $ */ #ifndef MAINH#define MAINHint /*number inputs */ in_mod, /*number inputs plus bias to hidden layer */ in_mod_b, /* inputs not null */ in_nn_mod, /*number outputs */ out_mod, /*number input and hidden units and gates and memory cells */ cell_mod, /* number of memory cell blocks */ num_blocks, /* Size of the memory cell blocks */ block_size[MAXBLOCKS], /* number of all units */ ges_mod, /* random number generator init */ ran_sta, /* performing a test on a test set? if ((epoch%test_aus==0)||(class_err<min_fehl)) */ test_aus, min_fehl, /* write the weight matrix after w_out epochs */ w_out, /* should the net still be learning --> learn=1 */ learn, /* is stop to learn set? --> stop_learn=1 */ stop_learn, /* max. number of trials to be performed */ maxtrials, /* reset after each sequence? */ sequ_reset, training_size, test_size, /* max. number of epochs before learning stop*/ maxepoch, maxepoch_init, /* bias1==1 --> hidden units, with gates, and cells biased */ bias1, /* bias2==1 --> output units biased */ bias2, /* is target provided for the current input */ targ, /* element in a sequence of the test set */ element_t, /* current number of sequence of test set */ example_t, /* misclassifications per epoch */ class_err, classnon_err, /* when to stop learning: wrong classifications per epoch < stop_class */ stop_class, /* epochs to be learned after stop learning is set */ ext_epochs, /* 1 if the current sequence has been processed correctly so far */ seq_cor, /* 1 if end of the test set */ test_end, /* weight_up == 1 then weight update */ weight_up, /* w_up if w_up == 1 then weight update per sequence otherwise per epoch*/ w_up, /* element in a sequence of the training set */ element, /* current number of sequence in training set */ example, /* number of sequences seen by the net */ numb_seq, /* number of epochs seen by the net */ epoch, /* length of the training sequences */ *length, /* length of the test sequences */ *length_t, /* maximum sequence length train */ maxseqlen, /* maximum sequence length test */ maxseqlen_t, /* perform test */ dotest;double /* weight matrix */ **W, /* input gates */ *Y_in, /* output gates */ *Y_out, /* new activation for all units */ *Yk_new, /* old activations */ *Yk_old, /* function g for each cell */ **G, /* function h for each cell */ **H, /* internal state for each cell */ **S, /* output for each cell */ **Yc, /* derivative with respect to weights to input gate for each cell */ ***SI, /* derivative with respect to weights to cell input for each cell */ ***SC, /* initial input and output gate bias for each block */ bias_memin[MAXBLOCKS], bias_inp[MAXBLOCKS], bias_out[MAXBLOCKS], weight_memout[MAXBLOCKS], /* interval of weight initialization is init_range*[-1,1] */ init_range, /* current target */ target, alpha, /* MSE per epoch */ epoch_err, /* MSE per sequence */ seq_err, /* when to stop learning: MSE per epoch < stop_mse */ stop_mse, /* error for output units */ error[OUT_UNITS], /* max. allowed error per sequence for correct classification */ seq_max; /* array for storing the target per training element per seqence element for one output component */int *tar; /* matrix for storing the input per training element perseqence element per input component */double **inp;/* matrix for storing the input indexes per training element perseqence element per input component */int **inp_idx; /* array for storing the target per test element perseqence element for one output component */int *tar_t; /* matrix for storing the input per test element perseqence element per input component */double **inp_t; /* matrix for storing the input indices per test element perseqence element per input component */int **inp_idx_t; /* contribution to update of weight matrix */double **DW, **DWold;/* AA Symbols */char **aaSym, **aaSym_t;/* targets raw */double *targets, *targets_t;/* input activations not null */int in_nn_mod;int maxseqlentrain, maxseqlentest, windowsize, wside;double outputbias, targetvalue0, targetvalue1, momentumtermfactor;char traindata_positive[MAXFILENAMELEN], traindata_negative[MAXFILENAMELEN], testdata_positive[MAXFILENAMELEN], testdata_negative[MAXFILENAMELEN];/* the output and weight files for 20 trials */const char*outfile = "out.txt",*weightfile = "weight.mat"; char **fasta_desc, **fasta_desc_t; void output_epoch();void weight_out(double **);void write_info();void execute_act_test();void execute_act();void forward_pass(int, int, int **, double **);void backward_pass();void comp_err();void nettest();void reset_net();void getpars(char*);void initia(int, char*);void derivatives();void weight_update();void alloc();void alloc2(int, int);void alloc3(int);void set_sequence(double **, int **, char **, int, int);int get_data_sets(char *, int, char**, int*, char**, int, int[], char*);void shuffle(int*, int);void allocarrs(int, int);int seprand(int);/* arrays for protein random sequence */int *prand;int prot_current_idx; /* target class */int ispos;double *e, **ec, *eo, **es;FILE *ma; int positivetrain, positivetest, negativetrain, negativetest;#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -