Human-level concept learning through probabilistic program induction学习与验证

最近一段时间学习了一篇SCI的文章——

Human-level concept learning through probabilistic program induction

这篇文章在学术界反响很大。据我了解,该文的算法能与deep cnn效果相匹敌。

下面贴出自己对该文代码的验证过程:

先记一下对代码进行的操作要求:
Using the code
Setting your path
First, you must add all of the sub-directories to your Matlab path. While in the main BPL directory type this command:
addpath(genpath(pwd));

Pre-processing stroke data
This only needs to be run once, and it can take up to 5 minutes to complete. From the ‘data’ directory, run:
omniglot_preprocess;

This will create the ‘data_background_processed.mat’ and the ‘data_evaluation_processed.mat’ files for accessing the Omniglot dataset with pre-processed stroke data.
Parsing demo
To run the model fitting demo, type
demo_fit;

One-shot classification
First, download the pre-computed models and unzip such that ‘model_fits’ and ‘model_refits’ are sub-directories of the ‘classification’ directory.
http://cims.nyu.edu/~brenden/supplemental/BPL_precomputed/model_fits.zip
http://cims.nyu.edu/~brenden/supplemental/BPL_precomputed/model_refits.zip
To run the model re-fitting demo, enter the ‘classification’ directory and type:
demo_refit;
To measure classification error rate with the pre-computed results, type:
run_classification;

One-shot exemplar generation
First, enter the ‘generate_exemplars’ directory and unzip ‘model_fits.zip’ so ‘model_fits’ is now a sub-directory. These are the pre-computed models that were used in the exemplar generation visual Turing tests.
To run the exemplar generation demo, from within the ‘generate_exemplars’ directory type:
demo_generate_exemplar;
Computing resources
Most experiments will require a multi-CPU cluster to run in a reasonable amount of time. Fitting motor programs to images of characters can be run in parallel.
The parsing and one-shot classification demos include a ‘fast_mode’ option (on by default) which allows for the demo to run quickly, skipping the expensive procedure of fitting the strokes to the details of the image. Use this mode with caution, as this mode is much cruder and was not used in the paper results.

在执行
demo_fit;
一句时,产生报错:
Error using solve_tril (line 6)
You must run install_lightspeed in order to use this function.
于是转而执行install_lightspeed
结果再次出错:
Compiling lightspeed 2.7 mex files…
Using the lapack library at C:\MATLAB\R2015b\extern\lib\win64\Microsoft\libmwlapack.lib
mex -largeArrayDims -silent -DBLAS64 solve_triu.c “C:\MATLAB\R2015b\extern\lib\win64\Microsoft\libmwlapack.lib” “C:\MATLAB\R2015b\extern\lib\win64\Microsoft\libmwblas.lib”
Reference to non-existent field ‘vcvarsopts’.

Error in install_lightspeed (line 135)
disp([‘install_random.bat “’ options.VSINSTALLDIR ‘” ’
options.vcvarsopts]);

再次执行
demo_fit;
后,不再报错。
此时生成三张图片
Human-level concept learning through probabilistic program induction学习与验证_第1张图片
Human-level concept learning through probabilistic program induction学习与验证_第2张图片
Human-level concept learning through probabilistic program induction学习与验证_第3张图片

继续下一步操作,但是发现model_fits.zip和model_refits.zip这两个压缩文件无法下载。

下载完成后继续进行验证:
执行
demo_refit;
得到training image 和 test image
Human-level concept learning through probabilistic program induction学习与验证_第4张图片

之后执行:
run_classification;
得到错误率,为:
Human-level concept learning through probabilistic program induction学习与验证_第5张图片

转到“generate_examplars”文件夹下,执行:
demo_generate_exemplar;
得到一组算法生成新字符的例子:
Human-level concept learning through probabilistic program induction学习与验证_第6张图片

至此代码验证结束,
下一步将完成该篇论文的翻译与算法详细学习讨论。

你可能感兴趣的:(机器学习)