亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? unh_cmac.c

?? 一個老外寫的CMAC Neural Network源代碼和說明
?? C
?? 第 1 頁 / 共 3 頁
字號:
/*                          unh_cmac.c	Copyright c 1989, 1990, 1994, 1995, 1996 The University of New 	Hampshire. All rights reserved.	This module is a C language implementation of a multiple	CMAC driver. It includes multiple (and programmable) designs for	the receptive field lattice and the receptive field sensitivity	functions. It was developed in the Robotics Laboratory of the 	Department of Electrical and Computer Engineering at the 	University of New Hampshire. This C source code is not available 	for sale from UNH, and can not be resold. You may use it, and 	give it away freely to others, as long as you, and those you 	give it to, agree to acknowledge the UNH Robotics Laboratory in 	any project reports, manuscripts, software manuals, etc., 	which result from projects which utilize this code.	The code is generic C, but has only been tested at UNH using	Microsoft C compilers for the IBM-PC family. It assumes 32 bit	integer data types. You should check the following functions for 	compatibility with your compiler:	    malloc() - allocate data region of size specified in bytes.	    free()   - deallocate data region.	    rand()   - return random integer in range 0 - 32767.    Also, you should check the list of header files <*.h> since	these may be different for your environment.    MAJOR MODIFICATIONS    ** Modified 7-3-92 to handle compiler variations in modulo (%)    function for negative values.        ** Modified 6-xx-94 to handle various receptive field lattices and     function shapes, collision avoidance hashing, and weight     normalization.    */#include <stdlib.h>#include <fcntl.h>#include <io.h>#include <sys\stat.h>#include <malloc.h>#include "unh_cmac.h"#define TRUE  1#define FALSE  0/* *************************************************************************************************************************************************The following definitions affect static data storage size, but NOT execution time.**************************************************************************//* Set this to the maximum number of independent CMACs you will need */#define NUM_CMACS 8/* Set this to the maximum number of input dimensions you will need */#define MAX_STATE_SIZE 64 /* Set this to the maximum number of output dimensions you will need */#define MAX_RESPONSE_SIZE 8 /* Set this to the maximum number of layers of receptive fields you will need */#define MAX_GEN_SIZE 256 /* Set this to the size of the receptive field function table you will use */#define RF_TABLE_SIZE 128 /* ************************************************************************/************************************************************************** The following store the major specs and pointers for the current CMAC**************************************************************************/static int first_call = TRUE; 	/* is set to FALSE after init      */static int in_learn = FALSE;	/* is set to TRUE while in learn  */static int *ap_a[NUM_CMACS+1]; /* pointers to all cmac memories   */static int *ap;                /* pointer to current cmac memory  */static int ap_size[NUM_CMACS+1]; /* sizes in bytes of cmac memories */static int rsp_size;          	/* dimension of response vector    */static int gen_size;          	/* generalization parameter        */static int st_size;           	/* dimension of input state vector */static int mem_size;          	/* # of response vectors in memory */ static int rf_shape;			/* code for the receptive field shape */static int collide;			/* TRUE/FALSE control of hash collisions */static int *qnt;               /* pointer to input quantization   */static int *disp;				/* pointer to the displacement vector */static int *rfieldt;			/* pointer to the rfield function table */static unsigned int rndseq[2048]; /* Random number table for hashing */static unsigned int rndseq2[2048]; /* Random number table for hashing */static int indexes[MAX_GEN_SIZE]; /* CMAC mapping indexes            */static long rfield[MAX_GEN_SIZE]; /* RF function magnitudes */static long sum_rfield  = 0;	/* summed RF function magnitudes */static long sum2_rfield = 0;   /* summed squared RF function magnitudes *//* ********************************************************************* *//**************************************************************************The following functions are used internally by the CMAC code and can notbe called externally! **************************************************************************//*************************************************************************** *      stoap()                                                            * *                                                                         * *      Input:          state[]                                            * *      Output:         indexes[]                                          * *                                                                         * *      Purpose:        Map from input vector, state[], to corrosponding   * *                      output cells in ap[]. The active output cells      * *                      are indexed by indexes[]                           * *                                                                         * ***************************************************************************/static void stoap(int *state){	int i, j, k;	long index, min_d, test_d, rf_index;	long sum;	int hash_tag;	static long base[MAX_STATE_SIZE], qstate[MAX_STATE_SIZE];	/* the following code is for constant RF functions */	if ((rf_shape == ALBUS) || (rf_shape == RECTANGULAR)) {			/* get quantized input */				for (i = 0; i < st_size; i++) {			if (state[i] >= 0) {				qstate[i] = state[i] / qnt[i];			} else {				qstate[i] = (state[i] - qnt[i] + 1) / qnt[i];			}			base[i] = 0; /* first RF layer aligned with origen */		}		/* compute a new hashed RF index for each RF layer */	    for (j = 0; j < gen_size; j++) {					sum = 0;			hash_tag = 0;			 			/* loop over all dimensions of this RF */		    for(i = 0; i < st_size; i++) {		    	/* find corner coordinate of excited RF in quantized space */ 		    	if (qstate[i] >= base[i])	        		index = qstate[i] - ((qstate[i] - base[i]) % gen_size);	        	else    				index = (qstate[i] + 1) + ((base[i] - (qstate[i] + 1)) % gen_size) - gen_size;	        	/* add random table offset for this dimension and wrap around */			 	index += (449 * i);	            index %= 2048;	            while (index < 0) index += 2048;						/* add selected random number to sum */			 	sum += (long)rndseq[(int)index];			 	if (!collide) hash_tag += (int)rndseq2[(int)index];				 				 	/* compute displacement of next RF layer in quantized space */			 	base[i] += disp[i];			}			if (hash_tag == 0) hash_tag = 1;				    /* compute psuedo-random index */		    indexes[j] = (int)(sum % mem_size);		    while (indexes[j] < 0) indexes[j] += mem_size; 		    		    /* now search for hash tag match or open slot */		    if (!collide) {				--indexes[j];				k = 0;			    i = (indexes[j] * (rsp_size + 1)) + rsp_size;			    do {			    	if (++indexes[j] >= mem_size) {			    		indexes[j] = 0;			    		i = rsp_size;			    	} else {			    		i += rsp_size + 1;			    	}				} while ((ap[i] != hash_tag) && (ap[i] != 0) && (++k < mem_size));			} else {			    i = (indexes[j] * (rsp_size + 1)) + rsp_size;			}			/* mark used memory location */	    			if ((in_learn) && (ap[i] == 0)) ap[i] = hash_tag;  	    		}		return;	}	/* the following code is for tapered RF functions */	/* get quantized input */		for (i = 0; i < st_size; i++) {		if (state[i] >= 0) {			qstate[i] = (long)(state[i] / qnt[i]);		} else {			qstate[i] = (long)((state[i] - qnt[i] + 1) / qnt[i]);		}		base[i] = 0; /* first RF layer aligned with origen */	}	/* init RF function sums */		sum_rfield = 0;	sum2_rfield = 0;	/* compute a new hashed RF index for each RF layer */    for (j = 0; j < gen_size; j++) {			sum = 0;		hash_tag = 0;		min_d = (long)1 << ((8 * sizeof(long)) - 2);				/* loop over all dimensions of this RF */	    for (i = 0; i < st_size; i++) {	    	/* find corner coordinate of excited RF in quantized space */ 	    	if (qstate[i] >= base[i])        		index = qstate[i] - ((qstate[i] - base[i]) % gen_size);        	else    			index = (qstate[i] + 1) + ((base[i] - (qstate[i] + 1)) % gen_size) - gen_size;			 	            /* update physical distance to closest side of RF,                and index into RF function table */            test_d = (long)state[i] - (index * (long)qnt[i]);            if (test_d < min_d) {            	min_d = test_d;            	rf_index = (RF_TABLE_SIZE * min_d) / ((gen_size * qnt[i]) >> 1);            }            test_d = (((long)gen_size + index) * (long)qnt[i]) - state[i] - 1;            if (test_d < min_d) {            	min_d = test_d;            	rf_index = (RF_TABLE_SIZE * min_d) / ((gen_size * qnt[i]) >> 1);            }	                    	/* add table offset for this dimension and wrap around */		 	index += (449 * i);            index %= 2048;            while (index < 0) index += 2048;				/* add selected random number to sum */		 	sum += (long)rndseq[(int)index];			if (!collide) hash_tag += (int)rndseq2[(int)index];		 	/* compute displacement of next RF layer in quantized space */		 	base[i] += disp[i];		}		if (hash_tag == 0) hash_tag = 1;		    /* compute psuedo-random index */	    indexes[j] = (int)(sum % mem_size);	    while (indexes[j] < 0) indexes[j] += mem_size;	    /* now search for hash tag match or open slot */		if (!collide) {			--indexes[j];			k = 0;		    i = (indexes[j] * (rsp_size + 1)) + rsp_size;		    do {		    	if (++indexes[j] >= mem_size) {		    		indexes[j] = 0;		    		i = rsp_size;		    	} else {		    		i += rsp_size + 1;		    	}			} while ((ap[i] != hash_tag) && (ap[i] != 0) && (++k < mem_size));		} else {		    i = (indexes[j] * (rsp_size + 1)) + rsp_size;		}		/* mark used memory location */	    		if ((in_learn) && (ap[i] == 0)) ap[i] = hash_tag;  	    /* update RF function parameters */	    if (rf_index >= RF_TABLE_SIZE) rf_index = RF_TABLE_SIZE - 1;	    rfield[j] = rfieldt[rf_index];	    sum_rfield += rfieldt[rf_index];	    sum2_rfield += ((long)rfieldt[rf_index] * (long)rfieldt[rf_index]);	}}/*************************************************************************** *      setup()                                                            * *                                                                         * *      Input:          cmac_id                                            * *      Output:         ap, st_size, rsp_size, gen_size, mem_size, qnt     * *                                                                         * *      Purpose:        Get parameters for current CMAC                    * *                                                                         * ***************************************************************************/static void setup(int cmac_id){	ap = ap_a[cmac_id];     /* pointer to cmac storage         */	st_size = *ap++;        /* size of input state vector      */	rsp_size = *ap++;       /* dimension of response vector    */	gen_size = *ap++;       /* generalization parameter        */	mem_size = *ap++;       /* # of response vectors in memory */	rf_shape = *ap++;		/* receptive field code 		   */	collide = *ap++;		/* allow hashing collisions	???    */	qnt = ap;               /* pointer to quantization vector  */	ap += st_size;	disp = ap;				/* pointer to displacement vector  */	ap += st_size;	rfieldt = ap;			/* pointer to rf function table    */	ap += RF_TABLE_SIZE;	/* pointer to CMAC weights         */  		}/*************************************************************************** *      genmap()                                                           * *                                                                         * *      Input:          none                                               * *      Output:         rndseq[]                                           * *                                                                         * *      Purpose:        Initialize random lookup table array               * *                                                                         * ***************************************************************************/static void genmap(void){	int i, k;	/* make sure that same random hashing always used */	/* (necessary if CMAC weights saved from day-to-day) */ 	srand(1);	/* random table for address hashing */	for(k = 0; k < 2048; k++) {		rndseq[k] = 0;		for (i=0; i<sizeof(int); ++i)	    	rndseq[k] = (rndseq[k] << 8) | (rand() & 0xff);    	}	/* random table for collision avoidance tags */	for(k = 0; k < 2048; k++) {		rndseq2[k] = 0;		for (i=0; i<sizeof(int); ++i)	    	rndseq2[k] = (rndseq2[k] << 8) | (rand() & 0xff);    	}}/*************************************************************************** *      init_disp_vector()                                                 * *                                                                         * *      Input:          num_state, field_shape                             * *      Output:         dv[]                                               * *                                                                         * *      Purpose:        Initialize lattice displacement vector             * *                                                                         * ***************************************************************************/static void init_disp_vector(int dv[], int num_state, int field_shape){

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
91视频在线观看免费| 国产精品影视网| 亚洲男人电影天堂| 亚洲三级免费电影| 一区二区三区国产豹纹内裤在线| 亚洲婷婷国产精品电影人久久| 中文字幕第一区| 亚洲品质自拍视频网站| 亚洲综合丝袜美腿| 亚洲国产日韩综合久久精品| 亚洲成人午夜电影| 麻豆成人综合网| 国产精品原创巨作av| 91香蕉视频mp4| 欧美亚洲国产一区二区三区 | 国产丝袜在线精品| 欧美国产精品中文字幕| 亚洲日本在线观看| 天天操天天干天天综合网| 丝袜诱惑制服诱惑色一区在线观看 | 国产精品午夜在线观看| 中文字幕一区二区三区色视频| 国产精品日产欧美久久久久| 亚洲男人天堂av网| 蜜臀av国产精品久久久久| 国产一区二区美女| 91视频观看免费| 欧美大片顶级少妇| 综合久久久久久| 日韩黄色在线观看| 成人av免费在线观看| 欧美精品在线视频| 日本一区二区免费在线观看视频| 一区二区三区中文在线| 久久精品国产网站| 在线观看国产精品网站| 日韩免费观看2025年上映的电影| 国产精品乱码人人做人人爱| 婷婷成人激情在线网| 国v精品久久久网| 91精品综合久久久久久| 国产精品美女一区二区三区| 亚洲大片免费看| bt7086福利一区国产| 欧美一区二区播放| 亚洲视频综合在线| 国产精选一区二区三区| 在线播放日韩导航| 中文字幕在线免费不卡| 久久99这里只有精品| 欧美日韩亚洲不卡| 亚洲黄色av一区| 国产成人精品网址| 日韩美女在线视频| 亚洲国产综合在线| 99国产精品国产精品久久| 精品国产百合女同互慰| 日本伊人色综合网| 欧美亚洲国产bt| 亚洲视频综合在线| 99精品国产99久久久久久白柏| 日韩三级精品电影久久久| 日韩综合在线视频| 欧美日韩精品综合在线| 夜夜精品视频一区二区| 9人人澡人人爽人人精品| 国产亚洲成av人在线观看导航 | 日韩欧美二区三区| 日本不卡一二三| 欧美一区二区三区在| 亚洲一区在线观看网站| 欧美中文字幕不卡| 一区二区三区日韩欧美| 色美美综合视频| 日韩一区中文字幕| 色狠狠色噜噜噜综合网| 一区二区在线观看免费视频播放 | 婷婷六月综合亚洲| 欧美日韩一区高清| 亚洲国产aⅴ天堂久久| 欧美日韩国产综合久久| 亚洲18女电影在线观看| 日韩亚洲欧美一区| 国内精品伊人久久久久影院对白| 精品国产91洋老外米糕| 国产91富婆露脸刺激对白| 国产精品你懂的| 色88888久久久久久影院野外| 亚洲精品国产a| 在线不卡一区二区| 国产乱子轮精品视频| 欧美激情一区三区| 欧美中文字幕亚洲一区二区va在线| 亚洲精品大片www| 亚洲综合色噜噜狠狠| 欧美日韩日本视频| 日本亚洲三级在线| 国产亚洲欧美日韩日本| 99久久婷婷国产综合精品电影 | 成人小视频在线| 亚洲精品国久久99热| 91精品国产综合久久久久久久| 久久99久久99| 日韩美女啊v在线免费观看| 欧美午夜理伦三级在线观看| 日韩av不卡在线观看| 亚洲国产精品国自产拍av| 在线视频中文字幕一区二区| 蜜桃av噜噜一区| 国产嫩草影院久久久久| 欧美亚洲高清一区二区三区不卡| 视频一区视频二区中文| 久久久久久日产精品| 欧美最猛性xxxxx直播| 国产又黄又大久久| 性做久久久久久| 国产精品污www在线观看| 欧美男男青年gay1069videost| 黄色日韩三级电影| 一区二区三区中文字幕电影 | 在线观看亚洲成人| 国产在线视频一区二区| 亚洲3atv精品一区二区三区| 国产精品乱码一区二三区小蝌蚪| 91精品国产综合久久蜜臀| 91丨国产丨九色丨pron| 九一久久久久久| 亚洲成人7777| 亚洲视频每日更新| 久久久久久一二三区| 欧美一级黄色片| 欧美久久一区二区| 91污片在线观看| 成人一区二区三区在线观看| 极品少妇xxxx偷拍精品少妇| 婷婷开心激情综合| 亚洲狠狠爱一区二区三区| 最好看的中文字幕久久| 久久久久久久久99精品| 日韩免费在线观看| 欧美一级片在线| 欧美日本韩国一区二区三区视频| 99久久久久久99| aaa亚洲精品| 成人av动漫网站| 99精品在线观看视频| 成人av在线网站| 99久久99久久精品免费看蜜桃| 国产精品91xxx| 国产乱人伦精品一区二区在线观看| 日本视频中文字幕一区二区三区| 亚洲高清免费视频| 亚洲成人先锋电影| 水蜜桃久久夜色精品一区的特点| 亚洲gay无套男同| 天堂久久一区二区三区| 日本少妇一区二区| 六月丁香综合在线视频| 老色鬼精品视频在线观看播放| 久久精品国产99| 国产激情91久久精品导航 | 免费人成精品欧美精品 | 精品国产青草久久久久福利| 91精品国产综合久久福利| 欧美精品久久久久久久多人混战| 88在线观看91蜜桃国自产| 51久久夜色精品国产麻豆| 欧美一级高清片| 久久久久久久综合色一本| 国产精品二区一区二区aⅴ污介绍| 一区二区中文视频| 亚洲成人免费电影| 久草在线在线精品观看| 国产成人精品免费| 在线观看日韩毛片| 日韩欧美卡一卡二| 国产女人水真多18毛片18精品视频| 自拍偷拍亚洲激情| 日韩国产精品久久久久久亚洲| 伦理电影国产精品| 99视频精品全部免费在线| 欧美最猛性xxxxx直播| 欧美大胆一级视频| 国产精品久久久久影院| 亚洲国产精品一区二区www在线| 日韩高清不卡一区二区| 国产精品综合一区二区三区| 91久久精品一区二区三区| 欧美α欧美αv大片| 亚洲欧美偷拍另类a∨色屁股| 久久伊人中文字幕| 亚洲18女电影在线观看| 国产91精品久久久久久久网曝门| 精品视频一区二区不卡| 国产日韩欧美综合在线| 午夜精品一区二区三区免费视频| 成人高清视频免费观看| 678五月天丁香亚洲综合网| 国产精品网站在线观看| 麻豆精品在线看|