当前位置: 首页 > news >正文

有专门学做衣服网站有哪些学做饼干的网站

有专门学做衣服网站有哪些,学做饼干的网站,温州微网站制作公司推荐,新浪网 网站建设自然图片的PCA白化 在这个练习里面我们将实现PCA和ZCA白化。首先先下载这个文件pca_exercise.zip, 然后我们解压它#xff0c;并用matlab打开它#xff0c;我们只需要更改pca_gen.m.这个文件。 然后把代码改成下面这个形式 %% %% Step 0a: Load data % Here we provide th…自然图片的PCA白化 在这个练习里面我们将实现PCA和ZCA白化。首先先下载这个文件pca_exercise.zip, 然后我们解压它并用matlab打开它我们只需要更改pca_gen.m.这个文件。 然后把代码改成下面这个形式 %% %% Step 0a: Load data % Here we provide the code to load natural image data into x. % x will be a 144 * 10000 matrix, where the kth column x(:, k) corresponds to % the raw image data from the kth 12x12 image patch sampled. % You do not need to change the code below.x sampleIMAGESRAW(); figure(name,Raw images); randsel randi(size(x,2),200,1); % A random selection of samples for visualization display_network(x(:,randsel));%% %% Step 0b: Zero-mean the data (by row) % You can make use of the mean and repmat/bsxfun functions.% -------------------- YOUR CODE HERE -------------------- xx-repmat(mean(x),size(x,1),1); %% %% Step 1a: Implement PCA to obtain xRot % Implement PCA to obtain xRot, the matrix in which the data is expressed % with respect to the eigenbasis of sigma, which is the matrix U.% -------------------- YOUR CODE HERE -------------------- xRot zeros(size(x)); % You need to compute this [u,s,v]svd(x); xRotu*x;%% %% Step 1b: Check your implementation of PCA % The covariance matrix for the data expressed with respect to the basis U % should be a diagonal matrix with non-zero entries only along the main % diagonal. We will verify this here. % Write code to compute the covariance matrix, covar. % When visualised as an image, you should see a straight line across the % diagonal (non-zero entries) against a blue background (zero entries).% -------------------- YOUR CODE HERE -------------------- covar zeros(size(x, 1)); % You need to compute this covarx*x./size(x,2); % Visualise the covariance matrix. You should see a line across the % diagonal against a blue background. figure(name,Visualisation of covariance matrix); imagesc(covar);%% %% Step 2: Find k, the number of components to retain % Write code to determine k, the number of components to retain in order % to retain at least 99% of the variance.% -------------------- YOUR CODE HERE -------------------- k 0; % Set k accordingly [m,n]size(s); resdiag(s)*fliplr(tril(ones(m),0)) tmpfind(res res(m)*0.01); klength(tmp); %% %% Step 3: Implement PCA with dimension reduction % Now that you have found k, you can reduce the dimension of the data by % discarding the remaining dimensions. In this way, you can represent the % data in k dimensions instead of the original 144, which will save you % computational time when running learning algorithms on the reduced % representation. % % Following the dimension reduction, invert the PCA transformation to produce % the matrix xHat, the dimension-reduced data with respect to the original basis. % Visualise the data and compare it to the raw data. You will observe that % there is little loss due to throwing away the principal components that % correspond to dimensions with low variation.% -------------------- YOUR CODE HERE -------------------- xHat zeros(size(x)); % You need to compute this xRot zeros(size(x)); xRotu(:,1:k)*x; xHat(1:k,:)xRot(1:k,:); xHatu*xHat;% Visualise the data, and compare it to the raw data % You should observe that the raw and processed data are of comparable quality. % For comparison, you may wish to generate a PCA reduced image which % retains only 90% of the variance.figure(name,[PCA processed images ,sprintf((%d / %d dimensions), k, size(x, 1)),]); display_network(xHat(:,randsel)); figure(name,Raw images); display_network(x(:,randsel));%% %% Step 4a: Implement PCA with whitening and regularisation % Implement PCA with whitening and regularisation to produce the matrix % xPCAWhite. epsilon 0.1; xPCAWhite zeros(size(x)); xPCAWhite diag(1./sqrt(diag(s(:,1:k))epsilon))*xRot; % -------------------- YOUR CODE HERE -------------------- %% %% Step 4b: Check your implementation of PCA whitening % Check your implementation of PCA whitening with and without regularisation. % PCA whitening without regularisation results a covariance matrix % that is equal to the identity matrix. PCA whitening with regularisation % results in a covariance matrix with diagonal entries starting close to % 1 and gradually becoming smaller. We will verify these properties here. % Write code to compute the covariance matrix, covar. % % Without regularisation (set epsilon to 0 or close to 0), % when visualised as an image, you should see a red line across the % diagonal (one entries) against a blue background (zero entries). % With regularisation, you should see a red line that slowly turns % blue across the diagonal, corresponding to the one entries slowly % becoming smaller.% -------------------- YOUR CODE HERE -------------------- % Visualise the covariance matrix. You should see a red line across the % diagonal against a blue background. figure(name,Visualisation of covariance matrix); imagesc(covar);%% %% Step 5: Implement ZCA whitening % Now implement ZCA whitening to produce the matrix xZCAWhite. % Visualise the data and compare it to the raw data. You should observe % that whitening results in, among other things, enhanced edges.xZCAWhite zeros(size(x));% -------------------- YOUR CODE HERE -------------------- xZCAWhite u(:,1:k)*xPCAWhite; % Visualise the data, and compare it to the raw data. % You should observe that the whitened images have enhanced edges. figure(name,ZCA whitened images); display_network(xZCAWhite(:,randsel)); figure(name,Raw images); display_network(x(:,randsel));接下是几幅图片
http://www.pierceye.com/news/181127/

相关文章:

  • 中国专业的网站建设知乎wordpress
  • 广州网站设计公司兴田德润活动这是我做的网站吗
  • html5做网站一线全屋定制10大品牌
  • 广州百度网站建设公司wordpress免费媒体库管理
  • 郑州网站建设炉石在线a视频网站一级a做片
  • 网站越来越难做做杂志的模板下载网站有哪些
  • 怎么做化妆品网站内容规划免费做网站的网页
  • seo站外优化平台网站建设程序流程
  • 凡科轻站官网做个简单的企业小网站
  • 动漫做h免费网站有哪些系统开发是做什么的
  • 企业做网站流程全国地推公司排名
  • 揭阳新闻最新消息常用的seo工具推荐
  • 网站方案策划中国最大的博客网站
  • 网站建设加空间食品包装设计ppt
  • 搭建一个网站 优帮云张家口远大建设集团网站
  • wordpress本地视频播放器苏州谷歌seo
  • 银川网站建设有哪些16岁做分期网站
  • 制作网站对话框火车票网站建设多少
  • 怎么问客户做不做网站设计一个简单的广告
  • 佛山 网站关键词优化trel域名
  • 哪家网站建设好大连房产网
  • 企业做推广哪些网站比较好兰州有做百度网站的吗
  • 网站建设和管理规则自己建网站的流程
  • 网站的前期推广广州网站建设加盟
  • 网站灰色 代码深圳的深圳的网站建设公司
  • 做电影采集网站需要多大vps安徽建设新工程信息网站
  • 中小企业网站制作化工厂网站建设
  • 电子政务网站建设出版社百度网页提交入口
  • 专业柳州网站建设哪家便宜淄博桓台网站建设定制
  • 网站建设投标标书企业网站建设销售前景