[P] Artificial Neural Networks and prediction (Scilab)
I have ANN Toolbox for Scilab and some script which I do not understand completely. I studied that at least 8 years ago but don’t remember much. What I need is help understanding the script and making few changes to it. The main thing I would like to see is correct chart for the computations. The code:
clear clc // data X = [1.00 2.00 3.00 2.00 3.00 4.00 3.00 4.00 5.00 4.00 5.00 6.00 5.00 6.00 7.00 6.00 7.00 8.00]; // libraries exec("ann_FF_init.sci"); exec("ann_FF_Mom_online.sci"); exec("ann_d_sum_of_sqr.sci"); exec("ann_d_log_activ.sci"); exec("ann_FF_run.sci"); exec("ann_log_activ.sci"); // k - predicition range? k=2; // data rows and cols count [rows,cols]=size(X); // normalize the learning data - what it does? makes values in range from 0.00 to 1.00? for i=1:cols X(:,i)=X(:,i)/sqrt(X(:,i)'*X(:,i)); end; // learning series, pair <U,Z>, automatic conversion of X which is a column - what happens here? U=; Z=; for i=1:rows-k-1 U=[U X(i:i+k-1)]; Z=[Z X(i+k)]; end; // NN structure [in_count, pattern_count]=size(X); [out_count, pattern_count]=size(Z); // neurons count in layers N=[in_count 10 7 out_count]; r=[0,1]; rb=[0,1]; // initialize W=ann_FF_init(N,r,rb); // learning parameters lp=[0.1 0.05 0.5 0.1]; lp=[0.1 0.05 0.5 0.1]; // epochs count T=12000; 500 for testing epochs=500; // learning; X/x = training, Z/t = output, N = architecture, W = init weights, lp = learning rate, epochs/T = iterations [W,sW]=ann_FF_Mom_online(X,Z,N,W,lp,epochs); // full run Y=ann_FF_run(X,N,W); // show data - which are what? //Z' //disp(Y); //(Y-Z)' // plot data - how to plot input? how to plot prediction correctly? //plot(X); //plot(Y,"r"); //plot(Z);
The questions I have given in the code. Can anyone explain me the script?
submitted by /u/discl0se