machine-learning-ex3编程作业:多元分类与神经网络吴恩达机器学习


machine-learning-ex3(编程作业:多元分类与神经网络)吴恩达机器学习
资源截图
代码片段和文件信息
function [h display_array] = displayData(X example_width)
%DISPLAYDATA Display 2D data in a nice grid
%   [h display_array] = DISPLAYDATA(X example_width) displays 2D data
%   stored in X in a nice grid. It returns the figure handle h and the 
%   displayed array if requested.

% Set example_width automatically if not passed in
if ~exist(‘example_width‘ ‘var‘) || isempty(example_width) 
example_width = round(sqrt(size(X 2)));
end

% Gray Image
colormap(gray);

% Compute rows cols
[m n] = size(X);
example_height = (n / example_width);

% Compute number of items to display
display_rows = floor(sqrt(m));
display_cols = ceil(m / display_rows);

% Between images padding
pad = 1;

% Setup blank display
display_array = - ones(pad + display_rows * (example_height + pad) ...
                       pad + display_cols * (example_width + pad));

% Copy each example into a patch on the display array
curr_ex = 1;
for j = 1:display_rows
for i = 1:display_cols
if curr_ex > m 
break; 
end
% Copy the patch

% Get the max value of the patch
max_val = max(abs(X(curr_ex :)));
display_array(pad + (j - 1) * (example_height + pad) + (1:example_height) ...
              pad + (i - 1) * (example_width + pad) + (1:example_width)) = ...
reshape(X(curr_ex :) example_height example_width) / max_val;
curr_ex = curr_ex + 1;
end
if curr_ex > m 
break; 
end
end

% Display Image
h = imagesc(display_array [-1 1]);

% Do not show axis
axis image off

drawnow;

end

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

     文件       1502  2017-03-13 18:40  machine-learning-ex3(编程作业:多元分类与神经网络)ex3displayData.m

     文件       3838  2018-10-21 09:53  machine-learning-ex3(编程作业:多元分类与神经网络)ex3ex3.m

     文件    7511764  2017-03-13 18:40  machine-learning-ex3(编程作业:多元分类与神经网络)ex3ex3data1.mat

     文件      79592  2017-03-13 18:40  machine-learning-ex3(编程作业:多元分类与神经网络)ex3ex3weights.mat

     文件       3015  2018-10-21 12:04  machine-learning-ex3(编程作业:多元分类与神经网络)ex3ex3_nn.m

     文件       8749  2017-03-13 18:40  machine-learning-ex3(编程作业:多元分类与神经网络)ex3fmincg.m

     文件       1624  2017-03-13 18:40  machine-learning-ex3(编程作业:多元分类与神经网络)ex3libjsonlabAUTHORS.txt

     文件       3862  2017-03-13 18:40  machine-learning-ex3(编程作业:多元分类与神经网络)ex3libjsonlabChangeLog.txt

     文件        881  2017-03-13 18:40  machine-learning-ex3(编程作业:多元分类与神经网络)ex3libjsonlabjsonopt.m

     文件       1551  2017-03-13 18:40  machine-learning-ex3(编程作业:多元分类与神经网络)ex3libjsonlabLICENSE_BSD.txt

     文件      18732  2017-03-13 18:40  machine-learning-ex3(编程作业:多元分类与神经网络)ex3libjsonlabloadjson.m

     文件      15574  2017-03-13 18:40  machine-learning-ex3(编程作业:多元分类与神经网络)ex3libjsonlabloadubjson.m

     文件        771  2017-03-13 18:40  machine-learning-ex3(编程作业:多元分类与神经网络)ex3libjsonlabmergestruct.m

     文件      19369  2017-03-13 18:40  machine-learning-ex3(编程作业:多元分类与神经网络)ex3libjsonlabREADME.txt

     文件      17462  2017-03-13 18:40  machine-learning-ex3(编程作业:多元分类与神经网络)ex3libjsonlabsavejson.m

     文件      16123  2017-03-13 18:40  machine-learning-ex3(编程作业:多元分类与神经网络)ex3libjsonlabsaveubjson.m

     文件       1094  2017-03-13 18:40  machine-learning-ex3(编程作业:多元分类与神经网络)ex3libjsonlabvarargin2struct.m

     文件       1195  2017-03-13 18:40  machine-learning-ex3(编程作业:多元分类与神经网络)ex3libmakeValidFieldName.m

     文件       5562  2017-03-13 18:40  machine-learning-ex3(编程作业:多元分类与神经网络)ex3libsubmitWithConfiguration.m

     文件       2801  2018-10-20 08:15  machine-learning-ex3(编程作业:多元分类与神经网络)ex3lrCostFunction.m

     文件       3256  2018-10-20 10:32  machine-learning-ex3(编程作业:多元分类与神经网络)ex3oneVsAll.m

     文件       1324  2018-10-21 11:52  machine-learning-ex3(编程作业:多元分类与神经网络)ex3predict.m

     文件       1764  2018-10-21 11:20  machine-learning-ex3(编程作业:多元分类与神经网络)ex3predictOneVsAll.m

     文件        137  2018-10-19 11:56  machine-learning-ex3(编程作业:多元分类与神经网络)ex3sigmoid.m

     文件       1567  2017-03-13 18:40  machine-learning-ex3(编程作业:多元分类与神经网络)ex3submit.m

     文件     810219  2018-10-21 12:05  machine-learning-ex3(编程作业:多元分类与神经网络)ex3.pdf

     目录          0  2017-03-13 18:40  machine-learning-ex3(编程作业:多元分类与神经网络)ex3libjsonlab

     目录          0  2017-03-13 18:40  machine-learning-ex3(编程作业:多元分类与神经网络)ex3lib

     目录          0  2018-10-21 12:05  machine-learning-ex3(编程作业:多元分类与神经网络)ex3

     目录          0  2018-10-20 09:01  machine-learning-ex3(编程作业:多元分类与神经网络)

............此处省略3个文件信息

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

发表评论

评论列表(条)