吴恩达机器学习公开课资料


吴恩达机器学习公开课资料
资源截图
代码片段和文件信息
% BOOSTING_EXAMPLE
%
% Constructs a 2-dimensional dataset classifiable by boosting but not any
% simple linear classifier because of the thresholding nature of the data.

rand(‘seed‘ 0);

% m datapoints in 2-dimensions
mm = 150;
X = rand(mm 2);

thresh_pos = .6;
y = [X(: 1) < thresh_pos & X(: 2) < thresh_pos];
y = 2 * y - 1;

for T = [2 4 5 10]
  figure;
  hpos = plot(X(y == 1 1) X(y == 1 2) ‘o‘);
  hold on;
  hneg = plot(X(y == -1 1) X(y == -1 2) ‘x‘);
  set(hpos ‘linewidth‘ 2);
  set(hneg ‘linewidth‘ 2);

  [theta feature_inds thresholds] = stump_booster(X y T);

  x1_coords = linspace(0 1 100);
  x2_coords = linspace(0 1 100);
  Z = zeros(100);
  for ii = 1:100
    for jj = 1:100
      pred = (sign(x1_coords(ii) - thresholds(feature_inds == 1))‘ * ...
              theta(feature_inds == 1)) + ...
             (sign(x2_coords(jj) - thresholds(feature_inds == 2))‘ * ...
              theta(feature_inds == 2));
      Z(jj ii) = sign(pred);
    end
  end

  C = contourc(x1_coords x2_coords Z [0 0]);
  h = plot(C(1 2:end) C(2 2:end) ‘k-‘);
  set(h ‘linewidth‘ 2);
  title(sprintf(‘Iterations = %d‘ T));
  set(gca ‘fontsize‘ 18);
  print(‘-depsc2‘ sprintf(‘boost_plot_%d.eps‘ T));
end

%% Now solve the logistic regression problem directly

mm = 200;
X = rand(mm 2);
y = [X(: 1) < thresh_pos & X(: 2) < thresh_pos];
y = 2 * y - 1;

theta_log = zeros(3 1);
X_logit = [ones(mm 1) X];
for iter = 1:1000
  risk = (1/mm) * sum(log(1 + exp(-y .* (X_logit * theta_log))));
  if (mod(iter 50) == 0)
    fprintf(1 ‘Iter %d loss %1.4f
‘ iter risk);
  end
  p = 1 ./ (1 + exp(y .* (X_logit * theta_log)));
  g = -(1/mm) * X_logit‘ * (p .* y);
  theta_log = theta_log - 2 * g;
end

x1_coord = linspace(0 1 100);
x2_coord = -(theta_log(1) + theta_log(2) * x1_coord) / theta_log(3);

figure;
hpos = plot(X(y == 1 1) X(y == 1 2) ‘o‘);
hold on;
hneg = plot(X(y == -1 1) X(y == -1 2) ‘x‘);
set(hpos ‘linewidth‘ 2);
set(hneg ‘linewidth‘ 2);
h = plot(x1_coord x2_coord ‘k-‘ ‘linewidth‘ 2);
axis([0 1 0 1]);
set(gca ‘fontsize‘ 18);
print -depsc2 ‘logistic_plot.eps‘;

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件    1036360  2018-08-03 15:18  吴恩达机器学习公开课资料1412.6572.pdf

     文件     128864  2018-08-03 15:19  吴恩达机器学习公开课资料oosting.pdf

     文件       2136  2018-08-03 15:20  吴恩达机器学习公开课资料oosting_example.m

     文件     168829  2018-08-03 15:22  吴恩达机器学习公开课资料cs229-cvxopt (1).pdf

     文件     168829  2018-08-03 14:57  吴恩达机器学习公开课资料cs229-cvxopt.pdf

     文件     203872  2018-08-03 15:22  吴恩达机器学习公开课资料cs229-cvxopt2 (1).pdf

     文件     203872  2018-08-03 14:58  吴恩达机器学习公开课资料cs229-cvxopt2.pdf

     文件     163887  2018-08-03 15:23  吴恩达机器学习公开课资料cs229-gaussian_processes.pdf

     文件     202549  2018-08-03 15:23  吴恩达机器学习公开课资料cs229-hmm.pdf

     文件     205269  2018-08-03 15:21  吴恩达机器学习公开课资料cs229-linalg (1).pdf

     文件     205269  2018-08-03 14:50  吴恩达机器学习公开课资料cs229-linalg.pdf

     文件     151564  2018-08-03 14:58  吴恩达机器学习公开课资料cs229-notes-backprop.pdf

     文件     340539  2018-08-03 14:58  吴恩达机器学习公开课资料cs229-notes-deep_learning.pdf

     文件     233824  2018-08-03 14:48  吴恩达机器学习公开课资料cs229-notes1.pdf

     文件     751477  2018-08-03 14:41  吴恩达机器学习公开课资料cs229-notes1.ps

     文件      72012  2018-08-03 15:01  吴恩达机器学习公开课资料cs229-notes10.pdf

     文件     342393  2018-08-03 14:45  吴恩达机器学习公开课资料cs229-notes10.ps

     文件      78012  2018-08-03 15:01  吴恩达机器学习公开课资料cs229-notes11.pdf

     文件     363284  2018-08-03 14:45  吴恩达机器学习公开课资料cs229-notes11.ps

     文件     170639  2018-08-03 15:02  吴恩达机器学习公开课资料cs229-notes12.pdf

     文件     558166  2018-08-03 14:45  吴恩达机器学习公开课资料cs229-notes12.ps

     文件     231186  2018-08-03 15:02  吴恩达机器学习公开课资料cs229-notes13.pdf

     文件     881990  2018-08-03 14:52  吴恩达机器学习公开课资料cs229-notes2.pdf

     文件    4642639  2018-08-03 14:44  吴恩达机器学习公开课资料cs229-notes2.ps

     文件     193344  2018-08-03 14:53  吴恩达机器学习公开课资料cs229-notes3.pdf

     文件     578275  2018-08-03 14:44  吴恩达机器学习公开课资料cs229-notes3.ps

     文件     112922  2018-08-03 14:56  吴恩达机器学习公开课资料cs229-notes4.pdf

     文件     446579  2018-08-03 14:44  吴恩达机器学习公开课资料cs229-notes4.ps

     文件      89353  2018-08-03 14:56  吴恩达机器学习公开课资料cs229-notes5.pdf

     文件     370078  2018-08-03 14:44  吴恩达机器学习公开课资料cs229-notes5.ps

............此处省略37个文件信息

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

发表评论

评论列表(条)