home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / misc / volume14 / back-prop / part03 / rbp.h < prev   
Encoding:
C/C++ Source or Header  |  1990-09-15  |  3.1 KB  |  72 lines

  1. /* ***************************************************** */
  2. /* file rbp.h:  contains definitions for the rbp program */
  3. /*              that uses 64-bit floating point weights  */
  4. /*                                                       */
  5. /* Copyright (c) 1990 by Donald R. Tveter                */
  6. /*                                                       */
  7. /* *******************************************************/
  8.  
  9. #define maxformat 21
  10. #define buffsize 257
  11.  
  12. #define WTTYPE double         /* 64-bit floating point */
  13. #define WTSIZE 8              /* reals uses 8 bytes */
  14. #define HCODE -32768          /* code number for a layer h (2) unit */
  15. #define ICODE -32767          /* code number for a layer i (3) unit */
  16. #define JCODE -32766          /* code number for a layer j (4) unit */
  17. #define KCODE -32765          /* code number for a layer k (5) unit */
  18. #define GT 0                  /* a symbol meaning > */
  19. #define GE 1                  /* a symbol meaning >= */
  20. #define scale(x) x            /* scale not used in real version */
  21. #define unscale(x) x          /* unscale not used in real version */
  22. #define unscaleint(x) x       /* unscaleint not used in real version */
  23.  
  24. typedef struct patnode
  25.    {
  26.      WTTYPE val;              /* input or output pattern */
  27.      struct patnode *next;    /* pointer to next node */
  28.    } PATNODE;
  29. typedef struct patlist
  30.    {
  31.      int bypass;              /* number of times to bypass pattern */
  32.      PATNODE *pats;           /* the list of patterns */
  33.      struct patlist *next;    /* the next pattern */
  34.    } PATLIST;
  35. typedef struct unit
  36.    {
  37.      short layernumber;       /* layer number of the unit */
  38.      short unitnumber;        /* position within layer */
  39.      double error;            /* to sum error factors */
  40.      WTTYPE oj;               /* state of activation of node */
  41.      WTTYPE tj;
  42.      struct unit *wtlist;     /* to list of weights to prev layer */
  43.      struct unit *next;       /* link to next unit in this layer */
  44.    } UNIT;
  45.  
  46. typedef struct wtnode
  47.    {
  48. #ifdef SYMMETRIC
  49.      WTTYPE *weight;          /* weight from here to backunit */
  50.      WTTYPE *olddw;           /* delta wji from previous iteration */
  51.      WTTYPE *total;           /* total of changes for batch updates */
  52.      WTTYPE *eta;             /* the eta of the DBD method */
  53. #else
  54.      WTTYPE weight;           /* weight from here to backunit */
  55.      WTTYPE olddw;            /* delta wji from previous iterataion */
  56.      WTTYPE total;            /* total of changes for batch updates */
  57.      WTTYPE eta;              /* the eta of the DBD method */
  58. #endif
  59.      struct wtnode *next;     /* link to next node */
  60.      struct UNIT *backunit;   /* ptr to unit the weight comes from */
  61.    } WTNODE;
  62.  
  63. typedef struct layer
  64.    {
  65.      int unitcount;           /* number of units in this layer */
  66.      struct layer *backlayer; /* pointer to previous layer */
  67.      struct layer *next;      /* pointer to next layer */
  68.      struct UNIT *units;      /* start of list of units in this layer */
  69.      PATLIST *patstart;       /* to the list of patterns */
  70.      PATLIST *currentpat;     /* the current pattern */
  71.    } LAYER;
  72.