人工神经网络与机器学习 第三版 课后答案 上课PPT 课后上机实验代码


这里有人工神经网络与机器学习的课后答案、上机实验程序、课后PPT等等,还有一些乱七八杂的。
资源截图
代码片段和文件信息
function [XYXt]=generate_two_moons(rwdNseeddisplay)
% GENERATE_TWO_MOONS 
% INPUTS:
% r: radius of 2 moons
% w: width of the 2 moons
% d: distance between the two moons
% N: number of samples to generate in each moon
% display: 1 shows the 2moons after generation 0 no display
%
% OUTPUTS:
% X: 2N X 2 matrix 
% Y: 2N X 1 vector -- +1 for top moon -1 for bottom moon
% Xt: uniformly spaced points on a grid
%
% Vikas Sindhwani (vikass@cs.uchicago.edu)


% top moon
rand(‘seed‘seed);
r = r+w/2;

% randomly pick radial coordinate between r-w and r 
R=(r-w)*ones(N1) + rand(N1)*w;
% randomly pick the angular coordinate
theta=rand(N1)*pi;

X=[R.*cos(theta) R.*sin(theta)];
Y=ones(N1);

% bottom moon

% randomly pick radial coordinate between r-w and r 
R=(r-w)*ones(N1) + rand(N1)*w;
% randomly pick the angular coordinate
theta=pi+rand(N1)*pi;

% move x coordinate by y coordinate down by d
del_x=r-(w/2);
del_y=-d;
x=[R.*cos(theta)+del_x R.*sin(theta)+del_y]
y=-ones(N1);

X=[X;x];
Y=[Y;y];

r=r-w/2;

if display==1
   plot(X(Y==11)X(Y==12)‘r+‘‘MarkerSize‘8); hold on;
   plot(X(Y==-11)X(Y==-12)‘bx‘‘MarkerSize‘8); 
   axis tight;
   axis equal;
   title([‘2 moons dataset : r=‘ num2str(r) ...
       ‘ w=‘ num2str(w) ‘ d=‘ num2str(d) ‘ N=‘ num2str(N)]);
end

 xmin=min(X(:1)); 
 xmax=max(X(:1)); 
 ymin=min(X(:2)); 
 ymax=max(X(:2));
 
[xy] = meshgrid(xmin:(xmax-xmin)/50:xmaxymin:(ymax-ymin)/50:ymax);
Xt=[reshape(xprod(size(x))1) reshape(yprod(size(y))1)];

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件举报,一经查实,本站将立刻删除。

发表评论

评论列表(条)