资源简介

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(编程作业:多元分类与神经网络)\ex3\displayData.m

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

评论

共有 条评论