for(int j=0 ; j
{
for(int k=0 ; k
{
cout<
}
cout<
}
}
cout<
}//end
//把结果保存到文件
void BP::After_Train_Out()
{
int i,j ;
ofstream Out_x1("Out_x1.txt",ios::out) ;
ofstream Out_x2("Out_x2.txt",ios::out) ;
ofstream Out_Net("Out_Net.txt",ios::out) ;
ofstream Out_Exp("Out_Exp.txt",ios::out) ;
ofstream W_End("W_End.txt",ios::out) ;
ofstream Q_End("Q_End.txt",ios::out) ;
ofstream Array("Array.txt",ios::out) ;
ofstream Out_x11("x1.txt",ios::out) ;
ofstream Out_x22("x2.txt",ios::out) ;
ofstream Result1("result1.txt",ios::out) ;
ofstream Out_x111("x11.txt",ios::out) ;
ofstream Out_x222("x22.txt",ios::out) ;
ofstream Result2("result2.txt",ios::out) ;
for( i=0 ; i
{
for(j=0 ; j
{
Out_x11<
Out_x22<
Result1<<3*NetWorkOut(i,j)<
Out_x1<
Array<
Out_x2<
Array<
Out_Net<<3*NetWorkOut(i,j)<
Array<
Out_Exp<
Array<<3*NetWorkOut(i,j)<
Array<
}
Out_x1<
Out_x2<
Out_x11<
Out_x22<
Result1<
}
for(j=0 ; j
{
for(i=0 ; i
{
Out_x111<
Out_x222<
Result2<<3*NetWorkOut(i,j)<
}
Out_x111<
Out_x222<
Result2<
}
//把经过训练后的权系数和阀值保存到文件里
for(i=1 ; i
{
for(int j=0 ; j
{
for(int k=0 ; k
{
W_End<
}
}
}//end for
}//end
void main(void)
{
BP B;//生成一个BP类对象B
B.Train();//开始训练
B.BP_Print();//把结果打印出来
B.After_Train_Out();//把结果保存到文件
}//end