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

? 歡迎來(lái)到蟲(chóng)蟲(chóng)下載站! | ?? 資源下載 ?? 資源專(zhuān)輯 ?? 關(guān)于我們
? 蟲(chóng)蟲(chóng)下載站

?? unh_cmac.c

?? 一個(gè)老外寫(xiě)的CMAC Neural Network源代碼和說(shuō)明
?? C
?? 第 1 頁(yè) / 共 3 頁(yè)
字號(hào):
/*                          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){

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久久国产一区二区三区四区小说 | 亚洲精选视频在线| 黑人精品欧美一区二区蜜桃| 亚洲人成7777| 欧美高清www午色夜在线视频| 国内成人免费视频| 免费看欧美美女黄的网站| 欧美mv和日韩mv的网站| 色欧美乱欧美15图片| 国产成人综合网站| 色偷偷88欧美精品久久久| 午夜精品免费在线| 国产精品嫩草影院av蜜臀| 欧美一级欧美三级| 成人夜色视频网站在线观看| 国产成人在线看| 国产成人精品一区二区三区四区| 日韩av不卡在线观看| 依依成人精品视频| 国产精品三级视频| 久久先锋资源网| 日韩美女视频在线| 91精品蜜臀在线一区尤物| 欧美最新大片在线看| 国产一区二区三区视频在线播放| 玉米视频成人免费看| 亚洲午夜激情av| 国精产品一区一区三区mba视频 | 亚洲色图一区二区| 日韩女优av电影| 久久久五月婷婷| 久久精品人人做人人爽97| 久久久久久夜精品精品免费| 国产精品不卡视频| 国产清纯在线一区二区www| 国产精品免费久久| 国产精品剧情在线亚洲| 亚洲免费伊人电影| 蜜桃av一区二区| 久久99国产精品麻豆| 亚洲444eee在线观看| 91免费视频大全| 91麻豆免费看片| 一区二区三区日韩精品视频| 一区二区欧美国产| 免费高清在线一区| 日韩一区和二区| 国产精品视频九色porn| 婷婷六月综合亚洲| 精品亚洲成a人在线观看| 色综合久久九月婷婷色综合| 337p亚洲精品色噜噜| 一区二区三区在线播| 久久av老司机精品网站导航| 成人性生交大合| 欧美三级三级三级爽爽爽| 成人免费在线视频观看| 亚洲精品免费在线观看| 成人开心网精品视频| 中文字幕亚洲综合久久菠萝蜜| 91丨九色丨蝌蚪富婆spa| 精品国产第一区二区三区观看体验| 亚洲高清视频中文字幕| 欧美色中文字幕| 国产欧美一区二区三区在线老狼| 成人午夜视频福利| 久久综合色婷婷| 精品无人码麻豆乱码1区2区| 26uuu亚洲综合色| 91尤物视频在线观看| 亚洲va国产天堂va久久en| 日韩欧美一区二区视频| 成人国产精品免费网站| 精品国产成人系列| 国产综合色产在线精品| 亚洲日本在线天堂| 欧美videofree性高清杂交| 亚洲色欲色欲www| 91久久香蕉国产日韩欧美9色| 亚洲国产精品久久不卡毛片| 国产精品污www在线观看| 99re8在线精品视频免费播放| 亚洲自拍都市欧美小说| 国产欧美精品一区aⅴ影院 | 亚洲一区二区免费视频| 欧洲一区二区三区在线| 成人精品一区二区三区四区| 亚洲精选一二三| 欧美国产欧美综合| 欧美私模裸体表演在线观看| 色欲综合视频天天天| 天天色图综合网| 欧美电影精品一区二区| 精品久久人人做人人爰| 久久久久九九视频| 日韩欧美国产精品一区| 91精品国产综合久久久久久漫画| 国产精品一区二区三区四区| 免费日韩伦理电影| 亚洲三级免费观看| 精品欧美久久久| 欧美一级片在线| 91精品国产欧美一区二区18| 精品美女在线观看| 美女视频黄 久久| 亚洲国产综合在线| 精品制服美女久久| 国产精品一卡二卡在线观看| 国产福利精品导航| 国产精品99久| 大胆欧美人体老妇| 国产高清久久久| 一区二区三区色| 麻豆成人在线观看| 日本黄色一区二区| 亚洲国产成人午夜在线一区| 成人欧美一区二区三区视频网页 | 99re在线精品| 一本久道中文字幕精品亚洲嫩| 国产69精品久久久久毛片| 色又黄又爽网站www久久| 亚洲精品一区二区三区蜜桃下载 | 成人性生交大片免费看中文| 9i在线看片成人免费| 亚洲精品在线免费观看视频| 日韩1区2区3区| 成人午夜视频免费看| av影院午夜一区| 久久香蕉国产线看观看99| 国产精品每日更新在线播放网址| 一区精品在线播放| 国产成人精品三级| 欧美系列一区二区| 2017欧美狠狠色| 日韩av一区二区三区四区| 欧美午夜影院一区| 亚洲午夜三级在线| 日韩一级视频免费观看在线| 午夜久久电影网| 91精选在线观看| 国产精品高潮呻吟久久| 国产成人aaa| 亚洲成人在线网站| 欧美日韩免费一区二区三区| 欧美午夜精品一区二区三区| wwww国产精品欧美| 亚洲妇熟xx妇色黄| 精品电影一区二区| 成人精品鲁一区一区二区| 日韩一区二区三区在线观看| 午夜精品久久久久久久久久| 91浏览器打开| 老司机午夜精品99久久| 久久麻豆一区二区| 国产精品系列在线播放| 偷拍日韩校园综合在线| 欧美精品一区二区三区蜜臀| 91老师片黄在线观看| 日韩影视精彩在线| 国产午夜三级一区二区三| 国产成人一区在线| 亚洲色大成网站www久久九九| 成人a免费在线看| 国产一区二区在线观看视频| 国产精品久久久久婷婷二区次| 色综合中文字幕国产| 国产欧美精品国产国产专区 | 国产99久久久国产精品潘金网站| 久久久久久久久久久99999| 国产91精品入口| 久久99精品久久只有精品| 中文字幕日韩精品一区| 欧美亚洲图片小说| 成人综合在线网站| 爽好久久久欧美精品| 中文子幕无线码一区tr| 欧美一级一区二区| 欧美制服丝袜第一页| 国产精品中文有码| 亚洲卡通动漫在线| 国产精品成人免费精品自在线观看 | 91一区二区在线观看| 国内精品第一页| 国产电影精品久久禁18| 成人免费精品视频| 中文字幕免费不卡在线| 久久精品人人做人人爽人人| 26uuu精品一区二区在线观看| 久久久久久**毛片大全| 欧美日韩国产系列| 精品国产伦一区二区三区观看体验| 欧美电影一区二区三区| 日韩一区二区在线免费观看| 欧美丰满一区二区免费视频| 制服丝袜一区二区三区| 精品国产一区二区在线观看| 国产欧美精品区一区二区三区| 久久久亚洲高清| 亚洲色图清纯唯美| 日韩精品国产欧美|