Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Carlos Mejia
2S-SOM_versionCM
Commits
82d577be
Commit
82d577be
authored
Dec 18, 2018
by
Carlos Mejia
Browse files
Adding radius and trainlen control to 2S-SOM Loop (when calling batchtrainRTOM)
parent
e019140b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
17 deletions
+30
-17
Code-2S-SOM/learn_2s_som.m
Code-2S-SOM/learn_2s_som.m
+30
-17
No files found.
Code-2S-SOM/learn_2s_som.m
View file @
82d577be
...
...
@@ -51,17 +51,20 @@ function [sMap sMap_denorm Result] = learn_2s_som(A,nb_neurone,varargin)
tracking
=
0
;
init
=
'lininit'
;
lattice
=
'rect'
;
bool_verbose
=
false
;
bool_norm
=
false
;
bool_rad
=
false
;
bool_trainlen
=
false
;
bool_2ssom
=
false
;
bool_DimData
=
false
;
bool_lambda
=
false
;
bool_eta
=
false
;
% flags et variables associees
bool_verbose
=
false
;
bool_norm
=
false
;
type_norm
=
'simple'
bool_rad
=
false
;
rad
=
[
5
1
];
bool_trainlen
=
false
;
trlen
=
20
;
bool_rad_2s_som
=
false
;
rad_2s_som
=
[];
bool_trlen_2s_som
=
false
;
trlen_2s_som
=
[];
bool_2ssom
=
false
;
bool_DimData
=
false
;
DimBloc
=
[];
bool_lambda
=
false
;
lambda
=
1
;
bool_eta
=
false
;
eta
=
1000
;
Result
=
[];
Result
=
[];
bool_init_with_make
=
true
;
bool_pre_training
=
true
;
...
...
@@ -105,6 +108,12 @@ function [sMap sMap_denorm Result] = learn_2s_som(A,nb_neurone,varargin)
case
'trainlen'
bool_trainlen
=
true
;
trlen
=
varargin
{
i
+
1
};
i
=
i
+
1
;
case
'radius-2s-som'
bool_rad_2s_som
=
true
;
rad_2s_som
=
varargin
{
i
+
1
};
i
=
i
+
1
;
case
'trainlen-2s-som'
bool_trlen_2s_som
=
true
;
trlen_2s_som
=
varargin
{
i
+
1
};
i
=
i
+
1
;
case
'S2-SOM'
disp
(
'** S2-SOM Active **'
);
bool_2ssom
=
true
;
...
...
@@ -366,16 +375,20 @@ function [sMap sMap_denorm Result] = learn_2s_som(A,nb_neurone,varargin)
i_train
=
1
;
n_train
=
length
(
lambda
)
*
length
(
eta
);
radius_2s_som
=
[
rad
(
round
(
length
(
rad
)/
2
))
...
rad
((
round
(
length
(
rad
)/
2
))
+
1
)];
trainlen_2s_som
=
trlen
(
round
(
length
(
trlen
)/
2
));
if
~
bool_rad_2s_som
rad_2s_som
=
[
rad
(
round
(
length
(
rad
)/
2
))
...
rad
((
round
(
length
(
rad
)/
2
))
+
1
)];
end
if
~
bool_trlen_2s_som
trlen_2s_som
=
trlen
(
round
(
length
(
trlen
)/
2
));
end
fprintf
(
1
,[
'\n-- batchtrainRTOM loop for %d lambda and %d eta values:\n'
,
...
'-- ------------------------------------------------------------------\n'
],
...
length
(
lambda
),
length
(
eta
));
if
tracking
>
1
,
fprintf
(
1
,
' ... trainlen_2s_som ... %s\n'
,
num2str
(
tr
ain
len_2s_som
))
fprintf
(
1
,
' ... radius_2s_som ..... [%s]\n'
,
join
(
string
(
rad
ius
_2s_som
),
', '
))
fprintf
(
1
,
' ... trainlen_2s_som ... %s\n'
,
num2str
(
trlen_2s_som
))
fprintf
(
1
,
' ... radius_2s_som ..... [%s]\n'
,
join
(
string
(
rad_2s_som
),
', '
))
end
for
i
=
1
:
length
(
lambda
)
for
j
=
1
:
length
(
eta
)
...
...
@@ -390,8 +403,8 @@ function [sMap sMap_denorm Result] = learn_2s_som(A,nb_neurone,varargin)
'DimBloc'
,
DimBloc
,
...
'lambda'
,
lambda
(
i
),
...
'eta'
,
eta
(
j
),
...
'radius'
,
rad
ius
_2s_som
,
...
'trainlen'
,
tr
ain
len_2s_som
,
...
'radius'
,
rad_2s_som
,
...
'trainlen'
,
trlen_2s_som
,
...
'tracking'
,
tracking
);
current_perf
=
som_distortion
(
Result
(
i
,
j
)
.
sMap
,
sD_norm
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment