最近老师要我看看这篇文章,有些细节文章上体会不是很深,于是把代码拿来看看,调通代码也是走了很多弯路,这里记录下来。

首先代码的来源:https://github.com/brendenlake/BPL

作者也写了需要的支撑库与代码实现过程

我用的matlab2015b上面要求的库只需要安装加速的库,根据网址下载,然后放在matlab的安装包的工具箱里面:D:\matlab2015b\toolbox

Human-level concept learning through probabilistic program induction代码验证

然后打开matlab

Human-level concept learning through probabilistic program induction代码验证

设置路径里面添加我们下载的文件夹


Human-level concept learning through probabilistic program induction代码验证

保存,关闭。

这时候直接运行代码是跑不通的,显示如下错误:

Human-level concept learning through probabilistic program induction代码验证


意思是我们添加了库,但是并没有安装好。这时候打开install_lightspeed.m这个文件,并在当前的目录下运行这个文件,否则会报错。

Human-level concept learning through probabilistic program induction代码验证

这里给了提示,于是在你放这个库的文件下,运行这个m文件,成功安装。


Human-level concept learning through probabilistic program induction代码验证

这时候提示了要测试一下,我当时没测试,直接运行了demo_fit文件,还是显示前面的错误,所以重新安装了加速器,再测试了一下




测试完了再运行demo文件,成功通过。


Human-level concept learning through probabilistic program induction代码验证

Human-level concept learning through probabilistic program induction代码验证


Human-level concept learning through probabilistic program induction代码验证



我这开始添加库的时候多添加了一个cvm的工具箱,导致和加速库的函数重名,matlab一度奔溃,重装了好几次,现在弄好了,故记录下来。


相关文章: