📄 execute_act.c
字号:
/* * $Id: execute_act.c 1272 2007-05-09 16:26:20Z mhe $ */#include <stdio.h>#include <stdlib.h>#include "lstm.h"#include "execute_act.h"void execute_act() { int len; //,i,j,k; len = length[prand[prot_current_idx]] - 1; if (element < len) { targ = 0; return; } /* last element of sequence */ if (element == len) { targ = 1; /* weight update after each sequence? */ if (w_up==1) { weight_up=1; } if (tar[prand[prot_current_idx]]) { target = targetvalue0; } else { target = targetvalue1; } return; } //fclose(ma); /* end of an epoch ? */ if (prot_current_idx == training_size - 1) { double fnp = (positivetrain) ? (double) class_err / (double) positivetrain * 100 : 0; double fpp = (negativetrain) ? (double) classnon_err / (double) negativetrain * 100 : 0; fprintf(stderr, "train epoch: %d mse:%.6f fn:%.1f%% fp:%.1f%%\n", epoch+1, epoch_err/(training_size), fnp, fpp); /* MSE and misclassifications output for training set */ output_epoch(positivetrain, negativetrain); /* weight update after every epoch */ weight_up=0; weight_update(); /* write weight matrix */ if (epoch%w_out==0) { weight_out(W); } /* performing a test on a test set? */ if ((epoch + 1) % test_aus == 0) { reset_net(); prot_current_idx = 0; set_sequence(inp_t, inp_idx_t, aaSym_t, length_t[0], 0); nettest(); reset_net(); seq_cor=1; seq_err=0; } /* first sequence in the training set */ example = 0; /* counting the epochs */ epoch++; /* resetting the error per epoch */ epoch_err = 0; /* resetting the misclassifications per epoch */ class_err = 0; classnon_err = 0; /* first protein */ shuffle(prand, training_size); prot_current_idx = 0; } else { prot_current_idx++; } /* first element in a sequence */ element=0; /* counting the number of sequences the net has seen */ numb_seq++; /* resetting the error for the current sequence */ seq_cor=1; /* resetting the error per sequence */ seq_err=0; /* reset after each sequence? */ if (sequ_reset==1) { reset_net(); } set_sequence(inp, inp_idx, aaSym, length[prand[prot_current_idx]], prand[prot_current_idx]); targ = 0;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -