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.learn.em
Commits
5643c20a
Commit
5643c20a
authored
Sep 05, 2017
by
Amir MOHAMMADI
Browse files
Ignore the rng variable in the bindings
parent
dce267f6
Pipeline
#11985
passed with stages
in 22 minutes and 49 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
bob/learn/em/map_gmm_trainer.cpp
View file @
5643c20a
...
...
@@ -306,9 +306,10 @@ static auto initialize = bob::extension::FunctionDoc(
""
,
true
)
.
add_prototype
(
"gmm_machine, [data]"
)
.
add_prototype
(
"gmm_machine, [data]
, [rng]
"
)
.
add_parameter
(
"gmm_machine"
,
":py:class:`bob.learn.em.GMMMachine`"
,
"GMMMachine Object"
)
.
add_parameter
(
"data"
,
"object"
,
"Ignored."
);
.
add_parameter
(
"data"
,
"object"
,
"Ignored."
)
.
add_parameter
(
"rng"
,
"object"
,
"Ignored."
);
static
PyObject
*
PyBobLearnEMMAPGMMTrainer_initialize
(
PyBobLearnEMMAPGMMTrainerObject
*
self
,
PyObject
*
args
,
PyObject
*
kwargs
)
{
BOB_TRY
...
...
@@ -317,9 +318,10 @@ static PyObject* PyBobLearnEMMAPGMMTrainer_initialize(PyBobLearnEMMAPGMMTrainerO
PyBobLearnEMGMMMachineObject
*
gmm_machine
=
0
;
PyObject
*
data
;
PyBoostMt19937Object
*
rng
=
0
;
if
(
!
PyArg_ParseTupleAndKeywords
(
args
,
kwargs
,
"O!|O"
,
kwlist
,
&
PyBobLearnEMGMMMachine_Type
,
&
gmm_machine
,
&
data
))
return
0
;
if
(
!
PyArg_ParseTupleAndKeywords
(
args
,
kwargs
,
"O!|O
O!
"
,
kwlist
,
&
PyBobLearnEMGMMMachine_Type
,
&
gmm_machine
,
&
data
,
&
PyBoostMt19937_Type
,
&
rng
))
return
0
;
self
->
cxx
->
initialize
(
*
gmm_machine
->
cxx
);
...
...
bob/learn/em/ml_gmm_trainer.cpp
View file @
5643c20a
...
...
@@ -192,9 +192,10 @@ static auto initialize = bob::extension::FunctionDoc(
""
,
true
)
.
add_prototype
(
"gmm_machine, [data]"
)
.
add_prototype
(
"gmm_machine, [data]
, [rng]
"
)
.
add_parameter
(
"gmm_machine"
,
":py:class:`bob.learn.em.GMMMachine`"
,
"GMMMachine Object"
)
.
add_parameter
(
"data"
,
"object"
,
"Ignored."
);
.
add_parameter
(
"data"
,
"object"
,
"Ignored."
)
.
add_parameter
(
"rng"
,
"object"
,
"Ignored."
);
static
PyObject
*
PyBobLearnEMMLGMMTrainer_initialize
(
PyBobLearnEMMLGMMTrainerObject
*
self
,
PyObject
*
args
,
PyObject
*
kwargs
)
{
BOB_TRY
...
...
@@ -202,9 +203,10 @@ static PyObject* PyBobLearnEMMLGMMTrainer_initialize(PyBobLearnEMMLGMMTrainerObj
char
**
kwlist
=
initialize
.
kwlist
(
0
);
PyBobLearnEMGMMMachineObject
*
gmm_machine
=
0
;
PyObject
*
data
;
PyBoostMt19937Object
*
rng
=
0
;
if
(
!
PyArg_ParseTupleAndKeywords
(
args
,
kwargs
,
"O!|O"
,
kwlist
,
&
PyBobLearnEMGMMMachine_Type
,
&
gmm_machine
,
&
data
))
return
0
;
if
(
!
PyArg_ParseTupleAndKeywords
(
args
,
kwargs
,
"O!|O
O!
"
,
kwlist
,
&
PyBobLearnEMGMMMachine_Type
,
&
gmm_machine
,
&
data
,
&
PyBoostMt19937_Type
,
&
rng
))
return
0
;
self
->
cxx
->
initialize
(
*
gmm_machine
->
cxx
);
BOB_CATCH_MEMBER
(
"cannot perform the initialize method"
,
0
)
...
...
bob/learn/em/train.py
View file @
5643c20a
...
...
@@ -45,9 +45,7 @@ def train(trainer, machine, data, max_iterations=50, convergence_threshold=None,
# Initialization
if
initialize
:
if
rng
is
not
None
and
\
(
not
isinstance
(
trainer
,
(
bob
.
learn
.
em
.
ML_GMMTrainer
,
bob
.
learn
.
em
.
MAP_GMMTrainer
))):
if
rng
is
not
None
:
trainer
.
initialize
(
machine
,
data
,
rng
)
else
:
trainer
.
initialize
(
machine
,
data
)
...
...
version.txt
View file @
5643c20a
2.0.14b0
\ No newline at end of file
2.1.0b0
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