宽度学习 Broad Learning System MATLAB 代码1:MNIST实践


澳门大学陈俊龙 | 宽度学习系统:一种不需要深度结构的高效增量学习系统 原文 Broad Learning System: An Effective and Efficient Incremental Learning System Without the Need for Deep Architecture IEEE Transactions on Neural Networks and Learning Systems, Vol. 29, Issue 1, 2018
资源截图
代码片段和文件信息
%%%%%%%%%%%%%%%%%%%%%%%%This is the demo for the bls models including the
%%%%%%%%%%%%%%%%%%%%%%%%proposed incremental learning algorithms. 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%load the dataset MNIST dataset%%%%%%%%%%%%%%%%%%%%
clear; 
warning off all;
format compact;
load mnist;

%%%%%%%%%%%%%%%the samples from the data are normalized and the lable data
%%%%%%%%%%%%%%%train_y and test_y are reset as N*C matrices%%%%%%%%%%%%%%
train_x = double(train_x/255);
train_y = double(train_y);
% test_x = double(train_x/255);
% test_y = double(train_y);
test_x = double(test_x/255);
test_y = double(test_y);
train_y=(train_y-1)*2+1;
test_y=(test_y-1)*2+1;
assert(isfloat(train_x) ‘train_x must be a float‘);
assert(all(train_x(:)>=0) && all(train_x(:)<=1) ‘all data in train_x must be in [0:1]‘);
assert(isfloat(test_x) ‘test_x must be a float‘);
assert(all(test_x(:)>=0) && all(test_x(:)<=1) ‘all data in test_x must be in [0:1]‘);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
disp(‘Press any key to run the one shot BLS demo‘);
pause

%%%%%%%%%%%%%%%%%%%%This is the model of broad learning sytem with%%%%%%
%%%%%%%%%%%%%%%%%%%%one shot structrue%%%%%%%%%%%%%%%%%%%%%%%%
C = 2^-30; s = .8;%the l2 regularization parameter and the shrinkage scale of the enhancement nodes
N11=10;%feature nodes  per window
N2=10;% number of windows of feature nodes
N33=11000;% number of enhancement nodes
epochs=10;% number of epochs 
train_err=zeros(1epochs);test_err=zeros(1epochs);
train_time=zeros(1epochs);test_time=zeros(1epochs);
% rand(‘state‘67797325)   % 12000 %%%%% The random seed recommended by the
% reference HELM [10].
N1=N11; N3=N33;  
for j=1:epochs    
    [TrainingAccuracyTestingAccuracyTraining_timeTesting_time] = bls_train(train_xtrain_ytest_xtest_ysCN1N2N3);       
    train_err(j)=TrainingAccuracy * 100;
    test_err(j)=TestingAccuracy * 100;
    train_time(j)=Training_time;
    test_time(j)=Testing_time;
end
save ( [‘mnist_result_oneshot_‘ num2str(N3)] ‘train_err‘ ‘test_err‘ ‘train_time‘ ‘test_time‘);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
disp(‘Press any key to run the one shot BLS demo with BP algorithm‘);
pause

%%%%%%%%%%%%%%%%%%%%This is the model of broad learning system for one%%%%%%
%%%%%%%%%%%%%%%%%%%%shot structrue with fine tuning under BP algorithm%%%%%%%%%%%%%%%%%%%%%%%%
C = 2^-30; s = .8;%the l2 regularization parameter and the shrinkage scale of the enhancement nodes
N11=10;%feature nodes  per window
N2=10;% number of windows of feature nodes
N33=5000;% number of enhancement nodes
epochs=1;% number of epochs 
train_err=zeros(1epochs);test_err=zeros(1epochs);
train_time=zeros(1epochs);test_time=zeros(1epochs);
% rand(‘state‘67797325)   % 12000 %%%%% The random seed recommended by the
% reference HELM [10].
N1=N11; N3=N33;  
for j=1:epochs   
    [TrainingAcc

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件       9687  2017-11-27 22:51  Demo_Broadlearning_MNISTBLS_demo_MNIST.m

     文件       9752  2017-11-27 22:52  Demo_Broadlearning_MNISTBLS_demo_MNIST_for_lower_memory.m

     文件       3028  2017-07-16 19:35  Demo_Broadlearning_MNISTls_train.m

     文件       7776  2017-07-19 23:17  Demo_Broadlearning_MNISTls_train_bp.m

     文件       5834  2017-07-16 19:43  Demo_Broadlearning_MNISTls_train_enhance.m

     文件       6745  2017-07-16 20:28  Demo_Broadlearning_MNISTls_train_enhancefeature.m

     文件       5639  2017-07-16 20:31  Demo_Broadlearning_MNISTls_train_input.m

     文件       6398  2017-07-16 20:32  Demo_Broadlearning_MNISTls_train_inputenhance.m

     文件   14735220  2017-07-11 20:58  Demo_Broadlearning_MNISTmnist.mat

     文件        438  2017-07-19 23:02  Demo_Broadlearning_MNISTpre_zca.m

     文件         72  2017-07-11 20:58  Demo_Broadlearning_MNIST
esult.m

     文件        495  2017-07-11 20:58  Demo_Broadlearning_MNISTsparse_bls.m

     目录          0  2017-11-27 22:52  Demo_Broadlearning_MNIST

----------- ---------  ---------- -----  ----

             14791084                    13


版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件举报,一经查实,本站将立刻删除。

发表评论

评论列表(条)