Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
bob
bob.pad.base
Commits
32411da0
Commit
32411da0
authored
Jul 09, 2018
by
Guillaume HEUSCH
Browse files
[algorithm] fixed docstrings in MLP
parent
cf4bfbe9
Pipeline
#21739
failed with stage
in 12 minutes and 12 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
bob/pad/base/algorithm/MLP.py
View file @
32411da0
...
...
@@ -19,7 +19,7 @@ class MLP(Algorithm):
Attributes
----------
hidden_units : :py:obj:`tuple` of int
hidden_units : :py:obj:`tuple` of
:any:`
int
`
The number of hidden units in each hidden layer
max_iter : int
The maximum number of training iterations
...
...
@@ -54,10 +54,10 @@ class MLP(Algorithm):
def
train_projector
(
self
,
training_features
,
projector_file
):
"""Trains the MLP
Parameters
:
----------
-
training_features : :py:obj:`list` of :py:class:`numpy.ndarray`
or :py:class:`bob.bio.video.utils.FrameContainer`
Data used to train the MLP. The real
d
at
a
are in training_features[0] and the attacks are in training_features[1]
Parameters
----------
training_features : :py:obj:`list` of :py:class:`numpy.ndarray`
Data used to train the MLP. The real at
tempts
are in training_features[0] and the attacks are in training_features[1]
projector_file : str
Filename where to save the trained model.
...
...
@@ -71,11 +71,6 @@ class MLP(Algorithm):
label_attack
=
numpy
.
zeros
((
len
(
training_features
[
1
]),
2
),
dtype
=
'float64'
)
label_attack
[:,
1
]
=
0
#if isinstance(training_features[0][0], FrameContainer):
# real = convert_frame_cont_to_array(training_features[0])
#if isinstance(training_features[1][0], FrameContainer):
# attack = convert_frame_cont_to_array(training_features[1])
real
=
numpy
.
array
(
training_features
[
0
])
attack
=
numpy
.
array
(
training_features
[
1
])
X
=
numpy
.
vstack
([
real
,
attack
])
...
...
@@ -115,7 +110,8 @@ class MLP(Algorithm):
Parameters
----------
feature : :py:class:`numpy.ndarray` or :py:class:`bob.bio.video.utils.FrameContainer`
feature : :py:class:`numpy.ndarray`
The feature to classify
Returns
-------
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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