/usr/lib/scilab-ann/demos/enc838_m.sci is in scilab-ann 0.4.2.4-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 | // Tight 8-3-8 encoder
// on a backpropagation ANN with biases and momentum
rand('seed',0);
// network def.
// - neurons per layer, including input
N = [8,3,8];
// inputs
x = [1,0,0,0,0,0,0,0;
0,1,0,0,0,0,0,0;
0,0,1,0,0,0,0,0;
0,0,0,1,0,0,0,0;
0,0,0,0,1,0,0,0;
0,0,0,0,0,1,0,0;
0,0,0,0,0,0,1,0;
0,0,0,0,0,0,0,1]';
// targets, at training stage is acts as identity network
t = x;
// learning parameter
lp = [1.5, 0.07, 0.8, 0.1];
// init randomize weights between:
r = [-10,15];
rb = r;
W = ann_FF_init(N,r,rb);
Delta_W_old = hypermat(size(W)');
// 500 epochs are enough to ilustrate
T = 500;
[W,Delta_W_old] = ann_FF_Mom_online(x,t,N,W,lp,T,Delta_W_old);
// full run
ann_FF_run(x,N,W)
// encoder
encoder = ann_FF_run(x,N,W,[2,2])
// decoder
decoder = ann_FF_run(encoder,N,W,[3,3])
|