资源简介
DBN源码-深度学习
代码片段和文件信息
% Version 1.000
%
% Code provided by Ruslan Salakhutdinov and Geoff Hinton
%
% Permission is granted for anyone to copy use modify or distribute this
% program and accompanying programs and documents for any purpose provided
% this copyright notice is retained and prominently displayed along with
% a note saying that the original programs are available from our
% web page.
% The programs and documents are distributed without any warranty express or
% implied. As the programs were written for research purposes only they have
% not been tested to the degree that would be advisable in any important
% application. All use of these programs is entirely at the user‘s own risk.
% This program fine-tunes an autoencoder with backpropagation.
% Weights of the autoencoder are going to be saved in mnist_weights.mat
% and trainig and test reconstruction errors in mnist_error.mat
% You can also set maxepoch default value is 200 as in our paper.
maxepoch=200;
fprintf(1‘\nTraining discriminative model on MNIST by minimizing cross entropy error. \n‘);
fprintf(1‘60 batches of 1000 cases each. \n‘);
load mnistvhclassify
load mnisthpclassify
load mnisthp2classify
makebatches;
[numcases numdims numbatches]=size(batchdata);
N=numcases;
%%%% PREINITIALIZE WEIGHTS OF THE DISCRIMINATIVE MODEL%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
w1=[vishid; hidrecbiases];
w2=[hidpen; penrecbiases];
w3=[hidpen2; penrecbiases2];
w_class = 0.1*randn(size(w32)+110);
%%%%%%%%%% END OF PREINITIALIZATIO OF WEIGHTS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
l1=size(w11)-1;
l2=size(w21)-1;
l3=size(w31)-1;
l4=size(w_class1)-1;
l5=10;
test_err=[];
train_err=[];
for epoch = 1:maxepoch
%%%%%%%%%%%%%%%%%%%% COMPUTE TRAINING MISCLASSIFICATION ERROR %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
err=0;
err_cr=0;
counter=0;
[numcases numdims numbatches]=size(batchdata);
N=numcases;
for batch = 1:numbatches
data = [batchdata(::batch)];
target = [batchtargets(::batch)];
data = [data ones(N1)];
w1probs = 1./(1 + exp(-data*w1)); w1probs = [w1probs ones(N1)];
w2probs = 1./(1 + exp(-w1probs*w2)); w2probs = [w2probs ones(N1)];
w3probs = 1./(1 + exp(-w2probs*w3)); w3probs = [w3probs ones(N1)];
targetout = exp(w3probs*w_class);%?
targetout = targetout./repmat(sum(targetout2)110);%?
[I J]=max(targetout[]2);
[I1 J1]=max(target[]2);
counter=counter+length(find(J==J1));
err_cr = err_cr- sum(sum( target(:1:end).*log(targetout))) ;%?
end
train_err(epoch)=(numcases*numbatches-counter);
train_crerr(epoch)=err_cr/numbatches;
%%%%%%%%%%%%%% END OF COMPUTING TRAINING MISCLASSIFICATION ERROR %%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%% COMPUTE TEST MISCLASSIFICATION ERROR %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
err=0;
err_cr=0;
counter=0;
[testnumcases testnumdims testnumbatches]=size(testbatchdata);
N=testnumcases;
for batch = 1:testnumbatches
data = [testbatchdata(::batch)];
target = [testbatchtargets(::batch)];
data = [data ones(N1)
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2012-12-04 14:37 dbn\
文件 5483 2012-05-07 09:30 dbn\backpropclassify.m
文件 904 2012-05-18 19:21 dbn\bp.asv
文件 935 2012-05-21 12:36 dbn\bp.m
文件 2001 2012-05-10 21:07 dbn\dbnFit.m
文件 495 2010-10-31 13:01 dbn\dbnPredict.m
文件 1799 2012-04-27 15:58 dbn\examplecode.m
文件 409 2010-10-31 13:01 dbn\interweave.m
文件 65 2010-10-31 13:01 dbn\logistic.m
文件 977 2010-10-31 13:01 dbn\nunique.m
文件 690 2010-10-31 13:01 dbn\prepareArgs.m
文件 3819 2010-10-31 13:01 dbn\process_options.m
文件 5293 2012-05-14 16:48 dbn\rbmBB.m
文件 6149 2012-05-14 16:48 dbn\rbmFit.m
文件 3806 2012-05-14 16:47 dbn\rbmGB.m
文件 358 2010-10-31 13:01 dbn\rbmHtoV.m
文件 877 2010-10-31 13:22 dbn\rbmPredict.m
文件 355 2010-10-31 13:01 dbn\rbmVtoH.m
文件 286 2010-10-31 13:01 dbn\softmaxPmtk.m
文件 371 2010-10-31 13:01 dbn\softmax_sample.m
文件 976 2012-05-18 10:21 dbn\train.asv
文件 913 2012-05-18 14:46 dbn\train.m
文件 3205929 2011-11-22 08:33 dbn\traindata.mat
文件 750 2010-10-31 13:01 dbn\visualize.m
- 上一篇:水准及导线测量平差程序
- 下一篇:高频电子线路期末考试试题库10套
相关资源
- 深度学习的迁移模型
- 纯C深度学习库
- 深度学习之思维导图
- 基于HOG-CSLBP与深度学习的跨年龄人脸
- 中科院期末2018深度学习期末考试卷子
- 用于目标检测和深度学习的飞机图像
- 网易云课堂和coursera深度学习的中文版
- 基于深度学习的通信信号识别技术研
- 基于深度图像和骨骼数据的人体动作
- 深度前馈网路的交通信号检测
- deep learning 概览+时序模型
- 好东西传送门-深度学习资源卡片汇总
- keras中文手册 完整高清PDF
- 深度学习-LeCun、Bengio和Hinton的联合综
- 机器学习和深度学习的技术框架对比
- 翻译 Review on Deep Learning Segmentation 应用
- 基于深度学习的图像语义提取与图像
- 神经网络入门代码(见系列博客)
- 崇志宏:强化学习和深度强化学习
- Grokking Deep Learning - 最新版-无水印-有
- 一天搞懂深度学习-李宏毅 pdf
- 吴恩达深度学习课程第一课第三周作
- 基于深度学习的航空传感器故障诊断
- 基于深度学习人脸识别
- yolo论文理论梳理总结
- 深度学习-《超智能体》电子书-知乎大
- 深度学习在移动端的应用
- 基于opencv接口的深度学习人脸检测代
- tensorflow深度学习CNN智能识别车牌
- 吴恩达深度学习课程第一课 第二周神
评论
共有 条评论