Skip to content

Commit

Permalink
Solved more memory leaks. PLDA is the only missing to check
Browse files Browse the repository at this point in the history
  • Loading branch information
tiagofrepereira2012 committed Feb 28, 2015
1 parent 6ffaff2 commit e6470b3
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions bob/learn/em/MAP_gmm_trainer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion bob/learn/em/ivector_machine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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*){
Expand Down
2 changes: 1 addition & 1 deletion bob/learn/em/kmeans_machine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit e6470b3

Please sign in to comment.