📄 mnc.h
字号:
/* mnc.h Most structures used in mnc code are declared here; this could be split into several bits, to avoid having to... .*//* nn ones are here */typedef struct { int per_row ; /* how many 1s to have per row eg 6 */ int changed ; /* how many rows got changed during the matrix creation */} sparse_cmatrix_param ; typedef struct {#include "dc_var_str.h" /* the big picture */ int MNC ; /* which code to use: 1,2,3,4 = MNC 1-4 MNC 1b is equivalent mathematically to MNC 1, so not available. if MNC = 0 then an M*N code as in MacKay 1995 is defined. Except an exact number per row can be invoked.*/ int N ; /* length of the unknown original vector s */ int M ; /* length of the transmitted vector t if not N */ /* the medium picture */ sparse_cmatrix_param pC1 , pC2 ; double fpol ; /* fraction of bits high in polynomial (not used) */ int npol ; double fs ; /* fraction in s */ double fn ; /* error probability on channel */ int ns ; /* if !0, number of signal bits */ int nn ; /* if !0, number of noise bits */ double true_fn ; /* actual fraction */ double true_fs ; /* actual fraction */ int tr ; /* typical number in row and column of code */ int tc ; double fte ; /* the details */ long int mseed ; /* seed for matrices in the code */ long int vseed ; /* seed for vectors */ /* customer relations */ int pbm_o ; /* whether to write the code matrix as a bit map */ int pbm_xv ; /* whether to xv it also */ char pbm_ofile[50] ; /* the pbm file */ int verbose ; /* whether the data creation process should be verbose */ int DEMO ; int message ; /* which message we are on */ int MESSAGE ; /* how many messages to send */ int failcount ; /* number of failed messages to stop after */ int failures ; /* number of failed messages to stop after - if 0, then keep going regardless */ int fe ; /* whether to use free energy optimization */ int usenet ; /* whether to use neural net for reconstruction */} data_creation_param ;typedef struct { unsigned char **A , **B , **C1 , **C2 , **C1I , **C2I ;} mnc_code ; typedef struct { unsigned char *r , *s , *so , *noise , *t , *u , *sno , *uo , *cr ; double ft , fte ; /* empirical fraction of bits in t high *//* extra vectors for the fe_min or neural net representation of things */ unsigned char *x , *y , *z ; unsigned char *xpartial , *xrecon , *zpartial ; int *touches ; /* scoring department */ int count , M , N ; } mnc_vectors ; /* BEGIN Only relevant to mnc3 */typedef struct {#include "nn_var_str.h" char outfileit[100] ; /* per iteration file name */ char reportfile[100] ; double alpha[4] ; double typ_input_sum ; double QW ; double EW[4] ; int ninrc[4] ; double ED ; /* data error */ double ET ; /* test error */ int EDH ; /* hard decision performance */ int EDHtr ; /* hard decision performance */ int EDHte ; /* hard decision performance */ int EHwb ; /* hard decision performance - whole block*/ int EHwb_tr ; /* hard decision performance - whole block */ int EHwb_te ; /* hard decision performance - whole block */ double M ; int iter ; int tot_tr ; int tot_te ; int tot_dec ; int loop ; int num_derivatives ; int num_forward_passes ; macopt_args macarg ;} mnc_net_control ; typedef struct { int K ; int I ; int O ; double *a ; /* activations of binary neurons */ double *ca ; /* complementary activations of binary neurons */ double *w ; /* weights (note the routines may have to use provided weight vector, during optimization); this w is repointed in the appropriate direction */ double *wo ; /* original and default weight vector. This is the one that is passed to optimizers. *//* NB take care to distinguish net->w and net->wo */ double *y ; double *g ; double *e ; unsigned char *x ; /* input and */ unsigned char *t ; /* target */ unsigned char *h ; /* hard output */ int *rc ; /* regularization classes */ int **wn ; /* weight numbers */ int *win ; /* weight numbers in 1d array */ double thresh ; } mnc_net ; /* END Only relevant to mnc3 */typedef struct { mnc_net *net ; mnc_net_control *nc ; data_creation_param *dc ; fe_min_param *p ; mnc_code *code ; fe_min_control *c ; fe_min_control *c2 ; /* added to mnc5 */ fe_min_control *c3 ; /* added to mnc5 */ int controller ; mnc_vectors *vec ; } mnc_all ;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -