Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
dcdb
dcdb
Commits
4dbecd1e
Commit
4dbecd1e
authored
Oct 19, 2020
by
Alessio Netti
Browse files
Analytics: minor fixes to CS plugin
parent
01b3bb8f
Changes
1
Hide whitespace changes
Inline
Side-by-side
analytics/operators/cssignatures/CSOperator.cpp
View file @
4dbecd1e
...
...
@@ -82,7 +82,7 @@ void CSOperator::execOnInit() {
_trainingUnit
=
_units
[
0
]
->
getName
();
_actualBlocks
=
_units
[
0
]
->
getInputs
().
size
()
<
_numBlocks
?
_units
[
0
]
->
getInputs
().
size
()
:
_numBlocks
;
if
(
_actualBlocks
!=
_numBlocks
)
LOG
(
warning
)
<<
"Operator "
<<
_name
<<
": cannot enforce "
<<
_numBlocks
<<
", using "
<<
_actualBlocks
<<
" instead."
;
LOG
(
warning
)
<<
"Operator "
<<
_name
<<
": cannot enforce "
<<
_numBlocks
<<
"
blocks
, using "
<<
_actualBlocks
<<
" instead."
;
}
else
{
_actualBlocks
=
_numBlocks
;
}
...
...
@@ -164,9 +164,9 @@ bool CSOperator::dumpToFile(std::string &path) {
// Saving CS data in terms of permutation index, minimum and maximum for each input sensor
for
(
size_t
idx
=
0
;
idx
<
_permVector
.
size
();
idx
++
)
{
boost
::
property_tree
::
ptree
group
;
group
.
push_back
(
boost
::
property_tree
::
ptree
::
value_type
(
"idx"
,
std
::
to_string
(
_permVector
[
idx
])));
group
.
push_back
(
boost
::
property_tree
::
ptree
::
value_type
(
"min"
,
std
::
to_string
(
_min
[
idx
])));
group
.
push_back
(
boost
::
property_tree
::
ptree
::
value_type
(
"max"
,
std
::
to_string
(
_max
[
idx
])));
group
.
push_back
(
boost
::
property_tree
::
ptree
::
value_type
(
"idx"
,
boost
::
property_tree
::
ptree
(
std
::
to_string
(
_permVector
[
idx
])))
)
;
group
.
push_back
(
boost
::
property_tree
::
ptree
::
value_type
(
"min"
,
boost
::
property_tree
::
ptree
(
std
::
to_string
(
_min
[
idx
])))
)
;
group
.
push_back
(
boost
::
property_tree
::
ptree
::
value_type
(
"max"
,
boost
::
property_tree
::
ptree
(
std
::
to_string
(
_max
[
idx
])))
)
;
blocks
.
add_child
(
std
::
to_string
(
idx
),
group
);
}
root
.
add_child
(
std
::
to_string
(
_permVector
.
size
()),
blocks
);
...
...
@@ -324,7 +324,7 @@ void CSOperator::computeMinMax(std::vector<std::vector<reading_t>>& v) {
for
(
const
auto
&
s
:
v
[
idx
])
{
if
(
s
.
value
>
max
)
max
=
s
.
value
;
else
if
(
s
.
value
<
min
)
if
(
s
.
value
<
min
)
min
=
s
.
value
;
}
}
else
{
...
...
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