Permalink
Browse files

initial A9 shit

  • Loading branch information...
ewaugh
ewaugh committed Dec 7, 2017
1 parent 72eee35 commit 6787d3521465cd2931e18a1dfeb2a1598d147f37
View
BIN A8/A8.pdf
Binary file not shown.
@@ -50,7 +50,6 @@
U = zeros(1,n);
policy = ones(1,n);
Ut = [];
unchanged = 0;
while unchanged == 0
@@ -27,7 +27,6 @@
U = zeros(1,n);
Ut = zeros(1,n);
R = [-0.04,-0.04,-0.04,-0.04, -0.04, 0,-0.04,-1, -0.04,-0.04,-0.04,1];
for i = 1:n
@@ -0,0 +1,23 @@
function [w,per_cor,Se] = ...
CS4300_logistic_learning(X,y,alpha,max_iter,rate)
% CS4300_logistic_learning - find linear separating hyperplane
% Eqn 18.8, p. 727 Russell and Norvig
% On input:
% X (nxm array): n independent variable samples each of length m
% y (nx1 vector): dependent variable samples
% alpha (float): learning rate
% max_iter (int): max number of iterations
% rate (Boolean): 1 use alpha = 1000/(1000+iter) else constant
% alpha
% On output:
% w ((m+1)x1 vector): weights for linear function
% per_cor (kx1 array): trace of percentage correct with weight
% Se (kx1 array): trace of squared error
% Call:
% [w,pc,Se] = CS4300_logistic_learning(X,y,0.1,10000,1);
% Author:
% Eric Waugh and Monish Gupta
% U0947296 and U1008121
% Fall 2017
%
@@ -0,0 +1,21 @@
function [w,per_cor] = ...
CS4300_perceptron_learning(X,y,alpha,max_iter,rate)
% CS4300_perceptron_learning - find linear separating hyperplane
% Eqn 18.7, p. 724 Russell and Norvig
% On input:
% X (nxm array): n independent variable samples each of length m
% y (nx1 vector): dependent variable samples
% alpha (float): learning rate
% max_iter (int): max number of iterations
% rate (Boolean): if 1 then alpha = 1000/(1000+iter), else
% constant
% On output:
% w ((m+1)x1 vector): weights for linear function
% per_cor (kx1 array): trace of percentage correct with weight
% Call:
% [w,pc] = CS4300_perceptron_learning(X,y,0.1,10000,1);
% Author:
% Eric Waugh and Monish Gupta
% U0947296 and U1008121
% Fall 2017

0 comments on commit 6787d35

Please sign in to comment.