Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
bob.pad.base
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
5
Issues
5
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
bob
bob.pad.base
Commits
ef993dd2
Commit
ef993dd2
authored
Oct 02, 2018
by
Amir MOHAMMADI
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
convert features to float64 before using them in SVM
parent
3e83cf9a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
4 deletions
+6
-4
bob/pad/base/algorithm/SVM.py
bob/pad/base/algorithm/SVM.py
+2
-0
bob/pad/base/utils/helper_functions.py
bob/pad/base/utils/helper_functions.py
+4
-4
No files found.
bob/pad/base/algorithm/SVM.py
View file @
ef993dd2
...
...
@@ -477,6 +477,8 @@ class SVM(Algorithm):
features_array
=
feature
features_array
=
features_array
.
astype
(
'float64'
)
if
not
(
self
.
machine_type
==
'ONE_CLASS'
):
# two-class SVM case
probabilities
=
self
.
machine
.
predict_class_and_probabilities
(
...
...
bob/pad/base/utils/helper_functions.py
View file @
ef993dd2
...
...
@@ -66,9 +66,9 @@ def convert_and_prepare_features(features):
if
isinstance
(
features
[
0
],
bob
.
bio
.
video
.
FrameContainer
):
# if FrameContainer convert to 2D numpy array
return
convert_list_of_frame_cont_to_array
(
features
)
return
convert_list_of_frame_cont_to_array
(
features
)
.
astype
(
'float64'
)
else
:
return
np
.
vstack
(
features
)
return
np
.
vstack
(
features
)
.
astype
(
'float64'
)
def
convert_list_of_frame_cont_to_array
(
frame_containers
):
...
...
@@ -273,9 +273,9 @@ def mean_std_normalize(features,
features_mean
=
np
.
mean
(
features
,
axis
=
0
)
features_std
=
np
.
std
(
features
,
axis
=
0
)
features_std
[
features_std
==
0.0
]
=
1.0
row_norm_list
=
[]
for
row
in
features
:
# row is a sample
...
...
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