⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 art_def.h

📁 自适应共振神经网络可以实现自动学习与分类具有自适应的功能
💻 H
字号:
/* ------------------------------------------------------------------------- */
/*                           The ART Gallery                                 */
/* ------------------------------------------------------------------------- */
/* Art_Def.h                                                                 */
/*    Version:     1.0                                                       */
/*    Written By:  Lars H. Liden         laliden@cns.bu.edu                  */
/*    Last Update: 8/02/95                                                   */
/*                                                                           */
/* The following code contains constant definitions, and structures for the  */
/* neural network and pattern set.                                           */
/*                                                                           */
/* Please see Art_Doc.txt for a full documentation.                          */
/*                                                                           */
/* Send all bug reports to laliden@cns.bu.edu                                */
/* ------------------------------------------------------------------------- */

#include <math.h>
#include <stdio.h>
#include <stddef.h> 
#include <stdlib.h> 
#include <stdarg.h>
#include <string.h>
#include <errno.h>

#define TRUE              5571  /* An unlikely number */
#define FALSE             0
#define ALPHA             0.1
#define ART               0
#define ARTA              1
#define ARTB              2
#define ARTMAP            1
#define NONE              0
#define ART1              1
#define FUZZYART          2
#define COMPLIMENT        1
#define BINARY            1
#define ANALOG            2

#define MAX               25


/* ========================================================================= */
/*                        Neural Network Structures                          */
/* ========================================================================= */

/*---------------------------------------------------------------------------*/
/*                         Art Network Structure                             */
/*---------------------------------------------------------------------------*/
typedef struct {
  int     type;           /* ART1, FUZZYART, NONE                            */
  int     style;          /* NONE or COMPLIMENT                              */
  int     num_inputs;     /* Number of inputs to the network                 */
  int     nodes_used;     /* Num. of category nodes actually used            */
  int     max_nodes;      /* Current number of allocated category nodes      */

  float   beta;           /* Recoding rate.  No recoding (default) when 1    */
  float   vigil;          /* Current vigilence level                         */

  int     num_reset;      /* Number of resets during last input presentation */
  int     win_cat;        /* Winning category for last input presenation     */

  float   *cat;           /* Activation  of category node   (size max_nodes) */
  float   *elig;          /* Eligibility of category node   (size max_nodes) */
  int     *commit;        /* Commitment  of category node   (size max_nodes) */
  float   **weight;       /* Weights intput->cat (size num_inputs*max_nodes) */
  float   *sum_weights;   /* Sum of weights for each nodes  (size max_nodes) */
  float   *sum_IW;        /* Intesection weights and inputs (size max_nodes) */

} artTYPE, *artPTR;

/*---------------------------------------------------------------------------*/
/*                        ArtMap Network Structure                           */
/*---------------------------------------------------------------------------*/
typedef struct {
  float   vigil;          /* Current mapfield vigilence level                */
  float   base_vigil;     /* Base vigilence level for the ArtA Network       */

  int     num_mismatch;   /* Number of mismatches during an presentation     */

  artTYPE artA;           /* ArtA - Input art network                        */
  artTYPE artB;           /* ArtB - Output art network                       */

  int     maxA_nodes;     /* Maximum number of allocated ArtA nodes          */
  int     maxB_nodes;     /* Maximum number of allocated ArtB nodes          */

  float   *map;           /* Activation values of the mapfield (size B)      */
  float   **map_weight;   /* weights from A nodes to mapfield  (size A x B)  */

} mapTYPE, *mapPTR;

/*---------------------------------------------------------------------------*/
/*                       General Network Structure                           */
/*---------------------------------------------------------------------------*/
typedef struct {
  int     initB;          /* Has the network been initialized - BOOLEAN    */
  int     checkB;         /* Has the net been tested against the set       */
  int     doneB;          /* Is the network done with recent training      */
  int     type;           /* ART, ARTMAP                                   */
  int     num_inputs;     /* Number of inputs to the network               */
  int     num_outputs;    /* Number of outputs from the network            */
  artTYPE art;            /* Art Network   - only used if type ART         */
  mapTYPE map;            /* Mapping Field - only used if type ARTMAP      */

  /* Some history about network training */
  int     num_patterns;   /* Number of training presentations so far       */
  int     num_epochs;     /* Number of training epochs so far              */

} netTYPE, *netPTR;


/* ========================================================================= */
/*                            Pattern Structure                              */
/* ========================================================================= */

/*---------------------------------------------------------------------------*/
/*                         Single Pattern Structure                          */
/*---------------------------------------------------------------------------*/
typedef struct {
  float       *input;     /* Vector of input patterns   (size num_inputs)  */
  float       *output;    /* Vector out output patterns (size num_outputs) */
} patTYPE,    *patPTR;

/*---------------------------------------------------------------------------*/
/*                           Pattern Set Structure                           */
/*---------------------------------------------------------------------------*/
typedef struct {
  int         initB;            /* Has the set been initialized - BOOLEAN  */
  int         checkB;           /* Has the set been tested against the net */
  int         max_num_patterns; /* Total space allocated for patterns      */
  int         num_patterns;     /* Current number of patterns in the set   */
  int         num_inputs;       /* Size of input patterns                  */
  int         type_inputs;      /* BINARY or ANALOG                        */
  int         style_inputs;     /* Are inputs currently compliment coded   */
  int         num_outputs;      /* Size of output patterns                 */
  int         type_outputs;     /* BINARY, ANALOG or NONE                  */
  int         style_outputs;    /* Are inputs currently compliment coded   */
  patTYPE     *pattern;         /* Individual patterns (size max_num_pat)  */
} setTYPE, *setPTR;


⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -