資源簡介
VisualC數字圖像模式識別技術及工程實踐.zip

代碼片段和文件信息
//Download?by?http://www.NewXing.com
/*
?******************************************************************
?*?backprop.cpp
?******************************************************************
?*/
#include?“StdAfx.h“
#include?
#include?“backprop.h“
#include?
#include?
#define?ABS(x)??????????(((x)?>?0.0)???(x)?:?(-(x)))
/*?宏定義:快速拷貝?*/
#define?fastcopy(tofromlen)\
{\
register?char?*_to*_from;\
register?int?_i_l;\
_to?=?(char?*)(to);\
_from?=?(char?*)(from);\
_l?=?(len);\
for?(_i?=?0;?_i?}
/***?返回0-1的雙精度隨機數?***/
double?drnd()
{
return?((double)?rand()?/?(double)?BIGRND);
}
/***?返回-1.0到1.0之間的雙精度隨機數?***/
double?dpn1()
{
return?((drnd()?*?2.0)?-?1.0);
}
/***?作用函數,目前是S型函數?***/
double?squash(double?x)
{
return?(1.0?/?(1.0?+?exp(-x)));
}
/***?申請1維雙精度實數數組?***/
double?*alloc_1d_dbl(int?n)
{
double?*new1;
new1?=?(double?*)?malloc?((unsigned)?(n?*?sizeof?(double)));
if?(new1?==?NULL)?{
printf(“ALLOC_1D_DBL:?Couldn‘t?allocate?array?of?doubles\n“);
return?(NULL);
}
return?(new1);
}
/***?申請2維雙精度實數數組?***/
double?**alloc_2d_dbl(int?m?int?n)
{
int?i;
double?**new1;
new1?=?(double?**)?malloc?((unsigned)?(m?*?sizeof?(double?*)));
if?(new1?==?NULL)?{
printf(“ALLOC_2D_DBL:?Couldn‘t?allocate?array?of?dbl?ptrs\n“);
return?(NULL);
}
for?(i?=?0;?i? new1[i]?=?alloc_1d_dbl(n);
}
return?(new1);
}
/***?隨機初始化權值?***/
void?bpnn_randomize_weights(double?**w?int?m?int?n)
{
int?i?j;
for?(i?=?0;?i?<=?m;?i++)?{
for?(j?=?0;?j?<=?n;?j++)?{
w[i][j]?=?dpn1();
}
}
}
/***?0初始化權值?***/
void?bpnn_zero_weights(double?**w?int?m?int?n)
{
int?i?j;
for?(i?=?0;?i?<=?m;?i++)?{
for?(j?=?0;?j?<=?n;?j++)?{
w[i][j]?=?0.0;
}
}
}
/***?設置隨機數種子?***/
void?bpnn_initialize(int?seed)
{
printf(“Random?number?generator?seed:?%d\n“?seed);
srand(seed);
}
/***?創建BP網絡?***/
BPNN?*bpnn_internal_create(int?n_in?int?n_hidden?int?n_out)
{
BPNN?*newnet;
newnet?=?(BPNN?*)?malloc?(sizeof?(BPNN));
if?(newnet?==?NULL)?{
printf(“BPNN_CREATE:?Couldn‘t?allocate?neural?network\n“);
return?(NULL);
}
newnet->input_n?=?n_in;
newnet->hidden_n?=?n_hidden;
newnet->output_n?=?n_out;
newnet->input_units?=?alloc_1d_dbl(n_in?+?1);
newnet->hidden_units?=?alloc_1d_dbl(n_hidden?+?1);
newnet->output_units?=?alloc_1d_dbl(n_out?+?1);
newnet->hidden_delta?=?alloc_1d_dbl(n_hidden?+?1);
newnet->output_delta?=?alloc_1d_dbl(n_out?+?1);
newnet->target?=?alloc_1d_dbl(n_out?+?1);
newnet->input_weights?=?alloc_2d_dbl(n_in?+?1?n_hidden?+?1);
newnet->hidden_weights?=?alloc_2d_dbl(n_hidden?+?1?n_out?+?1);
newnet->input_prev_weights?=?alloc_2d_dbl(n_in?+?1?n_hidden?+?1);
newnet->hidden_prev_weights?=?alloc_2d_dbl(n_hidden?+?1?n_out?+?1);
return?(newnet);
}
/*?釋放BP網絡所占地內存空間?*/
void?bpnn_free(BPNN?*net)
{
int?n1?n2?i;
n1?=?net->input_n;
n2?=?net->hidden_n;
free((char?*)?net->input_units);
free((char?*)?net->hidden_units);
free((char?*)?net->output_units);
fre
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件????????5537??2007-11-07?11:01??Visual?C++數字圖像模式識別技術及工程實踐?-?目錄.txt
?????文件?????5780042??2018-05-28?11:43??Visual?C++數字圖像模式識別技術及工程實踐(第二版).pdf
?????目錄???????????0??2008-10-09?20:56??源代碼\
?????目錄???????????0??2008-10-09?20:56??源代碼\第03章??常用的模型和算法介紹\
?????目錄???????????0??2008-10-09?20:56??源代碼\第03章??常用的模型和算法介紹\BP神經網絡的C語言實現\
?????文件????????9601??2013-12-02?03:42??源代碼\第03章??常用的模型和算法介紹\BP神經網絡的C語言實現\backprop.cpp
?????文件????????1702??2013-12-02?03:42??源代碼\第03章??常用的模型和算法介紹\BP神經網絡的C語言實現\backprop.h
?????目錄???????????0??2008-10-09?20:56??源代碼\第03章??常用的模型和算法介紹\BP神經網絡解決異或問題\
?????文件????????3403??1999-08-21?14:33??源代碼\第03章??常用的模型和算法介紹\BP神經網絡解決異或問題\BPNet.001
?????文件????????3440??2002-11-19?08:52??源代碼\第03章??常用的模型和算法介紹\BP神經網絡解決異或問題\BPNet.dsp
?????文件?????????535??2002-11-19?08:52??源代碼\第03章??常用的模型和算法介紹\BP神經網絡解決異或問題\BPNet.dsw
?????文件????????2420??2013-12-02?03:42??源代碼\第03章??常用的模型和算法介紹\BP神經網絡解決異或問題\bpnet.h
?????文件???????41984??2003-01-07?07:04??源代碼\第03章??常用的模型和算法介紹\BP神經網絡解決異或問題\BPNet.ncb
?????文件???????53760??2003-01-07?07:04??源代碼\第03章??常用的模型和算法介紹\BP神經網絡解決異或問題\BPNet.opt
?????文件????????1078??2002-11-19?09:11??源代碼\第03章??常用的模型和算法介紹\BP神經網絡解決異或問題\BPNet.plg
?????文件?????????464??2013-12-02?03:42??源代碼\第03章??常用的模型和算法介紹\BP神經網絡解決異或問題\main.cpp
?????目錄???????????0??2008-10-09?20:56??源代碼\第03章??常用的模型和算法介紹\BP神經網絡解決異或問題\Release\
?????文件???????49152??2002-11-19?09:11??源代碼\第03章??常用的模型和算法介紹\BP神經網絡解決異或問題\Release\BPNet.exe
?????文件????????5371??2002-11-19?09:11??源代碼\第03章??常用的模型和算法介紹\BP神經網絡解決異或問題\Release\main.obj
?????文件???????33792??2003-01-07?07:03??源代碼\第03章??常用的模型和算法介紹\BP神經網絡解決異或問題\Release\vc60.idb
?????目錄???????????0??2008-10-09?20:56??源代碼\第03章??常用的模型和算法介紹\HMM的C語言實現\
?????文件????????1957??2013-12-02?03:42??源代碼\第03章??常用的模型和算法介紹\HMM的C語言實現\backward.cpp
?????文件????????4083??2013-12-02?03:42??源代碼\第03章??常用的模型和算法介紹\HMM的C語言實現\baum.cpp
?????文件????????2318??2013-12-02?03:42??源代碼\第03章??常用的模型和算法介紹\HMM的C語言實現\hmm.h
?????文件?????????472??2013-12-02?03:42??源代碼\第03章??常用的模型和算法介紹\HMM的C語言實現\hmmrand.cpp
?????文件????????4117??2013-12-02?03:42??源代碼\第03章??常用的模型和算法介紹\HMM的C語言實現\hmmutils.cpp
?????文件???????10859??2013-12-02?03:42??源代碼\第03章??常用的模型和算法介紹\HMM的C語言實現\nrutil.cpp
?????文件????????1486??2013-12-02?03:42??源代碼\第03章??常用的模型和算法介紹\HMM的C語言實現\nrutil.h
?????文件????????3058??2013-12-02?03:42??源代碼\第03章??常用的模型和算法介紹\HMM的C語言實現\viterbi.cpp
?????目錄???????????0??2008-10-09?20:56??源代碼\第03章??常用的模型和算法介紹\矢量量化的C語言實現\
?????文件???????11870??2013-12-02?03:42??源代碼\第03章??常用的模型和算法介紹\矢量量化的C語言實現\Clustering.cpp
............此處省略391個文件信息
評論
共有 條評論