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
0cb86b6e
Commit
0cb86b6e
authored
Oct 19, 2018
by
Guillaume HEUSCH
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
hack to prevent libSVM to crach
parent
efc25e19
Pipeline
#24450
failed with stage
in 24 minutes and 39 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
0 deletions
+12
-0
bob/pad/base/algorithm/SVM.py
bob/pad/base/algorithm/SVM.py
+12
-0
No files found.
bob/pad/base/algorithm/SVM.py
View file @
0cb86b6e
...
...
@@ -277,6 +277,12 @@ class SVM(Algorithm):
machine
=
trainer
.
train
(
data
)
# train the machine
# TODO: find a proper way to handle this - Guillaume HEUSCH, 08-08-2018
if
machine
.
shape
[
0
]
!=
data
[
0
].
shape
[
1
]:
data
[
0
]
+=
1
data
[
1
]
+=
1
machine
=
trainer
.
train
(
data
)
# train the machine
precision_cv
=
self
.
comp_prediction_precision
(
machine
,
np
.
copy
(
real_cv
),
np
.
copy
(
attack_cv
))
...
...
@@ -369,6 +375,12 @@ class SVM(Algorithm):
del
attack
machine
=
trainer
.
train
(
data
)
# train the machine
# TODO: find a proper way to handle this - Guillaume HEUSCH, 08-08-2018
if
machine
.
shape
[
0
]
!=
data
[
0
].
shape
[
1
]:
data
[
0
]
+=
1
data
[
1
]
+=
1
print
(
"training again ..."
)
machine
=
trainer
.
train
(
data
)
# train the machine
if
mean_std_norm_flag
:
machine
.
input_subtract
=
features_mean
# subtract the mean of train data
...
...
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