Skip to content
GitLab
Menu
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
e6470b33
Commit
e6470b33
authored
Feb 28, 2015
by
Tiago de Freitas Pereira
Browse files
Solved more memory leaks. PLDA is the only missing to check
parent
6ffaff25
Changes
3
Hide whitespace changes
Inline
Side-by-side
bob/learn/em/MAP_gmm_trainer.cpp
View file @
e6470b33
...
...
@@ -78,6 +78,9 @@ static int PyBobLearnEMMAPGMMTrainer_init_base_trainer(PyBobLearnEMMAPGMMTrainer
PyObject
*
keyword_relevance_factor
=
Py_BuildValue
(
"s"
,
kwlist1
[
1
]);
PyObject
*
keyword_alpha
=
Py_BuildValue
(
"s"
,
kwlist2
[
1
]);
auto
keyword_relevance_factor_
=
make_safe
(
keyword_relevance_factor
);
auto
keyword_alpha_
=
make_safe
(
keyword_alpha
);
//Here we have to select which keyword argument to read
if
(
kwargs
&&
PyDict_Contains
(
kwargs
,
keyword_relevance_factor
)
&&
(
PyArg_ParseTupleAndKeywords
(
args
,
kwargs
,
"O!dO!|O!O!d"
,
kwlist1
,
&
PyBobLearnEMGMMMachine_Type
,
&
gmm_machine
,
...
...
bob/learn/em/ivector_machine.cpp
View file @
e6470b33
...
...
@@ -302,7 +302,7 @@ PyObject* PyBobLearnEMIVectorMachine_getUBM(PyBobLearnEMIVectorMachineObject* se
(
PyBobLearnEMGMMMachineObject
*
)
PyBobLearnEMGMMMachine_Type
.
tp_alloc
(
&
PyBobLearnEMGMMMachine_Type
,
0
);
retval
->
cxx
=
ubm_gmmMachine
;
return
Py_BuildValue
(
"
O
"
,
retval
);
return
Py_BuildValue
(
"
N
"
,
retval
);
BOB_CATCH_MEMBER
(
"ubm could not be read"
,
0
)
}
int
PyBobLearnEMIVectorMachine_setUBM
(
PyBobLearnEMIVectorMachineObject
*
self
,
PyObject
*
value
,
void
*
){
...
...
bob/learn/em/kmeans_machine.cpp
View file @
e6470b33
...
...
@@ -535,7 +535,7 @@ static PyObject* PyBobLearnEMKMeansMachine_get_variances_and_weights_for_each_cl
self
->
cxx
->
getVariancesAndWeightsForEachCluster
(
*
PyBlitzArrayCxx_AsBlitz
<
double
,
2
>
(
input
),
variances
,
weights
);
return
Py_BuildValue
(
"(
O,O
)"
,
PyBlitzArrayCxx_AsConstNumpy
(
variances
),
PyBlitzArrayCxx_AsConstNumpy
(
weights
));
return
Py_BuildValue
(
"(
N,N
)"
,
PyBlitzArrayCxx_AsConstNumpy
(
variances
),
PyBlitzArrayCxx_AsConstNumpy
(
weights
));
BOB_CATCH_MEMBER
(
"cannot compute the variances and weights for each cluster"
,
0
)
}
...
...
Write
Preview
Supports
Markdown
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