CNN实现手写体数字的识别
一个简单的CNN程序,实现对十种手写体数字的识别
代码片段和文件信息
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 2703 2018-12-24 11:42 allcomb.m
文件 588 2018-12-24 11:29 cnnapplygrads.m
文件 2195 2018-12-24 11:30 cnnbp.m
文件 1811 2018-12-24 11:30 cnnff.m
文件 3507 2018-12-24 11:30 cnnnumgradcheck.m
文件 2054 2018-12-24 11:31 cnnsetup.m
文件 200 2018-12-24 11:31 cnntest.m
文件 870 2018-12-24 11:31 cnntrain.m
文件 2011 2018-12-24 11:43 expand.m
文件 218 2018-12-24 11:43 flicker.m
文件 84 2018-12-24 11:44 flipall.m
文件 561 2018-12-24 11:44 fliplrf.m
文件 595 2018-12-24 11:44 flipudf.m
文件 325 2018-12-24 11:45 im2patches.m
文件 111 2018-12-24 11:45 isOctave.m
文件 1958 2018-12-24 11:46 makeLMfilters.m
文件 14735220 2018-12-24 11:42 mnist_uint8.mat
文件 174 2018-12-24 11:46 myOctaveVersion.m
文件 99 2018-12-24 11:47 normalize.m
文件 252 2018-12-24 11:47 patches2im.m
文件 290 2018-12-24 11:47 randcorr.m
文件 2142 2018-12-24 11:48 randp.m
文件 51 2018-12-24 11:48 rnd.m
文件 50 2018-12-24 11:48 sigm.m
文件 129 2018-12-24 11:49 sigmrnd.m
文件 267 2018-12-24 11:49 softmax.m
文件 56 2018-12-24 11:49 tanh_opt.m
文件 566 2018-12-24 11:36 test_cnn_gradients_are_numerically_correct.m
文件 1014 2018-12-24 11:37 test_example_CNN.m
文件 1121 2018-12-24 11:50 visualize.m
............此处省略5个文件信息
function A = allcomb(varargin)
% ALLCOMB - All combinations
% B = ALLCOMB(A1A2A3...AN) returns all combinations of the elements
% in A1 A2 ... and AN. B is P-by-N matrix is which P is the product
% of the number of elements of the N inputs.
% Empty inputs yields an empty matrix B of size 0-by-N. Note that
% previous versions (1.x) simply ignored empty inputs.
%
% Example:
% allcomb([1 3 5][-3 8][0 1]) ;
% 1 -3 0
% 1 -3 1
% 1 8 0
% ...
% 5 -3 1
% 5 8 0
% 5 8 1
%
% ALLCOMB(A1..AN‘matlab‘) causes the first column to change fastest.
% This is more consistent with matlab indexing. Example:
% allcomb(1:23:45:6‘matlab‘) %->
% 1 3 5
% 2 3 5
% 1 4 5
% ...
% 2 4 6
%
% This functionality is also known as the cartesian product.
%
% See also NCHOOSEK PERMS
% and COMBN (Matlab Central FEX)
% for Matlab R13+
% version 2.1 (feb 2011)
% (c) Jos van der Geest
% email: jos@jasen.nl
% History
% 1.1 (feb 2006) removed minor bug when entering empty cell arrays;
% added option to let the first input run fastest (suggestion by JD)
% 1.2 (jan 2010) using ii as an index on the left-hand for the multiple
% output by NDGRID. Thanks to Jan Simon for showing this little trick
% 2.0 (dec 2010). Bruno Luong convinced me that an empty input should
% return an empty output.
% 2.1 (feb 2011). A cell as input argument caused the check on the last
% argument (specifying the order) to crash.
error(nargchk(1Infnargin)) ;
% check for empty inputs
q = ~cellfun(‘isempty‘varargin) ;
if any(~q)
warning(‘ALLCOMB:EmptyInput‘‘Empty inputs result in an empty output.‘) ;
A = zeros(0nargin) ;
else
ni = sum(q) ;
argn = varargin{end} ;
ischar(argn)
if ischar(argn) && (strcmpi(argn‘matlab‘) || strcmpi(argn‘john‘))
% based on a suggestion by JD on the FEX
ni = ni-1 ;
ii = 1:ni ;
q(end) = 0 ;
else
% enter arguments backwards so last one (AN) is changing fastest
ii = ni:-1:1 ;
end
if ni==0
A = [] ;
else
args = varargin(q) ;
if ~all(cellfun(‘isclass‘args‘double‘))
error(‘All arguments should be arrays of doubles‘) ;
end
if ni==1
A = args{1}(:) ;
else
% flip using ii if last column is changing fastest
[A{ii}] = ndgrid(args{ii}) ;
% concatenate
A = reshape(cat(ni+1A{:})[]ni) ;
end
end
end
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 2703 2018-12-24 11:42 allcomb.m
文件 588 2018-12-24 11:29 cnnapplygrads.m
文件 2195 2018-12-24 11:30 cnnbp.m
文件 1811 2018-12-24 11:30 cnnff.m
文件 3507 2018-12-24 11:30 cnnnumgradcheck.m
文件 2054 2018-12-24 11:31 cnnsetup.m
文件 200 2018-12-24 11:31 cnntest.m
文件 870 2018-12-24 11:31 cnntrain.m
文件 2011 2018-12-24 11:43 expand.m
文件 218 2018-12-24 11:43 flicker.m
文件 84 2018-12-24 11:44 flipall.m
文件 561 2018-12-24 11:44 fliplrf.m
文件 595 2018-12-24 11:44 flipudf.m
文件 325 2018-12-24 11:45 im2patches.m
文件 111 2018-12-24 11:45 isOctave.m
文件 1958 2018-12-24 11:46 makeLMfilters.m
文件 14735220 2018-12-24 11:42 mnist_uint8.mat
文件 174 2018-12-24 11:46 myOctaveVersion.m
文件 99 2018-12-24 11:47 normalize.m
文件 252 2018-12-24 11:47 patches2im.m
文件 290 2018-12-24 11:47 randcorr.m
文件 2142 2018-12-24 11:48 randp.m
文件 51 2018-12-24 11:48 rnd.m
文件 50 2018-12-24 11:48 sigm.m
文件 129 2018-12-24 11:49 sigmrnd.m
文件 267 2018-12-24 11:49 softmax.m
文件 56 2018-12-24 11:49 tanh_opt.m
文件 566 2018-12-24 11:36 test_cnn_gradients_are_numerically_correct.m
文件 1014 2018-12-24 11:37 test_example_CNN.m
文件 1121 2018-12-24 11:50 visualize.m
............此处省略5个文件信息
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件举报,一经查实,本站将立刻删除。
评论列表(条)