24小时热门版块排行榜    

查看: 2998  |  回复: 9
【奖励】 本帖被评价8次,作者雪狼乖乖增加金币 7.5
当前只显示满足指定条件的回帖,点击这里查看本话题的所有回帖

[资源] 【分享】关于Boltzmann 的计算代码(MATLAB)

考虑到Boltzmann分布确实在模拟过程的重要性, 曾经收集过该类代码(只是玻尔兹曼机),先共享给大家(经典算法,需要修正)。
玻尔兹曼机【BM,BoltzmannMachine】在工作阶段的搜索法不能保证获得全部最优解的问题
用法及示例如下:
Usage:
[MINIMUM,FVAL] = ANNEAL(LOSS,NEWSOL,[OPTIONS]);
MINIMUM is the solution which generated the smallest encountered value when input into LOSS.
FVAL is the value of the LOSS function evaluated at MINIMUM.
OPTIONS = ANNEAL();
OPTIONS is the default options structure.


这是一段非常小的matlab程序,实现了遗传退火算法的模拟。
Example:
The so-called six-hump camelback function has several local minima in the range -3<=x<=3 and -2<=y<=2. It has two global minima, namely f(-0.0898,0.7126) = f(0.0898,-0.7126) = -1.0316. We can define and minimise it as follows:
camel = @(x,y)(4-2.1*x.^2+x.^4/3).*x.^2+x.*y+4*(y.^2-1).*y.^2;
loss = @(p)camel(p(1),p(2));
[x f] = anneal(loss,[0 0])
We get output:
Initial temperature: 1
Final temperature: 3.21388e-007
Consecutive rejections: 1027
Number of function calls: 6220
Total final loss: -1.03163
x =
-0.0899 0.7127
f =
-1.0316
Which reasonably approximates the analytical global minimum (note that due to randomness, your results will likely not be exactly the same).

源代码原文下载:
General simulated annealing algorithm anneal Minimizes a function with the method of simulated annealing (Kirkpatrick et al., 1983)


另上传一份程序,可以直接运行,供大家使用:
http://d.namipan.com/d/1a59bf99e ... f5c0af5dd9a41790000

这是一个C语言编写的模拟退火算法的玻尔兹曼机,它实现了Boltzmann玻尔兹曼机的学习训练。通过仿真神经网络,实现在多个输入输出神经元间,训练权重和阈值,从而收敛。
回复此楼
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

★★★★★ 五星级,优秀推荐

非常感谢
2楼2010-07-20 16:08:22
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
相关版块跳转 我要订阅楼主 雪狼乖乖 的主题更新
☆ 无星级 ★ 一星级 ★★★ 三星级 ★★★★★ 五星级
普通表情 高级回复 (可上传附件)
信息提示
请填处理意见