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

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

?? procedure.cpp

?? 該軟件為BP網絡的仿真軟件
?? 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一区二区三区免费野_久草精品视频
成人黄色片在线观看| 欧美日本在线播放| 欧美喷潮久久久xxxxx| 国产精品你懂的| 日本va欧美va精品| 91丨porny丨中文| 国产精品久久看| 午夜在线成人av| eeuss鲁片一区二区三区| 欧美xxxx老人做受| 日韩精品久久久久久| 91蝌蚪国产九色| 久久久精品综合| 成人动漫中文字幕| 日韩女优制服丝袜电影| 亚洲美女在线国产| 国产传媒久久文化传媒| 日韩午夜小视频| 石原莉奈在线亚洲三区| 欧美综合色免费| **性色生活片久久毛片| 国产成人av电影在线| 精品国产一区二区国模嫣然| 天天免费综合色| 欧美三级电影网站| 亚洲午夜久久久久久久久久久| 不卡视频在线观看| 欧美激情在线一区二区三区| 国产精品影音先锋| 久久久久亚洲综合| 狠狠色综合色综合网络| 欧美大片国产精品| 久久精品国产免费看久久精品| 欧美精品久久一区二区三区| 亚洲成av人影院| 91精品国产一区二区| 麻豆91小视频| 亚洲人吸女人奶水| 欧美综合色免费| 日韩精品三区四区| 精品噜噜噜噜久久久久久久久试看| 午夜不卡av免费| 欧美一区二区三区小说| 麻豆91在线看| 中文字幕巨乱亚洲| 色欧美乱欧美15图片| 午夜影视日本亚洲欧洲精品| 日韩欧美色综合| 成人成人成人在线视频| 一区二区三区在线免费观看| 欧美三区在线视频| 国产麻豆成人精品| 亚洲欧美一区二区三区孕妇| 欧美日韩视频在线第一区| 秋霞电影一区二区| 国产欧美日本一区视频| 色偷偷88欧美精品久久久| 亚洲aaa精品| 精品国产乱码久久久久久1区2区| 丁香婷婷深情五月亚洲| 亚洲综合久久久久| 欧美va亚洲va香蕉在线| 播五月开心婷婷综合| 午夜精品久久久久久不卡8050| 精品乱码亚洲一区二区不卡| 91在线国产福利| 免费高清视频精品| 亚洲三级久久久| 日韩欧美电影一区| 色综合一个色综合| 老色鬼精品视频在线观看播放| 国产精品久久久久久久久晋中| 欧美日本一区二区| 成人美女视频在线观看18| 亚洲不卡av一区二区三区| 欧美极品xxx| 日韩视频在线永久播放| 91成人看片片| 国产成人精品影视| 日本亚洲免费观看| 亚洲欧美另类久久久精品2019| 精品日本一线二线三线不卡| 色伊人久久综合中文字幕| 国产精品一区二区视频| 天堂va蜜桃一区二区三区| 中文字幕一区二区在线观看| 日韩一级完整毛片| 色噜噜久久综合| 成人一道本在线| 国产麻豆视频一区| 奇米四色…亚洲| 夜夜操天天操亚洲| 国产精品第五页| 中文字幕第一区二区| 精品成人私密视频| 日韩三级在线观看| 欧美美女直播网站| 欧美中文字幕一区二区三区亚洲| 成人激情免费网站| 国产成人免费视频网站| 奇米色一区二区三区四区| 无吗不卡中文字幕| 午夜精品在线视频一区| 亚洲成av人在线观看| 亚洲成人激情社区| 亚洲综合偷拍欧美一区色| 一区二区三区成人| 亚洲色图20p| 狠狠色丁香九九婷婷综合五月| 亚洲成人精品在线观看| 亚洲精品国产精华液| 亚洲精品免费在线| 一区二区三区四区视频精品免费| 亚洲欧美日韩小说| 亚洲综合在线五月| 亚洲大片精品永久免费| 亚欧色一区w666天堂| 亚洲成人动漫一区| 日韩成人av影视| 麻豆视频观看网址久久| 黄色日韩三级电影| 成人免费高清在线观看| eeuss鲁片一区二区三区在线看| proumb性欧美在线观看| 91麻豆6部合集magnet| 欧美日韩一区三区四区| 在线不卡免费欧美| 欧美精品一区二区三区在线播放| 久久蜜臀中文字幕| 亚洲猫色日本管| 午夜精品福利久久久| 狠狠狠色丁香婷婷综合激情| 国产成人一级电影| 99精品热视频| 欧美日韩黄视频| 欧美精品一区二区在线播放| 国产精品丝袜一区| 亚洲小说欧美激情另类| 青青草原综合久久大伊人精品优势| 国产麻豆精品久久一二三| www.久久精品| 制服丝袜激情欧洲亚洲| 久久久久久久网| 亚洲一区二区在线免费看| 久久av中文字幕片| 91丨九色丨黑人外教| 91精品一区二区三区久久久久久 | 久久理论电影网| 国产精品国产精品国产专区不片| 一区二区三区在线免费| 麻豆一区二区三| 色香蕉久久蜜桃| 久久久久久电影| 婷婷一区二区三区| 成人av免费观看| 欧美日韩国产a| 国产精品久久久久久久久快鸭 | 久久成人精品无人区| 成人国产精品免费观看| 日韩一级片网址| 一区在线中文字幕| 麻豆91在线播放| 欧美性猛片xxxx免费看久爱| 久久久精品2019中文字幕之3| 亚洲影院在线观看| 成人一区二区三区视频在线观看| 宅男噜噜噜66一区二区66| 最新日韩av在线| 国内精品国产三级国产a久久| 在线免费观看一区| 国产精品久久久久aaaa| 另类综合日韩欧美亚洲| 欧美日本乱大交xxxxx| 亚洲欧美日本在线| 国产精品18久久久久久vr| 欧美丰满一区二区免费视频| 国产精品福利一区| 国产成人精品午夜视频免费| 69av一区二区三区| 亚洲一区二区3| 成人黄色网址在线观看| 国产香蕉久久精品综合网| 日本午夜一本久久久综合| 色综合久久久久久久| 亚洲国产精品精华液ab| 国产在线视视频有精品| 欧美一级日韩免费不卡| 亚洲444eee在线观看| 欧美日韩中文另类| 一区二区高清视频在线观看| 99精品国产99久久久久久白柏| 欧美国产日韩一二三区| 国产成人精品亚洲午夜麻豆| 国产日韩高清在线| 国产一区二区三区视频在线播放| 日韩欧美色电影| 国产另类ts人妖一区二区| 久久久国产一区二区三区四区小说 | 国产成人欧美日韩在线电影| 久久久精品免费网站|