资源简介

代码片段和文件信息
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
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
....... 1950 2017-03-14 09:40 machine-learning-ex4\machine-learning-ex4\ex4\checkNNGradients.m
....... 1095 2017-03-14 09:40 machine-learning-ex4\machine-learning-ex4\ex4\computeNumericalGradient.m
....... 841 2017-03-14 09:40 machine-learning-ex4\machine-learning-ex4\ex4\debugInitializeWeights.m
....... 1502 2017-03-14 09:40 machine-learning-ex4\machine-learning-ex4\ex4\displayData.m
....... 8099 2017-03-14 09:40 machine-learning-ex4\machine-learning-ex4\ex4\ex4.m
....... 7511764 2017-03-14 09:40 machine-learning-ex4\machine-learning-ex4\ex4\ex4data1.mat
....... 79592 2017-03-14 09:40 machine-learning-ex4\machine-learning-ex4\ex4\ex4weights.mat
....... 8749 2017-03-14 09:40 machine-learning-ex4\machine-learning-ex4\ex4\fmincg.m
....... 1624 2017-03-14 09:40 machine-learning-ex4\machine-learning-ex4\ex4\lib\jsonlab\AUTHORS.txt
....... 3862 2017-03-14 09:40 machine-learning-ex4\machine-learning-ex4\ex4\lib\jsonlab\ChangeLog.txt
....... 881 2017-03-14 09:40 machine-learning-ex4\machine-learning-ex4\ex4\lib\jsonlab\jsonopt.m
....... 1551 2017-03-14 09:40 machine-learning-ex4\machine-learning-ex4\ex4\lib\jsonlab\LICENSE_BSD.txt
....... 18732 2017-03-14 09:40 machine-learning-ex4\machine-learning-ex4\ex4\lib\jsonlab\loadjson.m
....... 15574 2017-03-14 09:40 machine-learning-ex4\machine-learning-ex4\ex4\lib\jsonlab\loadubjson.m
....... 771 2017-03-14 09:40 machine-learning-ex4\machine-learning-ex4\ex4\lib\jsonlab\mergestruct.m
....... 19369 2017-03-14 09:40 machine-learning-ex4\machine-learning-ex4\ex4\lib\jsonlab\README.txt
....... 17462 2017-03-14 09:40 machine-learning-ex4\machine-learning-ex4\ex4\lib\jsonlab\savejson.m
....... 16123 2017-03-14 09:40 machine-learning-ex4\machine-learning-ex4\ex4\lib\jsonlab\saveubjson.m
....... 1094 2017-03-14 09:40 machine-learning-ex4\machine-learning-ex4\ex4\lib\jsonlab\varargin2struct.m
....... 1195 2017-03-14 09:40 machine-learning-ex4\machine-learning-ex4\ex4\lib\makeValidFieldName.m
....... 5562 2017-03-14 09:40 machine-learning-ex4\machine-learning-ex4\ex4\lib\submitWithConfiguration.m
....... 3210 2017-03-14 09:40 machine-learning-ex4\machine-learning-ex4\ex4\nnCostFunction.m
....... 585 2017-03-14 09:40 machine-learning-ex4\machine-learning-ex4\ex4\predict.m
....... 903 2017-03-14 09:40 machine-learning-ex4\machine-learning-ex4\ex4\randInitializeWeights.m
....... 137 2017-03-14 09:40 machine-learning-ex4\machine-learning-ex4\ex4\sigmoid.m
....... 677 2017-03-14 09:40 machine-learning-ex4\machine-learning-ex4\ex4\sigmoidGradient.m
....... 1635 2017-03-14 09:40 machine-learning-ex4\machine-learning-ex4\ex4\submit.m
....... 356692 2017-03-14 09:40 machine-learning-ex4\machine-learning-ex4\ex4.pdf
目录 0 2017-03-14 09:40 machine-learning-ex4\machine-learning-ex4\ex4\lib\jsonlab
目录 0 2017-03-14 09:40 machine-learning-ex4\machine-learning-ex4\ex4\lib
............此处省略6个文件信息
相关资源
- CNN-SVM模型在抽油机井故障诊断中的应
- bp神经网络源代码,可直接运行
- 连续hopfield神经网络解决TSP问题
- 改进的BP神经网络算法
- 基于bp神经网络的表情识别
- 神经网络仿真工具源代码
- 使用卷积神经网络在e + e-对撞机上改
- ppt 机器学习.ppt
- 用labview编写的一个神经网络Vi图
- Logistic回归总结非常好的机器学习总结
- Convex Analysis and Optimization (Bertsekas
- 机器学习个人笔记完整版v5.2-A4打印版
- 基于改进的SOM神经网络在产品配置中
- 深度学习卷积神经网络可检测和分类
- 标量场理论的回归和生成神经网络
- JUNIOR:粒子物理学中无监督机器学习
- 基于ARIMA、BP神经网络与GM的组合模型
- 车辆自适应神经网络编队控制
- 基于RBF神经网络在线辨识的永磁同步
- 语料库.zip
- 基于BP人工神经网络的SmFeN永磁材料工
- 融合粗糙集和人工神经网络的产品敏
- 基于粗糙集神经网络的数据挖掘在门
- Google OCR API源代码和神经网络识别OC
- 中国科学技术大学 研究生课程 机器学
- 遗传算法越野小车unity5.5
- 信息融合、神经网络-模糊推理理论及
- 吴恩达机器学习编程题
- shape_predictor_68_face_landmarks.dat.bz2 68个标
- 机器学习实战高清pdf,中文版+英文版
评论
共有 条评论