All pastes #255427 Raw Edit

Anonymous

public text v1 · immutable
#255427 ·published 2006-11-22 23:29 UTC
rendered paste body
u = 0.9;
aX = zeros(2000, 1);
aY = zeros(2000, 1);
X = zeros(2000, 1);
Y = zeros(2000, 1);
X(1) = 0.3;
Y(1) = 0.3;
for i=2:2000
    x = X(i - 1);
    y = Y(i - 1);
    t = 0.4 - 6 / (1 + x.^2 + y.^2);
    X(i) = 1 + u * (x * cos(t) - y * sin(t));
    Y(i) = u * (x * sin(t) + y * cos(t));
end

for i=1:1500
    aX(i) = X(i+1);
    aY(i) = Y(i+1);
end

p = [X Y]';
t = [aX aY]';

net = newff([-1 1; -1 1],[15,15,15,2],{'tansig','tansig','tansig','purelin'});
net = init(net);

net.trainParam.show = 50;
net.trainParam.epochs = 300;
net.trainParam.goal = 1e-5;

[net,tr]=train(net,p,t);