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

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

?? testdoc.cpp

?? 用C++寫的函數逼近的例子!可以設置步長
?? CPP
?? 第 1 頁 / 共 3 頁
字號:
// testDoc.cpp : implementation of the CTestDoc class
//

#include "stdafx.h"
#include "test.h"

#include "testDoc.h"
#include "DataInput.h"
#include "ValueInput.h"
#include "MyTestDlg.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CTestDoc

IMPLEMENT_DYNCREATE(CTestDoc, CDocument)

BEGIN_MESSAGE_MAP(CTestDoc, CDocument)
	//{{AFX_MSG_MAP(CTestDoc)
	ON_COMMAND(ID_MENU_LOAD, OnMenuLoad)
	ON_COMMAND(ID_MENU_LEARN, OnMenuLearn)
	ON_COMMAND(ID_MENU_NEWFILE, OnMenuNewfile)
	ON_COMMAND(ID_MENU_TEST, OnMenuTest)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CTestDoc construction/destruction

CTestDoc::CTestDoc()
{
	// TODO: add one-time construction code here
	file_loaded = FALSE;
	data_learned = FALSE;
	can_learn = FALSE;
	progress = FALSE;

	max_error_tollerance = 0.0;
	learning_rate = 0.0;
	original_learning_rate = 0.0;
	last_original_rate = 0.0;
	alpha = 0.0;
	max_step = 0;
	dispmode = 0;
	ytemp = 0;
	ztemp = 0;
	total = 0;
	old_e = 0.0;
	total_e = 0.0;
	last_old_e = 0.0;
	delta_e = 0.0;
	min_e = 0.0;
	increase_length = 0.0;
	decrease_length = 0.0;

	input = NULL;
	hidden = NULL;
	output = NULL;
	gamma = 0;
	target = NULL;
	bias = NULL;
	old_bias = NULL;
	last_bias = NULL;
	last_old_bias = NULL;
	weight_i_h = NULL;
	weight_h_o = NULL;
	old_weight_ih = NULL;
	last_weight_ih = NULL;
	last_old_weight_ih = NULL;
	old_weight_ho = NULL;
	last_weight_ho = NULL;
	last_old_weight_ho = NULL;
	errorsignal_hidden = NULL;
	errorsignal_output = NULL;
	delta_error_output = NULL;
	last_delta_error_output = NULL;
	delta_error_hidden = NULL;
	last_delta_error_hidden = NULL;
	delta_weight_ho = NULL;
	last_delta_weight_ho = NULL;
	delta_weight_ih = NULL;
	last_delta_weight_ih = NULL;
}

CTestDoc::~CTestDoc()
{
	if (file_loaded)
	{
		clear_memory();
	}
}

BOOL CTestDoc::OnNewDocument()
{
	if (!CDocument::OnNewDocument())
		return FALSE;

	// TODO: add reinitialization code here
	// (SDI documents will reuse this document)

	return TRUE;
}



/////////////////////////////////////////////////////////////////////////////
// CTestDoc serialization

void CTestDoc::Serialize(CArchive& ar)
{
	if (ar.IsStoring())
	{
		// TODO: add storing code here
	}
	else
	{
		// TODO: add loading code here
	}
}

/////////////////////////////////////////////////////////////////////////////
// CTestDoc diagnostics

#ifdef _DEBUG
void CTestDoc::AssertValid() const
{
	CDocument::AssertValid();
}

void CTestDoc::Dump(CDumpContext& dc) const
{
	CDocument::Dump(dc);
}
#endif //_DEBUG

/////////////////////////////////////////////////////////////////////////////
// CTestDoc commands

void CTestDoc::OnMenuLoad() 
{
	// TODO: Add your command handler code here
    char * szFilter = "Text Files (.txt)|*.txt|All Files (.*)|*.*||";
 	CFileDialog dlg_file(TRUE,"txt",
						 NULL,
		                 OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,
						 szFilter);
	dlg_file.m_ofn.lpstrTitle = "讀入數據";
	if (dlg_file.DoModal()==IDOK)
	{
		if (file_loaded)
		{
			clear_memory();
		}
		file_loaded = TRUE;
		
		ifstream in(dlg_file.GetPathName(),ios::nocreate|ios::in);
		if (in.fail()){::AfxMessageBox("No such file or path is wrong"); exit(1);}
		
		TRACE("\nfilename=%s\n",dlg_file.GetPathName());
		data_learned = FALSE;
		can_learn = TRUE;
	
		in >> input_array_size;
		in >> hidden_array_size;
		in >> output_array_size;
		in >> original_learning_rate;
		in >> number_of_input_patterns;
		TRACE("\n\nparameter=%d,%d,%d,%f,%d\n\n",input_array_size,
										   hidden_array_size,
										   output_array_size,
										   learning_rate,
										   number_of_input_patterns);
		bias_array_size = hidden_array_size + output_array_size; 

		initialize_net();//initialize the memory

		int x,y;
		for(x=0; x<bias_array_size; x++) 
		{
			in >> original_bias[x];
		}
		for(x=0; x<input_array_size; x++) 
		{ 
			for(y=0; y<hidden_array_size; y++)
			{
				in >> original_weight_ih[x][y];
			}
		}
		for(x=0; x<hidden_array_size; x++) 
		{ 
			for(y=0; y<output_array_size; y++)
			{
				in >> original_weight_ho[x][y];
			}
		}
		for(x=0; x<number_of_input_patterns; x++) 
		{
			for(y=0; y<input_array_size; y++) 
			{
				in >> input[x][y];
				TRACE("input[%d][%d]=%.0f\n",x,y,input[x][y]);
			}
		}
		for(x=0; x<number_of_input_patterns; x++)
		{
			for(y=0; y<output_array_size; y++)
			{
				in >> target[x][y];
				TRACE("target[%d][%d]=%.0f\n",x,y,target[x][y]);
			}
		}
		in.close();
		::AfxMessageBox("Data loaded");
	}
}

void CTestDoc::initialize_net()
{
	int x;
	input = new double* [number_of_input_patterns];
	if(!input) { ::AfxMessageBox("memory problem!"); exit(1); }
	for(x=0; x<number_of_input_patterns; x++)
	{
		input[x] = new double [input_array_size];
		if(!input[x]) { ::AfxMessageBox("memory problem!"); exit(1); }
	}

	//hidden = new double [hidden_array_size];
	hidden = new double* [number_of_input_patterns];
	if(!hidden) { ::AfxMessageBox("memory problem!"); exit(1); }
	for (x=0; x<number_of_input_patterns; x++)
	{
		hidden[x] = new double [hidden_array_size];
		if(!hidden[x]) {::AfxMessageBox("memory problem!"); exit(1); }
	}

	output = new double* [number_of_input_patterns];
	if(!output) { ::AfxMessageBox("memory problem!"); exit(1); }
	for(x=0; x<number_of_input_patterns; x++)
	{
		output[x] = new double [output_array_size];
		if(!output[x]) { ::AfxMessageBox("memory problem!"); exit(1); }
	}

	gamma = new double* [number_of_input_patterns];
	if(!gamma) { ::AfxMessageBox("memory problem!"); exit(1); }
	for(x=0; x<number_of_input_patterns; x++)
	{
		gamma[x] = new double [output_array_size];
		if(!gamma[x]) { ::AfxMessageBox("memory problem!"); exit(1); }
	}

	target = new double* [number_of_input_patterns];
	if(!target) { ::AfxMessageBox("memory problem!"); exit(1); }
	for(x=0; x<number_of_input_patterns; x++)
	{
		target[x] = new double [output_array_size];
		if(!target[x]) { ::AfxMessageBox("memory problem!"); exit(1); }
	}

	bias = new double [bias_array_size];
	if(!bias) { ::AfxMessageBox("memory problem!"); exit(1); }

	original_bias = new double [bias_array_size];
	if(!original_bias) { ::AfxMessageBox("memory problem!"); exit(1); }

	old_bias = new double [bias_array_size];
	if(!old_bias) { ::AfxMessageBox("memory problem!"); exit(1); }

	last_bias = new double [bias_array_size];
	if(!last_bias) { ::AfxMessageBox("memory problem!"); exit(1); }

	last_old_bias = new double [bias_array_size];
	if(!last_old_bias) { ::AfxMessageBox("memory problem!"); exit(1); }

	weight_i_h = new double* [input_array_size];
	if(!weight_i_h) { ::AfxMessageBox("memory problem!"); exit(1); }
	for(x=0; x<input_array_size; x++)
	{
		weight_i_h[x] = new double [hidden_array_size];
		if(!weight_i_h[x]) { ::AfxMessageBox("memory problem!"); exit(1); }
	}

	original_weight_ih = new double* [input_array_size];
	if(!original_weight_ih) { ::AfxMessageBox("memory problem!"); exit(1); }
	for(x=0; x<input_array_size; x++)
	{
		original_weight_ih[x] = new double [hidden_array_size];
		if(!original_weight_ih[x]) { ::AfxMessageBox("memory problem!"); exit(1); }
	}

	old_weight_ih = new double* [hidden_array_size];
	if(!old_weight_ih) { ::AfxMessageBox("memory problem!"); exit(1); }
	for(x=0; x<input_array_size; x++)
	{
		old_weight_ih[x] = new double [hidden_array_size];
		if(!old_weight_ih[x]) { ::AfxMessageBox("memory problem!"); exit(1); }
	}

	last_weight_ih = new double* [hidden_array_size];
	if(!last_weight_ih) { ::AfxMessageBox("memory problem!"); exit(1); }
	for(x=0; x<input_array_size; x++)
	{
		last_weight_ih[x] = new double [hidden_array_size];
		if(!last_weight_ih[x]) { ::AfxMessageBox("memory problem!"); exit(1); }
	}

	last_old_weight_ih = new double* [hidden_array_size];
	if(!last_old_weight_ih) { ::AfxMessageBox("memory problem!"); exit(1); }
	for(x=0; x<input_array_size; x++)
	{
		last_old_weight_ih[x] = new double [hidden_array_size];
		if(!last_old_weight_ih[x]) { ::AfxMessageBox("memory problem!"); exit(1); }
	}

	weight_h_o = new double* [hidden_array_size];
	if(!weight_h_o) { ::AfxMessageBox("memory problem!"); exit(1); }
	for(x=0; x<hidden_array_size; x++)
	{
		weight_h_o[x] = new double [output_array_size];
		if(!weight_h_o[x]) { ::AfxMessageBox("memory problem!"); exit(1); }
	}

	original_weight_ho = new double* [hidden_array_size];
	if(!original_weight_ho) { ::AfxMessageBox("memory problem!"); exit(1); }
	for(x=0; x<hidden_array_size; x++)
	{
		original_weight_ho[x] = new double [output_array_size];
		if(!original_weight_ho[x]) { ::AfxMessageBox("memory problem!"); exit(1); }
	}
	
	old_weight_ho = new double* [hidden_array_size];
	if(!old_weight_ho) { ::AfxMessageBox("memory problem!"); exit(1); }
	for(x=0; x<hidden_array_size; x++)
	{
		old_weight_ho[x] = new double [output_array_size];
		if(!old_weight_ho[x]) { ::AfxMessageBox("memory problem!"); exit(1); }
	}
	
	last_weight_ho = new double* [hidden_array_size];
	if(!last_weight_ho) { ::AfxMessageBox("memory problem!"); exit(1); }
	for(x=0; x<hidden_array_size; x++)
	{
		last_weight_ho[x] = new double [output_array_size];
		if(!last_weight_ho[x]) { ::AfxMessageBox("memory problem!"); exit(1); }
	}

	last_old_weight_ho = new double* [hidden_array_size];
	if(!last_old_weight_ho) { ::AfxMessageBox("memory problem!"); exit(1); }
	for(x=0; x<hidden_array_size; x++)
	{
		last_old_weight_ho[x] = new double [output_array_size];
		if(!last_old_weight_ho[x]) { ::AfxMessageBox("memory problem!"); exit(1); }
	}

	errorsignal_hidden = new double [hidden_array_size];
	if(!errorsignal_hidden) { ::AfxMessageBox("memory problem!"); exit(1); }

	errorsignal_output = new double [output_array_size];
	if(!errorsignal_output) { ::AfxMessageBox("memory problem!"); exit(1); }

	delta_error_output = new double [output_array_size];
	if (!delta_error_output){::AfxMessageBox("memory problem"); exit(1);}

	last_delta_error_output = new double [output_array_size];
	if (!last_delta_error_output){::AfxMessageBox("memory problem"); exit(1);}

	delta_error_hidden = new double [hidden_array_size];
	if (!delta_error_hidden){::AfxMessageBox("memory problem"); exit(1);}

	last_delta_error_hidden = new double [hidden_array_size];
	if (!last_delta_error_hidden){::AfxMessageBox("memory problem"); exit(1);}
	
	delta_weight_ih = new double* [input_array_size];
	if(!delta_weight_ih) { ::AfxMessageBox("memory problem!"); exit(1); }
	for(x=0; x<input_array_size; x++)
	{
		delta_weight_ih[x] = new double [hidden_array_size];
		if(!delta_weight_ih[x]) { ::AfxMessageBox("memory problem!"); exit(1); }
	}

	last_delta_weight_ih = new double* [input_array_size];
	if(!last_delta_weight_ih) { ::AfxMessageBox("memory problem!"); exit(1); }
	for(x=0; x<input_array_size; x++)
	{
		last_delta_weight_ih[x] = new double [hidden_array_size];
		if(!last_delta_weight_ih[x]) { ::AfxMessageBox("memory problem!"); exit(1); }
	}
	
	delta_weight_ho = new double* [hidden_array_size];
	if(!delta_weight_ho) { ::AfxMessageBox("memory problem!"); exit(1); }
	for(x=0; x<hidden_array_size; x++)
	{
		delta_weight_ho[x] = new double [output_array_size];
		if(!delta_weight_ho[x]) { ::AfxMessageBox("memory problem!"); exit(1); }
	}

	last_delta_weight_ho = new double* [hidden_array_size];
	if(!last_delta_weight_ho) { ::AfxMessageBox("memory problem!"); exit(1); }
	for(x=0; x<hidden_array_size; x++)
	{
		last_delta_weight_ho[x] = new double [output_array_size];
		if(!last_delta_weight_ho[x]) { ::AfxMessageBox("memory problem!"); exit(1); }
	}

	return;
}

void CTestDoc::clear_memory()
{	
	int x;
	for(x=0; x<number_of_input_patterns; x++)
	{
		delete [] input[x];
	}
	delete [] input;

	for (x=0; x<number_of_input_patterns; x++)
	{
		delete [] hidden[x];
	}
	delete [] hidden;

	for(x=0; x<number_of_input_patterns; x++)
	{
		delete [] output[x];
	}
	delete [] output;

	for(x=0; x<number_of_input_patterns; x++)
	{
		delete [] gamma[x];
	}
	delete [] gamma;

	for(x=0; x<number_of_input_patterns; x++)
	{
		delete [] target[x];
	}
	delete [] target;

	delete [] bias;
	 
	delete [] original_bias;

	delete [] old_bias;

	delete [] last_bias;
	
	delete [] last_old_bias;

	for(x=0; x<input_array_size; x++)
	{
		delete [] weight_i_h[x];

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美三级乱人伦电影| 激情五月播播久久久精品| 成人av动漫网站| 欧美激情中文字幕一区二区| 国产一区二区三区久久久| 久久在线观看免费| 国产一区999| 国产精品嫩草影院av蜜臀| 欧美午夜精品久久久久久孕妇| 中文字幕免费一区| 成人av电影在线| 亚洲综合小说图片| 日韩一区二区在线免费观看| 六月丁香婷婷久久| 中文乱码免费一区二区| av色综合久久天堂av综合| 亚洲一区在线观看免费观看电影高清 | 日产精品久久久久久久性色| 日韩一区二区免费高清| 国产一区二区三区香蕉| 亚洲欧美电影院| 在线电影一区二区三区| 国产精品18久久久久久久网站| 国产精品久久久久久一区二区三区| 日本福利一区二区| 激情五月婷婷综合| 一区二区视频免费在线观看| 56国语精品自产拍在线观看| 欧美久久久久中文字幕| 日本成人中文字幕在线视频| 精品国产乱码久久久久久浪潮| 国产激情一区二区三区| 一区二区在线看| 欧美精品一区二区三区在线播放 | 麻豆国产91在线播放| 国产精品久久毛片av大全日韩| 欧美二区三区的天堂| 豆国产96在线|亚洲| 日韩成人免费看| 国产精品麻豆网站| 日韩欧美国产不卡| 在线观看不卡一区| 国产精品66部| 日日摸夜夜添夜夜添国产精品| 国产亚洲短视频| 91精品国产综合久久久蜜臀粉嫩 | 日本一道高清亚洲日美韩| 国产精品水嫩水嫩| 日韩欧美一级在线播放| 色综合久久久久网| 国产成人在线看| 日韩电影在线一区二区| 亚洲女人小视频在线观看| 久久久精品国产99久久精品芒果| 欧美日本韩国一区| 色综合色综合色综合| 国产精品中文字幕日韩精品| 丝袜亚洲另类欧美| 亚洲一区二区精品3399| 日韩毛片在线免费观看| 日本一区二区三区高清不卡 | 91社区在线播放| 国内精品国产三级国产a久久| 午夜激情综合网| 亚洲综合成人在线视频| 亚洲欧美日韩小说| 国产精品国产a| 国产精品午夜久久| 欧美韩日一区二区三区四区| 亚洲精品在线观看网站| 日韩一区二区三区av| 欧美日韩综合色| 欧美午夜精品一区二区三区| 日本精品裸体写真集在线观看| 风间由美性色一区二区三区| 国产91精品一区二区麻豆网站| 国产精品自在在线| 国产精品1区2区| 国产成人自拍网| 国产成人在线视频免费播放| 豆国产96在线|亚洲| 成人午夜激情在线| 99久久精品99国产精品| 91美女片黄在线观看91美女| 成人91在线观看| 91蜜桃在线观看| 欧洲一区在线观看| 欧美日韩国产经典色站一区二区三区 | 精品影视av免费| 精品一区二区三区视频在线观看| 激情五月婷婷综合| 成人一道本在线| 99久久精品免费看国产| 在线观看日韩一区| 精品污污网站免费看| 91精品国产综合久久福利| 日韩精品一区二区三区四区| 久久久精品国产99久久精品芒果| 国产精品女主播在线观看| 日韩一区在线看| 亚洲国产精品欧美一二99| 蜜臀久久99精品久久久画质超高清| 精品一区二区三区视频| k8久久久一区二区三区| 91久久精品网| 欧美大片一区二区| 国产欧美一区视频| 日韩精品一二三区| 国产一区二区免费在线| 91色porny| 91麻豆精品国产91久久久久久 | 日本高清不卡在线观看| 欧美日韩电影一区| 久久久电影一区二区三区| 亚洲色图.com| 奇米色777欧美一区二区| 丁香亚洲综合激情啪啪综合| 欧美日韩一区二区三区四区| 久久久亚洲综合| 亚洲福利国产精品| 国产成人av福利| 在线观看91视频| 国产亚洲综合在线| 亚洲成人午夜电影| 风间由美一区二区av101| 欧美日韩视频专区在线播放| 久久精品亚洲乱码伦伦中文| 亚洲综合免费观看高清在线观看| 狠狠色丁香九九婷婷综合五月| 色综合欧美在线| 久久亚洲综合色| 亚洲一区二区三区四区在线免费观看 | 国内精品伊人久久久久影院对白| 色综合网站在线| wwwwxxxxx欧美| 五月天欧美精品| 91美女精品福利| 久久综合资源网| 欧美aaa在线| 在线看日本不卡| 国产精品色婷婷| 国产一区二区在线免费观看| 欧美亚洲国产一区在线观看网站 | 亚洲人成小说网站色在线| 久久国产婷婷国产香蕉| 欧美日韩一级片在线观看| 国产精品久久久久久久久图文区| 欧美aaaaaa午夜精品| 欧美午夜视频网站| 亚洲免费观看高清完整版在线| 国产精品乡下勾搭老头1| 欧美一区二区网站| 首页亚洲欧美制服丝腿| 91黄视频在线观看| 自拍av一区二区三区| 国产成人免费xxxxxxxx| 精品av久久707| 久久99国产精品成人| 日韩欧美国产高清| 免费一区二区视频| 欧美日韩aaaaa| 亚洲国产你懂的| 欧美日韩在线播放| 亚洲国产精品久久艾草纯爱| 在线观看成人免费视频| 一区二区不卡在线视频 午夜欧美不卡在| 国产成人午夜电影网| 精品国产污网站| 狠狠色狠狠色合久久伊人| 日韩欧美精品在线视频| 美女mm1313爽爽久久久蜜臀| 欧美一区二区三区精品| 美女视频免费一区| 精品免费99久久| 国产精品自拍网站| 国产精品久久久久四虎| 99在线视频精品| 一区二区成人在线视频| 欧美剧情片在线观看| 轻轻草成人在线| 2023国产精华国产精品| 国产91精品露脸国语对白| 亚洲国产成人在线| 99久久er热在这里只有精品15 | 日韩精品一区二区三区中文精品 | 国产麻豆一精品一av一免费 | 91 com成人网| 蜜臀久久久99精品久久久久久| 亚洲精品一区二区三区影院| 丁香激情综合五月| 美美哒免费高清在线观看视频一区二区 | 日韩欧美国产高清| 国产成人av网站| 一区二区三区免费网站| 7777精品伊人久久久大香线蕉超级流畅| 亚洲国产精品一区二区尤物区| 91精品国产综合久久久久久久久久 | 亚洲天堂av一区| 欧美日韩电影一区| 国产精品自产自拍|