资源简介
吴恩达机器学习 缺失的 machine-learning-ex4
代码片段和文件信息
function checkNNGradients(lambda)
%CHECKNNGRADIENTS Creates a small neural network to check the
%backpropagation gradients
% CHECKNNGRADIENTS(lambda) Creates a small neural network to check the
% backpropagation gradients it will output the analytical gradients
% produced by your backprop code and the numerical gradients (computed
% using computeNumericalGradient). These two gradient computations should
% result in very similar values.
%
if ~exist(‘lambda‘ ‘var‘) || isempty(lambda)
lambda = 0;
end
input_layer_size = 3;
hidden_layer_size = 5;
num_labels = 3;
m = 5;
% We generate some ‘random‘ test data
Theta1 = debugInitializeWeights(hidden_layer_size input_layer_size);
Theta2 = debugInitializeWeights(num_labels hidden_layer_size);
% Reusing debugInitializeWeights to generate X
X = debugInitializeWeights(m input_layer_size - 1);
y = 1 + mod(1:m num_labels)‘;
% Unroll parameters
nn_params = [Theta1(:) ; Theta2(:)];
% Short hand for cost function
costFunc = @(p) nnCostFunction(p input_layer_size hidden_layer_size ...
num_labels X y lambda);
[cost grad] = costFunc(nn_params);
numgrad = computeNumericalGradient(costFunc nn_params);
% Visually examine the two gradient computations. The two columns
% you get should be very similar.
disp([numgrad grad]);
fprintf([‘The above two columns you get should be very similar.\n‘ ...
‘(Left-Your Numerical Gradient Right-Analytical Gradient)\n\n‘]);
% Evaluate the norm of the difference between two solutions.
% If you have a correct implementation and assuming you used EPSILON = 0.0001
% in computeNumericalGradient.m then diff below should be less than 1e-9
diff = norm(numgrad-grad)/norm(numgrad+grad);
fprintf([‘If your backpropagation implementation is correct then \n‘ ...
‘the relative difference will be small (less than 1e-9). \n‘ ...
‘\nRelative Difference: %g\n‘] diff);
end
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2019-03-02 17:43 machine-learning-ex4\
目录 0 2019-03-02 17:43 machine-learning-ex4\machine-learning-ex4\
目录 0 2019-03-02 17:43 machine-learning-ex4\machine-learning-ex4\ex4\
文件 1950 2017-03-13 18:40 machine-learning-ex4\machine-learning-ex4\ex4\checkNNGradients.m
文件 1095 2017-03-13 18:40 machine-learning-ex4\machine-learning-ex4\ex4\computeNumericalGradient.m
文件 841 2017-03-13 18:40 machine-learning-ex4\machine-learning-ex4\ex4\debugInitializeWeights.m
文件 1502 2017-03-13 18:40 machine-learning-ex4\machine-learning-ex4\ex4\displayData.m
文件 8099 2017-03-13 18:40 machine-learning-ex4\machine-learning-ex4\ex4\ex4.m
文件 7511764 2017-03-13 18:40 machine-learning-ex4\machine-learning-ex4\ex4\ex4data1.mat
文件 79592 2017-03-13 18:40 machine-learning-ex4\machine-learning-ex4\ex4\ex4weights.mat
文件 8749 2017-03-13 18:40 machine-learning-ex4\machine-learning-ex4\ex4\fmincg.m
目录 0 2019-03-02 17:43 machine-learning-ex4\machine-learning-ex4\ex4\lib\
目录 0 2019-03-02 17:43 machine-learning-ex4\machine-learning-ex4\ex4\lib\jsonlab\
文件 1624 2017-03-13 18:40 machine-learning-ex4\machine-learning-ex4\ex4\lib\jsonlab\AUTHORS.txt
文件 3862 2017-03-13 18:40 machine-learning-ex4\machine-learning-ex4\ex4\lib\jsonlab\ChangeLog.txt
文件 1551 2017-03-13 18:40 machine-learning-ex4\machine-learning-ex4\ex4\lib\jsonlab\LICENSE_BSD.txt
文件 19369 2017-03-13 18:40 machine-learning-ex4\machine-learning-ex4\ex4\lib\jsonlab\README.txt
文件 881 2017-03-13 18:40 machine-learning-ex4\machine-learning-ex4\ex4\lib\jsonlab\jsonopt.m
文件 18732 2017-03-13 18:40 machine-learning-ex4\machine-learning-ex4\ex4\lib\jsonlab\loadjson.m
文件 15574 2017-03-13 18:40 machine-learning-ex4\machine-learning-ex4\ex4\lib\jsonlab\loadubjson.m
文件 771 2017-03-13 18:40 machine-learning-ex4\machine-learning-ex4\ex4\lib\jsonlab\mergestruct.m
文件 17462 2017-03-13 18:40 machine-learning-ex4\machine-learning-ex4\ex4\lib\jsonlab\savejson.m
文件 16123 2017-03-13 18:40 machine-learning-ex4\machine-learning-ex4\ex4\lib\jsonlab\saveubjson.m
文件 1094 2017-03-13 18:40 machine-learning-ex4\machine-learning-ex4\ex4\lib\jsonlab\varargin2struct.m
文件 1195 2017-03-13 18:40 machine-learning-ex4\machine-learning-ex4\ex4\lib\makeValidFieldName.m
文件 5562 2017-03-13 18:40 machine-learning-ex4\machine-learning-ex4\ex4\lib\submitWithConfiguration.m
文件 3210 2017-03-13 18:40 machine-learning-ex4\machine-learning-ex4\ex4\nnCostFunction.m
文件 585 2017-03-13 18:40 machine-learning-ex4\machine-learning-ex4\ex4\predict.m
文件 903 2017-03-13 18:40 machine-learning-ex4\machine-learning-ex4\ex4\randInitializeWeights.m
文件 137 2017-03-13 18:40 machine-learning-ex4\machine-learning-ex4\ex4\sigmoid.m
文件 677 2017-03-13 18:40 machine-learning-ex4\machine-learning-ex4\ex4\sigmoidGradient.m
............此处省略2个文件信息
相关资源
- 斯坦福机器学习讲义-中文版-黄海广
- 机器学习与信息安全
- Regression Modeling Strategies.pdf
- 中国医学影像AI白皮书-2019
- 吴恩达(Andrew Ng)斯坦福公开课\“机
- 吴恩达斯坦福公开课机器学习的讲义
- 机器学习-MIT行人检测数据库
- Advances in Financial Machine learning
- 山东大学机器学习实验代码 全部
- 豆瓣5万条影评数据集
- 视觉问答权威综述Visual Question Answer
- 网易云公开课:机器学习课程课件
- Analysis of Financial Time Series
- 无痛的机器学习 第一季
- 泛函分析内容、方法与技巧.zip 无密码
- 低秩矩阵分解,矩阵恢复
- 神经网络与深度学习吴恩达第三周编
- UCI数据集55个
- Deep Learning with PyTorch 完整版
- 机器学习与R语言,课件
- 《Science》杂志-机器学习究竟将如何影
- 《终极算法:机器学习和人工智能如
- 统计学习理论的本质中文 Vladimir N.V
- EA反编译转换器
- 贝叶斯统计推断 统计学习
- 核函数的所有代码
- 斯坦福UFLDL深度学习课程翻译版合集
- 北京大学-机器学习课件
- 机器学习—吴恩达中文版pdf
- 机器学习算法校招面试题库附答案与
评论
共有 条评论