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

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

?? procedure.cpp

?? 專家系統-神經網絡代碼
?? CPP
?? 第 1 頁 / 共 3 頁
字號:
		break;

	case 1:
		cMatrixOutputLayerOutput = cMatrixOutputLayerPureInput.tanh ();
		break;

	case 2:
		cMatrixOutputLayerOutput = cMatrixOutputLayerPureInput.Tansig ();
		break;

	default:
		return ;
	}

	matrixOutputLayerOutput.CopyMatrix(cMatrixOutputLayerOutput);

}

/////////////////////////////////////////////////////////////////////////////
//	Back propagation		---->		前向計算(Only for Simulating)	   //
/////////////////////////////////////////////////////////////////////////////
__declspec(dllexport) void BPForwardCalculate2( int nInputLayerNumber,
												int nHideLayerNumber,
												int nOutputLayerNumber,
												bool bSimulateDataFlag,
												int nComboFunc,
												CMatrix &matrixDemoDataInput,
												CMatrix &matrixInputLayerValue,
												CMatrix &matrixInputToHideWeightValue,
												CMatrix &matrixHideLayerValveValue,
												CMatrix &matrixHideLayerOutput,
												CMatrix &matrixHideToOutputWeightValue,
												CMatrix &matrixOutputLayerOutput,
												CMatrix &matrixOutputLayerValveValue
											   )
{

	if(bSimulateDataFlag)
	{

		CMatrix cMatrixInputLayerValue(matrixDemoDataInput.GetMatrixRowNumber (), nInputLayerNumber);

		// 得到樣本的輸入值
		matrixDemoDataInput.CopySubMatrix (cMatrixInputLayerValue, (unsigned int)0, (unsigned int)0);

		CMatrix cMatrixTInputLayerValue = cMatrixInputLayerValue.Transpose ();

		matrixInputLayerValue.CopyMatrix (cMatrixTInputLayerValue);


	}

	/////////////////////////////////////////////////////////////////////////
	// 得到所有樣本的隱含層的凈輸入
	// 構造規則:
	//		1. 樣本的數目做為矩陣行數;
	//		2. 單個樣本的隱含層的數目做為矩陣的列數;
	//		3. 矩陣元素中的值即為對應的樣本的隱含層的凈輸入:
	//		   由 
	//				cMatrixInputLayerValue * cMatrixInputToHideWeightValue 
	//				+ cMatrixHideLayerValveValue
	//			得到.
	//
		
	CMatrix cMatrixExHideLayerValveValue;
	cMatrixExHideLayerValveValue.nncpyi (matrixHideLayerValveValue, matrixDemoDataInput.GetMatrixRowNumber ());

	CMatrix cMatrixHideLayerPureInput(nHideLayerNumber, matrixDemoDataInput.GetMatrixRowNumber ());

	cMatrixHideLayerPureInput = matrixInputToHideWeightValue * matrixInputLayerValue;

	cMatrixHideLayerPureInput += cMatrixExHideLayerValveValue;


	/////////////////////////////////////////////////////////////////////
	//	算出所有樣本的隱含層的輸出
	//	構造規則:
	//		1. 隱含層的輸出y與隱含層的輸入x的關系可用函數表示
	//			y = f(x)
	//		2. 矩陣的維數和隱含層的凈輸入矩陣的維數相等
	//

	CMatrix cMatrixHideLayerOutput(nHideLayerNumber, matrixDemoDataInput.GetMatrixRowNumber ());

	switch(nComboFunc)
	{
	case 0:
		cMatrixHideLayerOutput = cMatrixHideLayerPureInput.Sigmoid ();
		break;

	case 1:
		cMatrixHideLayerOutput = cMatrixHideLayerPureInput.tanh ();
		break;

	case 2:
		cMatrixHideLayerOutput = cMatrixHideLayerPureInput.Tansig();
		break;

	default:
		return;
	}
	
	matrixHideLayerOutput.CopyMatrix(cMatrixHideLayerOutput);

	/////////////////////////////////////////////////////////////////////
	//	得到所有樣本輸出層的凈輸入
	//	構造規則;
	//		1. 樣本的數目做為矩陣的行數;
	//		2. 單個樣本的輸出層的數目做為矩陣的列數;
	//		3. 矩陣中元素的值即為對應樣本的輸出層的凈輸入:
	//			由
	//				cMatrixHideLayerOutput * cMatrixHideToOutputWeightValue
	//				+ cMatrixOutputLayerValveValue
	//			得到
	//

	CMatrix cMatrixExOutputLayerValveValue;
	cMatrixExOutputLayerValveValue.nncpyi (matrixOutputLayerValveValue, matrixDemoDataInput.GetMatrixRowNumber ());

	CMatrix cMatrixOutputLayerPureInput(nOutputLayerNumber, matrixDemoDataInput.GetMatrixRowNumber ());

	cMatrixOutputLayerPureInput = matrixHideToOutputWeightValue * cMatrixHideLayerOutput;
	cMatrixOutputLayerPureInput  += cMatrixExOutputLayerValveValue;


	/////////////////////////////////////////////////////////////////////
	//	算出所有樣本的輸出層的輸出
	//	構造規則:
	//		1. 矩陣的維數與得到的所有樣本的輸出層的凈輸入組成的矩陣一樣;
	//		2. 輸出層的輸出y和輸出層的輸入可用關系式
	//			y = f(x)
	//		表示
	//

	CMatrix cMatrixOutputLayerOutput(nOutputLayerNumber, matrixDemoDataInput.GetMatrixRowNumber ());

	switch(nComboFunc)
	{
	case 0:
		cMatrixOutputLayerOutput = cMatrixOutputLayerPureInput.Sigmoid ();
		break;

	case 1:
		cMatrixOutputLayerOutput = cMatrixOutputLayerPureInput.tanh ();
		break;

	case 2:
		cMatrixOutputLayerOutput = cMatrixOutputLayerPureInput.Tansig ();
		break;

	default:
		return ;
	}

	matrixOutputLayerOutput.CopyMatrix(cMatrixOutputLayerOutput);

}

/////////////////////////////////////////////////////////////////////////////
//	Back propagation		---->		反饋計算						   //
/////////////////////////////////////////////////////////////////////////////
__declspec(dllexport) bool BPDemoDataTrainRepeat (	int nInputLayerNumber,
													int nHideLayerNumber,
													int nOutputLayerNumber,
													bool bSimulateDataFlag,
													int nComboFunc,
													double nSystemErrorOld,
													double nSystemErrorNew,
													double nSystemErrorLevel,
													double nSystemError,
													double nStep,
													UINT nMaxTrainTimes,
													UINT nTrainTimes,
													DWORD ID_SYSTEM_ERROR,
													DWORD ID_TRAIN_TIMES,
													HWND  hWnd,
													CMatrix &matrixDemoDataInput,
													CMatrix &matrixInputLayerValue,
													CMatrix &matrixInputToHideWeightValue,
													CMatrix &matrixHideLayerValveValue,
													CMatrix &matrixHideLayerOutput,
													CMatrix &matrixHideToOutputWeightValue,
													CMatrix &matrixOutputLayerOutput,
													CMatrix &matrixOutputLayerValveValue
												 )
{
	// 根據BP算法修正nStep的初始值
	nStep = 0.1;

	// 前向計算
	LMForwardCalculate (nInputLayerNumber,
						nHideLayerNumber,
						nOutputLayerNumber,
						bSimulateDataFlag,
						nComboFunc,
						matrixDemoDataInput,
						matrixInputLayerValue,
						matrixInputToHideWeightValue,
						matrixHideLayerValveValue,
						matrixHideLayerOutput,
						matrixHideToOutputWeightValue,
						matrixOutputLayerOutput,
						matrixOutputLayerValveValue
						);
		

	/////////////////////////////////////////////////////////////////////
	//	算出所有樣本的輸出層的delta矩陣
	//	構造規則:
	//		1. 樣本的數目為矩陣的行數;
	//		2. 樣本輸出層的數目為矩陣的列數;
	//		3. 矩陣中的元素的值y為:
	//				y = (前向計算出的輸出層的值 - 樣本的輸出層的值) .* f'(net)
	//
	CMatrix cMatrixTDemoOutput(matrixDemoDataInput.GetMatrixRowNumber (), nOutputLayerNumber);
		
	// 得到樣本中輸出層的數據
	matrixDemoDataInput.CopySubMatrix (cMatrixTDemoOutput, (unsigned int)nInputLayerNumber, (unsigned int)0);

	CMatrix cMatrixDemoOutput = cMatrixTDemoOutput.Transpose ();

	// 得到樣本中輸出層的誤差
	CMatrix cMatrixOutputLayerError(nOutputLayerNumber, matrixDemoDataInput.GetMatrixRowNumber ());
	cMatrixOutputLayerError = cMatrixDemoOutput - matrixOutputLayerOutput;

	nSystemErrorOld = cMatrixOutputLayerError.GetSystemError ();

	for(int nLoopTimes=1; nLoopTimes < nMaxTrainTimes; nLoopTimes++)	
	{
		if(nSystemErrorOld < nSystemErrorLevel)
		{
			nLoopTimes--;
			break;
		}

		// 求輸出層的delta值
		// 注意: 此處'/' 是 '點乘'!!!
		CMatrix	cMatrixOutputLayerDelta (nOutputLayerNumber, matrixDemoDataInput.GetMatrixRowNumber());
		cMatrixOutputLayerDelta = (matrixOutputLayerOutput - matrixOutputLayerOutput / matrixOutputLayerOutput) / cMatrixOutputLayerError;
	
		CMatrix cMatrixTHideToOutputWeightValue (matrixHideToOutputWeightValue.GetMatrixColNumber(), matrixHideToOutputWeightValue.GetMatrixRowNumber());
		cMatrixTHideToOutputWeightValue = matrixHideToOutputWeightValue.Transpose();

		// 求隱含層的delta值
		// 注意: 此處'/' 是 '點乘'!!!
		CMatrix cMatrixHideLayerDelta;
		cMatrixHideLayerDelta.CopyMatrix ( (matrixHideLayerOutput - (matrixHideLayerOutput / matrixHideLayerOutput)) / ( cMatrixTHideToOutputWeightValue * cMatrixOutputLayerDelta) );
				
		// 定義新的輸入層到隱含層的權值
		CMatrix cMatrixNewInputToHideWeight (matrixInputToHideWeightValue.GetMatrixRowNumber (), matrixInputToHideWeightValue.GetMatrixColNumber ());
		// 定義的新的隱含層的閥值
		CMatrix cMatrixNewHideLayerValve (nHideLayerNumber, matrixDemoDataInput.GetMatrixRowNumber ());
		// 定義新的隱含層到輸出層的權值
		CMatrix cMatrixNewHideToOutputWeight (matrixHideToOutputWeightValue.GetMatrixRowNumber (), matrixHideToOutputWeightValue.GetMatrixColNumber ());
		// 定義新的輸出層的閥值
		CMatrix cMatrixNewOutputLayerValve (nOutputLayerNumber, matrixDemoDataInput.GetMatrixRowNumber ());
		// 定義新的誤差矩陣
		CMatrix cMatrixNewOutputLayerError(nOutputLayerNumber, matrixDemoDataInput.GetMatrixRowNumber ());


		// 權值和閥值調整
		cMatrixNewHideToOutputWeight = cMatrixOutputLayerDelta * (matrixHideLayerOutput.Transpose ()) * (nStep);
		cMatrixNewOutputLayerValve = cMatrixOutputLayerDelta;

		cMatrixNewInputToHideWeight = cMatrixHideLayerDelta * (matrixInputLayerValue.Transpose ()) * (nStep);
		cMatrixNewHideLayerValve = cMatrixHideLayerDelta;

		// 賦值
		matrixInputToHideWeightValue += cMatrixNewInputToHideWeight;

		CMatrix cMatrixExHideLayerValveValue;
		cMatrixExHideLayerValveValue.nncpyi (matrixHideLayerValveValue, matrixDemoDataInput.GetMatrixRowNumber ());
		cMatrixExHideLayerValveValue += cMatrixNewHideLayerValve;

		matrixHideToOutputWeightValue += cMatrixNewHideToOutputWeight;

		CMatrix cMatrixExOutputLayerValveValue;
		cMatrixExOutputLayerValveValue.nncpyi (matrixOutputLayerValveValue, matrixDemoDataInput.GetMatrixRowNumber ());
		cMatrixExOutputLayerValveValue += cMatrixNewOutputLayerValve;

		// 前向計算
		BPForwardCalculate (nInputLayerNumber,
							nHideLayerNumber,
							nOutputLayerNumber,
							bSimulateDataFlag,
							nComboFunc,
							matrixDemoDataInput,
							matrixInputLayerValue,
							matrixInputToHideWeightValue,
							matrixHideLayerValveValue,
							matrixHideLayerOutput,
							matrixHideToOutputWeightValue,
							matrixOutputLayerOutput,
							matrixOutputLayerValveValue,
							cMatrixExHideLayerValveValue,
							cMatrixExOutputLayerValveValue
							);


		cMatrixNewOutputLayerError = cMatrixDemoOutput - matrixOutputLayerOutput;
		nSystemErrorNew = 	cMatrixNewOutputLayerError.GetSystemError ();

		cMatrixOutputLayerError = cMatrixNewOutputLayerError;

		if(nSystemErrorNew < nSystemErrorOld)
		{
			nSystemErrorOld = nSystemErrorNew;
		}
		else
		{
			nStep *= -0.1;
		}

		// 顯示數據和程序運行狀態
		nSystemError = nSystemErrorOld;
		nTrainTimes = nLoopTimes;


		// 顯示系統誤差
		CString	strSystemError;
		strSystemError.Format ("%lf", nSystemError);
		LPCTSTR	lpstrSystemError = (LPCTSTR)strSystemError;
		HWND	hwnd = ::GetDlgItem (hWnd, ID_SYSTEM_ERROR);
		::SetWindowText (hwnd, lpstrSystemError);
	
		// 顯示訓練次數
		CString strTrainTimes;
		strTrainTimes.Format ("%u", nTrainTimes + 1);
		LPCTSTR lpstrTrainTimes = (LPCTSTR)strTrainTimes;
		hwnd = ::GetDlgItem (hWnd, ID_TRAIN_TIMES);
		::SetWindowText (hwnd, lpstrTrainTimes);

	}// End the "for" loop
	
	return true;
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品综合久久| 天堂久久一区二区三区| 国产成人精品影院| 视频一区二区国产| 国产色一区二区| 3atv在线一区二区三区| 99精品视频在线观看| 亚洲va在线va天堂| 国产精品福利电影一区二区三区四区| 欧美高清激情brazzers| 91在线观看污| 国产一区二区视频在线| 午夜欧美在线一二页| 日韩一区日韩二区| 欧美大片日本大片免费观看| 欧美三级在线播放| 色哟哟精品一区| 国产精品一卡二卡在线观看| 国产精品18久久久久久vr| 亚州成人在线电影| 国产精品美女www爽爽爽| 久久久久久久国产精品影院| 欧美视频中文字幕| 欧美色视频在线观看| 色先锋资源久久综合| 91一区二区三区在线观看| www.亚洲国产| 成人高清免费观看| 成人久久18免费网站麻豆| 黑人精品欧美一区二区蜜桃| 天天亚洲美女在线视频| 亚洲一区二区五区| 亚洲大片精品永久免费| 午夜日韩在线电影| 日韩高清不卡一区二区三区| 视频一区视频二区中文| 亚洲欧美激情小说另类| 亚洲电影中文字幕在线观看| 亚洲一区二区三区三| 亚洲天堂成人在线观看| 亚洲精品乱码久久久久久日本蜜臀| 中文字幕在线不卡一区二区三区| 国产精品久久久久久久久快鸭 | 韩国一区二区视频| 日韩精品91亚洲二区在线观看| 亚洲国产精品一区二区www| 奇米888四色在线精品| 美脚の诱脚舐め脚责91| 免费人成在线不卡| 麻豆精品视频在线观看视频| 激情伊人五月天久久综合| 午夜精品福利一区二区三区av | 亚洲国产精品v| 中文字幕免费在线观看视频一区| ww亚洲ww在线观看国产| 一二三区精品福利视频| 日日夜夜免费精品视频| 久久99精品视频| 岛国av在线一区| 欧美又粗又大又爽| 日韩三级.com| 欧美国产视频在线| 精品噜噜噜噜久久久久久久久试看| 国产精品久久久一本精品| 亚洲午夜私人影院| 亚洲精品高清在线| 麻豆精品一区二区| 91视频在线看| 久久精品一区四区| 中文字幕日韩一区| 亚洲最新视频在线播放| 国产成人免费xxxxxxxx| 波多野结衣精品在线| 欧美亚洲国产bt| 久久先锋影音av鲁色资源| 亚洲日本一区二区| 久久精品一区二区| 蜜臀av一区二区在线免费观看| 国产成人av电影在线| 精品污污网站免费看| 国产精品色婷婷久久58| 亚洲一区二区中文在线| 色综合天天综合色综合av| 欧美电视剧免费全集观看| 中文字幕欧美三区| 日韩影院免费视频| 99精品久久99久久久久| 久久女同精品一区二区| 日韩精品乱码av一区二区| 成人h动漫精品一区二区 | 亚洲成人一二三| 99精品一区二区| 欧美日韩三级视频| 亚洲视频 欧洲视频| 九九视频精品免费| 欧美高清dvd| 免费观看在线色综合| 日本高清无吗v一区| 久久综合色播五月| 久久国产精品99久久人人澡| 成人国产亚洲欧美成人综合网| 国产亚洲综合性久久久影院| 午夜精品久久久久久久久久久| 色综合中文字幕国产| 国产精品久久久久久久久快鸭 | 欧美日韩成人一区| 亚洲欧美日韩国产另类专区| 成人手机在线视频| 国产三级欧美三级| 成人精品一区二区三区四区 | 亚洲成人在线免费| 91亚洲精品久久久蜜桃网站| 中文乱码免费一区二区| 粗大黑人巨茎大战欧美成人| 久久久不卡影院| 国产成人自拍网| 久久毛片高清国产| 久久成人精品无人区| 精品免费日韩av| 激情成人午夜视频| 久久综合色之久久综合| 一区二区三区视频在线看| 欧美三级乱人伦电影| 亚洲精品一二三| 欧美日韩一区二区三区在线看 | 欧美国产成人在线| 欧美一区欧美二区| 天天色综合成人网| 欧美高清视频不卡网| 亚洲123区在线观看| 欧美日本韩国一区二区三区视频 | 欧美三级日韩在线| 久久国产精品99久久人人澡| 国产精品麻豆网站| 欧美日韩一区视频| 高清视频一区二区| 五月天亚洲精品| 国产欧美日韩在线| 91精品婷婷国产综合久久性色| 国产999精品久久久久久| 亚洲成人777| 亚洲欧洲日韩在线| 精品国产99国产精品| 色婷婷亚洲综合| 高清av一区二区| 久久精品国产免费看久久精品| 亚洲美女少妇撒尿| 国产丝袜欧美中文另类| 8x8x8国产精品| 色婷婷综合久久久中文字幕| 国产丶欧美丶日本不卡视频| 日本欧美一区二区在线观看| 日韩一区有码在线| 久久人人超碰精品| 欧美视频在线不卡| 国产成人精品免费一区二区| 日韩高清不卡一区二区| 亚洲综合一区在线| 国产精品的网站| 26uuu精品一区二区| 欧美一区二区三区视频| 色菇凉天天综合网| 不卡av在线免费观看| 国产一区二区不卡在线| 麻豆视频观看网址久久| 亚洲第一成年网| 亚瑟在线精品视频| 午夜精品久久久久| 亚洲一区二区三区四区在线免费观看 | 欧美狂野另类xxxxoooo| 91在线丨porny丨国产| 成人性生交大片免费看中文网站| 激情欧美一区二区三区在线观看| 天堂av在线一区| 午夜视频一区二区| 亚洲国产成人av网| 一区二区三区中文在线观看| 亚洲欧美色一区| 亚洲欧美日韩久久| 亚洲尤物视频在线| 亚洲黄色av一区| 一区二区三区四区在线| 亚洲一区二区三区精品在线| 亚洲无人区一区| 五月天欧美精品| 精品一区二区三区免费| 国产麻豆精品在线观看| 国产成人无遮挡在线视频| 国产激情一区二区三区桃花岛亚洲| 国产一区二区免费在线| 风流少妇一区二区| 不卡电影一区二区三区| 欧美午夜一区二区三区| 91精选在线观看| 久久精品夜色噜噜亚洲aⅴ| 中文字幕一区二区三| 亚洲一区二区视频| 九九视频精品免费| 97久久人人超碰| 9191精品国产综合久久久久久|