• linkedu视频
  • 平面设计
  • 电脑入门
  • 操作系统
  • 办公应用
  • 电脑硬件
  • 动画设计
  • 3D设计
  • 网页设计
  • CAD设计
  • 影音处理
  • 数据库
  • 程序设计
  • 认证考试
  • 信息管理
  • 信息安全
菜单
linkedu.com
导航菜单
  • 网页制作
  • 数据库
  • 程序设计
  • 操作系统
  • CMS教程
  • 游戏攻略
  • 脚本语言
  • 平面设计
  • 软件教程
  • 网络安全
  • 电脑知识
  • 服务器
  • 视频教程
  • windows
  • 服务器硬件
  • 服务器运维
  • 云计算
  • 虚拟化
  • IIS教程
  • Linux
  • Apache
  • Ftp
  • DNS
  • Nginx
您的位置:首页 > 服务器 >云计算 > Deep learning by Andrew Ng,learningandrew

Deep learning by Andrew Ng,learningandrew

作者:网友 字体:[增加 减小] 来源:互联网

本文主要包含deep learning,deep learning 中文版,deep learning pdf,deep learning教程,deeplearning toolbox等服务器相关知识,网友希望可以进行参考

Deep learning by Andrew Ng,learningandrew


Sparse Autoencoder Recap:

Because we used a sigmoid activation function for f(z(3)), we needed to constrain or scale the inputs to be in the range [0,1], since the sigmoid function outputs numbers in the range [0,1].(sparse autoencoder输入层mean 0的原因)。

Linear Decoder:

only in the output layer that we use the linear activation function.
输出不再限制于【0,1】.所以不需要再使输入限制在【0,1】之间。原理就是output层的z不再用simoid方程的偏导进行处理,而是直接将z赋值给a,但是其他hidden layer层不变。

习题答案:

  • linearDecoderExercise.m
%% CS294A/CS294W Linear Decoder Exercise

%  Instructions
%  ------------
% 
%  This file contains code that helps you get started on the
%  linear decoder exericse. For this exercise, you will only need to modify
%  the code in sparseAutoencoderLinearCost.m. You will not need to modify
%  any code in this file.

%%======================================================================
%% STEP 0: Initialization
%  Here we initialize some parameters used for the exercise.

imageChannels = 3;     % number of channels (rgb, so 3)

patchDim   = 8;          % patch dimension
numPatches = 100000;   % number of patches

visibleSize = patchDim * patchDim * imageChannels;  % number of input units 
outputSize  = visibleSize;   % number of output units
hiddenSize  = 400;           % number of hidden units 

sparsityParam = 0.035; % desired average activation of the hidden units.
lambda = 3e-3;         % weight decay parameter       
beta = 5;              % weight of sparsity penalty term       

epsilon = 0.1;         % epsilon for ZCA whitening

%%======================================================================
%% STEP 1: Create and modify sparseAutoencoderLinearCost.m to use a linear decoder,
%          and check gradients
%  You should copy sparseAutoencoderCost.m from your earlier exercise 
%  and rename it to sparseAutoencoderLinearCost.m. 
%  Then you need to rename the function from sparseAutoencoderCost to
%  sparseAutoencoderLinearCost, and modify it so that the sparse autoencoder
%  uses a linear decoder instead. Once that is done, you should check 
% your gradients to verify that they are correct.

% NOTE: Modify sparseAutoencoderCost first!

% To speed up gradient checking, we will use a reduced network and some
% dummy patches

debugHiddenSize = 5;
debugvisibleSize = 8;
patches = rand([8 10]);
theta = initializeParameters(debugHiddenSize, debugvisibleSize); 

[cost, grad] = sparseAutoencoderLinearCost(theta, debugvisibleSize, debugHiddenSize, ...
                                           lambda, sparsityParam, beta, ...
                                           patches);

% Check gradients
numGrad = computeNumericalGradient( @(x) sparseAutoencoderLinearCost(x, debugvisibleSize, debugHiddenSize, ...
                                                  lambda, sparsityParam, beta, ...
                                                  patches), theta);

% Use this to visually compare the gradients side by side
disp([numGrad grad]); 

diff = norm(numGrad-grad)/norm(numGrad+grad);
% Should be small. In our implementation, these values are usually less than 1e-9.
disp(diff); 

assert(diff < 1e-9, 'Difference too large. Check your gradient computation again');

% NOTE: Once your gradients check out, you should run step 0 again to
%       reinitialize the parameters
%}

%%======================================================================
%% STEP 2: Learn features on small patches
%  In this step, you will use your sparse autoencoder (which now uses a 
%  linear decoder) to learn features on small patches sampled from related
%  images.

%% STEP 2a: Load patches
%  In this step, we load 100k patches sampled from the STL10 dataset and
%  visualize them. Note that these patches have been scaled to [0,1]

load stlSampledPatches.mat

displayColorNetwork(patches(:, 1:100));

%% STEP 2b: Apply preprocessing
%  In this sub-step, we preprocess the sampled patches, in particular, 
%  ZCA whitening them. 
% 
%  In a later exercise on convolution and pooling, you will need to replicate 
%  exactly the preprocessing steps you apply t
  


 
分享到:QQ空间新浪微博腾讯微博微信百度贴吧QQ好友复制网址打印

您可能想查找下面的文章:

  • Spark MLlib Deep Learning Convolution Neural Network (深度学习-卷积神经网络)3.3,mllibconvolution
  • Spark MLlib Deep Learning Convolution Neural Network (深度学习-卷积神经网络)3.1,mllibconvolution
  • Spark MLlib Deep Learning Deep Belief Network (深度学习-深度信念网络)2.1,mllibbelief
  • Spark MLlib Deep Learning Deep Belief Network (深度学习-深度信念网络)2.3,mllibbelief
  • Deep learning by Andrew Ng,learningandrew

相关文章

  • openstack中Nova组件Networks的所有python API 汇总,openstacknova
  • 通过 Web Service 调用Pentaho BI 的API,pentahobi
  • shell命令curl抓取网页内容-下载xls文件,
  • UcloudClient,icloud
  • Nodejs课堂笔记-第六课 在DynamoDB中如何创建表,nodejsdynamodb
  • linux screen 使用方法,linuxscreen
  • 微软平台开发技术蓝图,微软平台蓝图
  • Docker exec与Docker attach,dockerexecattach
  • hive之实现列转行,hive列转行
  • H3C config vlan access and trunk links,h3ctrunk

文章分类

  • windows
  • 服务器硬件
  • 服务器运维
  • 云计算
  • 虚拟化
  • IIS教程
  • Linux
  • Apache
  • Ftp
  • DNS
  • Nginx

最近更新的内容

    • 如何选择大数据培训机构,选择数据培训机构
    • 我的hadoop2.4安装过程,hadoop2.4安装过程
    • Cloud Foundry安装部署指南(下),cloudfoundry
    • UcloudClient,icloud
    • 机器学习-统计学习方法概论,学习方法概论
    • [Hive]Hive分区表新增字段,hive分区表新增字段
    • Java服务端限制下载速度,java服务端下载速度
    • HDP 2.2.4 Hue Oozie Editor生成workflow.xml的几点问题,oozieworkflow.xml
    • Storm On Yarn部署,stormonyarn部署
    • 首届中国大数据技术沙龙会议邀请函,首届沙龙

关于我们 - 联系我们 - 免责声明 - 网站地图

©2020-2025 All Rights Reserved. linkedu.com 版权所有