home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / misc / volume14 / back-prop / part03 / ibp.h next >
Encoding:
C/C++ Source or Header  |  1990-09-15  |  2.9 KB  |  67 lines

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