-
Notifications
You must be signed in to change notification settings - Fork 0
/
grossberg.conf
87 lines (68 loc) · 2.59 KB
/
grossberg.conf
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
% true oznaczałoby losowanie wag dla neuronów, weights jest wtedy ignorowane
random_weights = true;
% dane wejściowe
input_data = [
1 1 1 0 0 0 0 0 0;
0 0 0 1 1 1 0 0 0;
0 0 0 0 0 0 1 1 1;
1 0 0 1 0 0 1 0 0;
0 1 0 0 1 0 0 1 0;
0 0 1 0 0 1 0 0 1;
1 0 0 0 0 0 0 0 0;
0 0 0 0 0 0 0 0 1;
0 0 1 0 1 0 1 0 0;
];
expected = [
1 0 0;
1 0 0;
1 0 0;
0 1 0;
0 1 0;
0 1 0;
0 0 1;
0 0 1;
0 0 1;
];
%global epochs = [1 8000 16000 24000]
global layers = {};
learn_steps = 10000;
% pierwsza warstwa
% liczba neuronów w warstwie
layers{1}.type='kohonen';
layers{1}.neurons = 9;
layers{1}.row_count = 1;
% funkcja aktywacji
layers{1}.activation_function =@(X) sigmoid(X);
% wartość bias
layers{1}.bias = 0;
% przedział, z którego są losowane wagi
layers{1}.rand_min = -1.0;
layers{1}.rand_max = 1.0;
layers{1}.neighbourhood_width = [0 0 0 0 0];%[7.0 5.0 3.0 1.0];
layers{1}.conscience_coefficient = [1.0 0.5 0.25 0.125 0]; %[0 0 0 0];%
layers{1}.learning_coefficient = [0.06 0.03 0.015 0.0075 0];
layers{1}.learn = true;
layers{1}.random_weights = true;
layers{1}.weights = [0.9746088 0.6969666 0.7322416 -0.6771279 0.2077822 0.9740011 -0.7472979 -0.1011296 -0.5120499 -0.0876053;
0.7576958 0.4246126 -0.0103857 0.9560081 0.2292163 0.0424290 -0.9320392 0.9851484 -0.9298358 0.5258510;
0.0054430 -0.9519101 0.2446065 0.5692466 0.8223106 0.5376411 0.7851723 0.6604336 -0.9124292 0.4518019;
-0.1669319 -0.2452196 0.6550497 -0.7913123 0.7743242 -0.1695199 0.1760520 -0.9078714 0.7994041 0.8622987;
0.2897925 0.0215888 0.7536550 0.5732586 -0.7247909 0.4500806 0.6996162 -0.4742860 0.7249293 0.9737810;
-0.0946207 -0.3548946 0.0028543 -0.3367118 0.2768645 -0.0349370 -0.6861820 0.9402029 0.8403788 0.7062659;
-0.5128018 0.9135842 0.6764165 0.6463172 0.3561881 -0.0219371 0.5133370 -0.0237980 -0.9790999 -0.2907691;
0.1799878 0.2019274 -0.7217509 -0.2709379 0.7752287 -0.3626045 -0.2701657 0.8085669 0.7448796 -0.8409742;
-0.2007081 -0.4168636 -0.1575188 -0.3084180 0.7120755 0.0033763 -0.1034657 -0.3460517 -0.1063193 0.7367478;
]
layers{1}.epochs = [1 1000 2000 2500 3000];
layers{2}.type='grossberg';
layers{2}.neurons=3;
layers{2}.bias = 0;
layers{2}.rand_min = -1.0;
layers{2}.rand_max = 1.0;
layers{2}.activation_function = @(X) linear(X,1,0);
layers{2}.epochs = [3000 10000 15000 20000];
layers{2}.coeffs = [0.06 0.03 0.02 0.01];%[0.8 0.5 0.3 0.1];
layers{2}.epoch=0;
layers{2}.random_weights = true;
layers{2}.rule = 'delta'; %'widrow';
layers{2}.learn = true;