Attachment 'sheet11.m'

Download

   1 function sheet11
   2 
   3 fprintf('loading data...');
   4 X = load('alpha_train_x.txt');
   5 Y = load('alpha_train_y.txt');
   6 
   7 [N, D] = size(X);
   8 
   9 fprintf('%d data points with %d features.\n', N, D);
  10 
  11 P = randperm(N);
  12 
  13 XE = X(P(N/2:end), :);
  14 YE = Y(P(N/2:end), :);
  15 X = X(P(1:N/2), :);
  16 Y = Y(P(1:N/2), :);
  17 
  18 size(X)
  19 size(Y)
  20 size(XE)
  21 size(YE)
  22 
  23 fprintf('training...');
  24 % find reasonable values below!
  25 epochs = ?;
  26 iters = ?;
  27 C = ?;
  28 eta = ?;
  29 C = linsvm_sgd(C, eta, epochs, iters, X, Y, XE, YE);
  30 
  31 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  32 %
  33 % your solution below.
  34 %
  35 %
  36 
  37 % Train a linear SVM with quadratic costs on the slack variables using
  38 % stochastic gradient descent.
  39 %
  40 % Parameters:
  41 %   - eta: base value for eta
  42 %   - epochs: total number of runs through the data.
  43 %   - iters: number of iterations per epoch
  44 %   - X, Y: training data
  45 %   - XE, YE: test data (only for computing the progress)
  46 %
  47 % Plot the test errors on training and test data for each epoch.
  48 function linsvm_sgd(C, eta, epochs, iters, X, Y, XE, YE)
  49 % ...

Attached Files

To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.
  • [get | view] (2009-06-16 13:02:17, 2873.9 KB) [[attachment:bioinf.pdf]]
  • [get | view] (2009-06-09 09:46:52, 209.6 KB) [[attachment:data.tar.gz]]
  • [get | view] (2009-05-26 09:12:28, 3099.4 KB) [[attachment:intrusion.pdf]]
  • [get | view] (2009-06-02 09:30:50, 1391.7 KB) [[attachment:kld-tutorial.pdf]]
  • [get | view] (2009-07-07 09:31:30, 1506.0 KB) [[attachment:largescale.pdf]]
  • [get | view] (2009-07-07 09:34:04, 192.5 KB) [[attachment:optim-intro.pdf]]
  • [get | view] (2009-05-05 08:16:16, 261.1 KB) [[attachment:recap2.pdf]]
  • [get | view] (2009-04-21 08:42:30, 66.5 KB) [[attachment:sheet01.pdf]]
  • [get | view] (2009-04-28 14:08:19, 1.0 KB) [[attachment:sheet02.m]]
  • [get | view] (2009-04-28 14:08:14, 62.8 KB) [[attachment:sheet02.pdf]]
  • [get | view] (2009-05-05 08:17:47, 0.6 KB) [[attachment:sheet03.m]]
  • [get | view] (2009-05-05 08:22:37, 90.9 KB) [[attachment:sheet03.pdf]]
  • [get | view] (2009-05-12 15:17:16, 1.9 KB) [[attachment:sheet04.m]]
  • [get | view] (2009-05-19 09:18:26, 110.6 KB) [[attachment:sheet04.pdf]]
  • [get | view] (2009-05-19 09:05:24, 63.6 KB) [[attachment:sheet05.pdf]]
  • [get | view] (2009-05-26 09:39:01, 4.4 KB) [[attachment:sheet06.m]]
  • [get | view] (2009-05-26 09:38:57, 84.0 KB) [[attachment:sheet06.pdf]]
  • [get | view] (2009-06-02 09:30:26, 0.9 KB) [[attachment:sheet07.m]]
  • [get | view] (2009-06-02 09:30:21, 72.2 KB) [[attachment:sheet07.pdf]]
  • [get | view] (2009-06-09 09:46:48, 2.2 KB) [[attachment:sheet08.m]]
  • [get | view] (2009-06-09 11:10:06, 60.3 KB) [[attachment:sheet08.pdf]]
  • [get | view] (2009-06-09 11:10:02, 2.3 KB) [[attachment:sheet08.py]]
  • [get | view] (2009-06-16 13:02:05, 122.2 KB) [[attachment:sheet09.pdf]]
  • [get | view] (2009-06-23 12:50:29, 1.1 KB) [[attachment:sheet10.m]]
  • [get | view] (2009-06-23 12:48:35, 77.4 KB) [[attachment:sheet10.pdf]]
  • [get | view] (2009-06-23 12:49:27, 5.8 KB) [[attachment:sheet10.tex]]
  • [get | view] (2009-07-07 13:55:57, 1.0 KB) [[attachment:sheet11.m]]
  • [get | view] (2009-07-07 13:58:20, 81.3 KB) [[attachment:sheet11.pdf]]
  • [get | view] (2009-06-23 12:48:40, 58.4 KB) [[attachment:splice.zip]]
  • [get | view] (2009-05-25 08:18:18, 591.1 KB) [[attachment:ssl2.pdf]]
  • [get | view] (2009-05-19 09:05:38, 614.6 KB) [[attachment:structured2.pdf]]
  • [get | view] (2009-05-26 09:39:05, 1217.5 KB) [[attachment:stud-data.mat.gz]]
  • [get | view] (2009-06-08 17:46:34, 1013.6 KB) [[attachment:textmining.pdf]]
 All files | Selected Files: delete move to page copy to page

You are not allowed to attach a file to this page.