-
大小: 7.55MB文件类型: .zip金币: 1下载: 0 次发布日期: 2023-11-14
- 语言: Matlab
- 标签:
资源简介
斯坦福机器学习编程作业machine-learning-ex3,Multi-class Classication and Neural Networks神经网络模型,非线性模型题目,满分,2015最新作业答案
Multi-class Classication and Neural Networks
MATLAB
代码片段和文件信息
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
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2015-10-15 14:53 machine-learning-ex3\
目录 0 2015-10-15 20:18 machine-learning-ex3\ex3\
文件 1502 2013-11-12 01:39 machine-learning-ex3\ex3\displayData.m
文件 2108 2015-10-15 17:17 machine-learning-ex3\ex3\ex3.m
文件 2637 2013-11-12 01:39 machine-learning-ex3\ex3\ex3_nn.m
文件 7511764 2013-11-12 01:39 machine-learning-ex3\ex3\ex3data1.mat
文件 79592 2013-11-12 01:39 machine-learning-ex3\ex3\ex3weights.mat
文件 8749 2015-02-26 07:07 machine-learning-ex3\ex3\fmincg.m
目录 0 2015-10-15 14:53 machine-learning-ex3\ex3\lib\
目录 0 2015-10-15 14:53 machine-learning-ex3\ex3\lib\jsonlab\
文件 1624 2015-04-03 07:08 machine-learning-ex3\ex3\lib\jsonlab\AUTHORS.txt
文件 3862 2015-04-03 07:08 machine-learning-ex3\ex3\lib\jsonlab\ChangeLog.txt
文件 1551 2015-04-03 07:08 machine-learning-ex3\ex3\lib\jsonlab\LICENSE_BSD.txt
文件 19369 2015-04-03 07:08 machine-learning-ex3\ex3\lib\jsonlab\README.txt
文件 881 2015-04-03 07:08 machine-learning-ex3\ex3\lib\jsonlab\jsonopt.m
文件 18732 2015-04-03 07:08 machine-learning-ex3\ex3\lib\jsonlab\loadjson.m
文件 15574 2015-04-03 07:08 machine-learning-ex3\ex3\lib\jsonlab\loadubjson.m
文件 771 2015-04-03 07:08 machine-learning-ex3\ex3\lib\jsonlab\mergestruct.m
文件 17462 2015-04-03 07:08 machine-learning-ex3\ex3\lib\jsonlab\savejson.m
文件 16123 2015-04-03 07:08 machine-learning-ex3\ex3\lib\jsonlab\saveubjson.m
文件 1094 2015-04-03 07:08 machine-learning-ex3\ex3\lib\jsonlab\varargin2struct.m
文件 1195 2015-04-03 07:08 machine-learning-ex3\ex3\lib\makeValidFieldName.m
文件 3734 2015-04-03 07:08 machine-learning-ex3\ex3\lib\submitWithConfiguration.m
文件 1903 2015-10-15 20:33 machine-learning-ex3\ex3\lrCostFunction.m
文件 2229 2015-10-15 20:31 machine-learning-ex3\ex3\oneVsAll.m
文件 1210 2015-10-15 20:32 machine-learning-ex3\ex3\predict.m
文件 1526 2015-10-15 20:32 machine-learning-ex3\ex3\predictOneVsAll.m
文件 137 2013-11-12 01:39 machine-learning-ex3\ex3\sigmoid.m
文件 1567 2015-02-27 15:20 machine-learning-ex3\ex3\submit.m
文件 258 2015-10-15 20:33 machine-learning-ex3\ex3\token.mat
文件 293703 2015-03-11 11:48 machine-learning-ex3\ex3.pdf
............此处省略0个文件信息
评论
共有 条评论