Commit bd27441b authored by Manuel Günther's avatar Manuel Günther
Browse files

Changed 'enrol' (BE) to 'enroll' (AE)

parent b235305b
......@@ -46,7 +46,7 @@ bob::learn::em::ISVTrainer& bob::learn::em::ISVTrainer::operator=
bool bob::learn::em::ISVTrainer::operator==(const bob::learn::em::ISVTrainer& b) const
{
return m_rng == b.m_rng &&
return m_rng == b.m_rng &&
m_relevance_factor == b.m_relevance_factor;
}
......@@ -58,7 +58,7 @@ bool bob::learn::em::ISVTrainer::operator!=(const bob::learn::em::ISVTrainer& b)
bool bob::learn::em::ISVTrainer::is_similar_to(const bob::learn::em::ISVTrainer& b,
const double r_epsilon, const double a_epsilon) const
{
return m_rng == b.m_rng &&
return m_rng == b.m_rng &&
m_relevance_factor == b.m_relevance_factor;
}
......@@ -105,7 +105,7 @@ double bob::learn::em::ISVTrainer::computeLikelihood(bob::learn::em::ISVBase& ma
return 0;
}
void bob::learn::em::ISVTrainer::enrol(bob::learn::em::ISVMachine& machine,
void bob::learn::em::ISVTrainer::enroll(bob::learn::em::ISVMachine& machine,
const std::vector<boost::shared_ptr<bob::learn::em::GMMStats> >& ar,
const size_t n_iter)
{
......@@ -125,6 +125,3 @@ void bob::learn::em::ISVTrainer::enrol(bob::learn::em::ISVMachine& machine,
const blitz::Array<double,1> z(m_base_trainer.getZ()[0]);
machine.setZ(z);
}
......@@ -174,7 +174,7 @@ void bob::learn::em::JFATrainer::train(bob::learn::em::JFABase& machine,
}
*/
void bob::learn::em::JFATrainer::enrol(bob::learn::em::JFAMachine& machine,
void bob::learn::em::JFATrainer::enroll(bob::learn::em::JFAMachine& machine,
const std::vector<boost::shared_ptr<bob::learn::em::GMMStats> >& ar,
const size_t n_iter)
{
......@@ -197,4 +197,3 @@ void bob::learn::em::JFATrainer::enrol(bob::learn::em::JFAMachine& machine,
machine.setY(y);
machine.setZ(z);
}
......@@ -827,13 +827,13 @@ double bob::learn::em::PLDAMachine::forward(const blitz::Array<double,2>& sample
}
double bob::learn::em::PLDAMachine::computeLogLikelihood(const blitz::Array<double,1>& sample,
bool enrol) const
bool enroll) const
{
if (!m_plda_base) throw std::runtime_error("No PLDABase set to this machine");
// Check dimensionality
bob::core::array::assertSameDimensionLength(sample.extent(0), getDimD());
int n_samples = 1 + (enrol?m_n_samples:0);
int n_samples = 1 + (enroll?m_n_samples:0);
// 3/ Third term of the likelihood: -1/2*X^T*(SIGMA+A.A^T)^-1*X
// Efficient way: -1/2*sum_i(xi^T.sigma^-1.xi - xi^T.sigma^-1*G*(I+G^T.sigma^-1.G)^-1*G^T*sigma^-1.xi
......@@ -842,9 +842,9 @@ double bob::learn::em::PLDAMachine::computeLogLikelihood(const blitz::Array<doub
const blitz::Array<double,2>& beta = getPLDABase()->getBeta();
const blitz::Array<double,2>& Ft_beta = getPLDABase()->getFtBeta();
const blitz::Array<double,1>& mu = getPLDABase()->getMu();
double terma = (enrol?m_nh_sum_xit_beta_xi:0.);
double terma = (enroll?m_nh_sum_xit_beta_xi:0.);
// sumWeighted
if (enrol && m_n_samples > 0) m_tmp_nf_1 = m_weighted_sum;
if (enroll && m_n_samples > 0) m_tmp_nf_1 = m_weighted_sum;
else m_tmp_nf_1 = 0;
// terma += -1 / 2. * (xi^t*beta*xi)
......@@ -882,13 +882,13 @@ double bob::learn::em::PLDAMachine::computeLogLikelihood(const blitz::Array<doub
}
double bob::learn::em::PLDAMachine::computeLogLikelihood(const blitz::Array<double,2>& samples,
bool enrol) const
bool enroll) const
{
if (!m_plda_base) throw std::runtime_error("No PLDABase set to this machine");
// Check dimensionality
bob::core::array::assertSameDimensionLength(samples.extent(1), getDimD());
int n_samples = samples.extent(0) + (enrol?m_n_samples:0);
int n_samples = samples.extent(0) + (enroll?m_n_samples:0);
// 3/ Third term of the likelihood: -1/2*X^T*(SIGMA+A.A^T)^-1*X
// Efficient way: -1/2*sum_i(xi^T.sigma^-1.xi - xi^T.sigma^-1*G*(I+G^T.sigma^-1.G)^-1*G^T*sigma^-1.xi
// -1/2*sumWeighted^T*(I+aF^T.(sigma^-1-sigma^-1*G*(I+G^T.sigma^-1.G)^-1*G^T*sigma^-1).F)^-1*sumWeighted
......@@ -896,9 +896,9 @@ double bob::learn::em::PLDAMachine::computeLogLikelihood(const blitz::Array<doub
const blitz::Array<double,2>& beta = getPLDABase()->getBeta();
const blitz::Array<double,2>& Ft_beta = getPLDABase()->getFtBeta();
const blitz::Array<double,1>& mu = getPLDABase()->getMu();
double terma = (enrol?m_nh_sum_xit_beta_xi:0.);
double terma = (enroll?m_nh_sum_xit_beta_xi:0.);
// sumWeighted
if (enrol && m_n_samples > 0) m_tmp_nf_1 = m_weighted_sum;
if (enroll && m_n_samples > 0) m_tmp_nf_1 = m_weighted_sum;
else m_tmp_nf_1 = 0;
for (int k=0; k<samples.extent(0); ++k)
{
......
......@@ -747,7 +747,7 @@ void bob::learn::em::PLDATrainer::updateSigma(bob::learn::em::PLDABase& machine,
}
void bob::learn::em::PLDATrainer::enrol(bob::learn::em::PLDAMachine& plda_machine,
void bob::learn::em::PLDATrainer::enroll(bob::learn::em::PLDAMachine& plda_machine,
const blitz::Array<double,2>& ar) const
{
// Gets dimension
......
......@@ -26,13 +26,13 @@ static void _ztNorm(const blitz::Array<double,2>& rawscores_probes_vs_models,
// Compute the sizes
int size_eval = A.extent(0);
int size_enrol = A.extent(1);
int size_enroll = A.extent(1);
int size_tnorm = (C ? C->extent(0) : 0);
int size_znorm = (B ? B->extent(1) : 0);
// Check the inputs
bob::core::array::assertSameDimensionLength(A.extent(0), size_eval);
bob::core::array::assertSameDimensionLength(A.extent(1), size_enrol);
bob::core::array::assertSameDimensionLength(A.extent(1), size_enroll);
if (B) {
bob::core::array::assertSameDimensionLength(B->extent(1), size_znorm);
......@@ -43,7 +43,7 @@ static void _ztNorm(const blitz::Array<double,2>& rawscores_probes_vs_models,
if (C) {
bob::core::array::assertSameDimensionLength(C->extent(0), size_tnorm);
if (size_tnorm > 0)
bob::core::array::assertSameDimensionLength(C->extent(1), size_enrol);
bob::core::array::assertSameDimensionLength(C->extent(1), size_enroll);
}
if (D && size_znorm > 0 && size_tnorm > 0) {
......@@ -57,7 +57,7 @@ static void _ztNorm(const blitz::Array<double,2>& rawscores_probes_vs_models,
}
bob::core::array::assertSameDimensionLength(scores.extent(0), size_eval);
bob::core::array::assertSameDimensionLength(scores.extent(1), size_enrol);
bob::core::array::assertSameDimensionLength(scores.extent(1), size_enroll);
// Declare needed IndexPlaceholder
blitz::firstIndex ii;
......@@ -87,7 +87,7 @@ static void _ztNorm(const blitz::Array<double,2>& rawscores_probes_vs_models,
else
zA = A;
blitz::Array<double,2> zC(size_tnorm, size_enrol);
blitz::Array<double,2> zC(size_tnorm, size_enroll);
if (D && size_tnorm > 0 && size_znorm > 0) {
blitz::Array<double,1> mean_Dimp(size_tnorm);
blitz::Array<double,1> std_Dimp(size_tnorm);
......@@ -125,8 +125,8 @@ static void _ztNorm(const blitz::Array<double,2>& rawscores_probes_vs_models,
if (C && size_tnorm > 0)
{
blitz::Array<double,1> mean_zC(size_enrol);
blitz::Array<double,1> std_zC(size_enrol);
blitz::Array<double,1> mean_zC(size_enroll);
blitz::Array<double,1> std_zC(size_enroll);
// ztA = (zA - mean(zC)) / std(zC) [ztnorm on eval scores]
mean_zC = blitz::mean(zC(jj, ii), jj);
......@@ -179,4 +179,3 @@ void bob::learn::em::zNorm(const blitz::Array<double,2>& rawscores_probes_vs_mod
_ztNorm(rawscores_probes_vs_models, &rawscores_zprobes_vs_models, NULL,
NULL, NULL, scores);
}
......@@ -178,7 +178,7 @@ class ISVMachine
*
* @param input input data used by the machine
* @warning Inputs are checked
* @return score value computed by the machine
* @return score value computed by the machine
*/
double forward(const bob::learn::em::GMMStats& input);
/**
......@@ -193,7 +193,7 @@ class ISVMachine
*
* @param input input data used by the machine
* @warning Inputs are NOT checked
* @return score value computed by the machine
* @return score value computed by the machine
*/
double forward_(const bob::learn::em::GMMStats& input);
......@@ -214,7 +214,7 @@ class ISVMachine
// UBM
boost::shared_ptr<bob::learn::em::ISVBase> m_isv_base;
// y and z vectors/factors learned during the enrolment procedure
// y and z vectors/factors learned during the enrollment procedure
blitz::Array<double,1> m_z;
// cache
......
......@@ -92,7 +92,7 @@ class ISVTrainer
/**
* @brief Enrol a client
*/
void enrol(bob::learn::em::ISVMachine& machine,
void enroll(bob::learn::em::ISVMachine& machine,
const std::vector<boost::shared_ptr<bob::learn::em::GMMStats> >& features,
const size_t n_iter);
......@@ -133,7 +133,7 @@ class ISVTrainer
{ m_base_trainer.setAccUA1(acc); }
void setAccUA2(const blitz::Array<double,2>& acc)
{ m_base_trainer.setAccUA2(acc); }
/**
* @brief Sets the Random Number Generator
*/
......
......@@ -237,7 +237,7 @@ class JFAMachine
// UBM
boost::shared_ptr<bob::learn::em::JFABase> m_jfa_base;
// y and z vectors/factors learned during the enrolment procedure
// y and z vectors/factors learned during the enrollment procedure
blitz::Array<double,1> m_y;
blitz::Array<double,1> m_z;
......
......@@ -145,7 +145,7 @@ class JFATrainer
/**
* @brief Enrol a client
*/
void enrol(bob::learn::em::JFAMachine& machine,
void enroll(bob::learn::em::JFAMachine& machine,
const std::vector<boost::shared_ptr<bob::learn::em::GMMStats> >& features,
const size_t n_iter);
......
......@@ -215,10 +215,10 @@ class PLDATrainer
/**
* @brief Main procedure for enrolling a PLDAMachine
*/
void enrol(bob::learn::em::PLDAMachine& plda_machine,
void enroll(bob::learn::em::PLDAMachine& plda_machine,
const blitz::Array<double,2>& ar) const;
/**
* @brief Sets the Random Number Generator
*/
......@@ -229,12 +229,12 @@ class PLDATrainer
* @brief Gets the Random Number Generator
*/
boost::shared_ptr<boost::mt19937> getRng() const
{ return m_rng; }
{ return m_rng; }
private:
boost::shared_ptr<boost::mt19937> m_rng;
//representation
size_t m_dim_d; ///< Dimensionality of the input features
size_t m_dim_f; ///< Size/rank of the \f$F\f$ subspace
......
......@@ -18,7 +18,7 @@ static int extract_GMMStats_1d(PyObject *list,
std::vector<boost::shared_ptr<bob::learn::em::GMMStats> >& training_data)
{
for (int i=0; i<PyList_GET_SIZE(list); i++){
PyBobLearnEMGMMStatsObject* stats;
if (!PyArg_Parse(PyList_GetItem(list, i), "O!", &PyBobLearnEMGMMStats_Type, &stats)){
PyErr_Format(PyExc_RuntimeError, "Expected GMMStats objects");
......@@ -69,7 +69,7 @@ int list_as_vector(PyObject* list, std::vector<blitz::Array<double,N> >& vec)
{
for (int i=0; i<PyList_GET_SIZE(list); i++)
{
PyBlitzArrayObject* blitz_object;
PyBlitzArrayObject* blitz_object;
if (!PyArg_Parse(PyList_GetItem(list, i), "O&", &PyBlitzArray_Converter, &blitz_object)){
PyErr_Format(PyExc_RuntimeError, "Expected numpy array object");
return -1;
......@@ -156,7 +156,7 @@ static int PyBobLearnEMISVTrainer_init(PyBobLearnEMISVTrainerObject* self, PyObj
auto tmp_ = make_safe(tmp);
arg = PyList_GET_ITEM(tmp, 0);
}
if(PyBobLearnEMISVTrainer_Check(arg))
// If the constructor input is ISVTrainer object
return PyBobLearnEMISVTrainer_init_copy(self, args, kwargs);
......@@ -230,24 +230,24 @@ int PyBobLearnEMISVTrainer_set_acc_u_a1(PyBobLearnEMISVTrainerObject* self, PyOb
return -1;
}
auto o_ = make_safe(input);
// perform check on the input
// perform check on the input
if (input->type_num != NPY_FLOAT64){
PyErr_Format(PyExc_TypeError, "`%s' only supports 64-bit float arrays for input array `%s`", Py_TYPE(self)->tp_name, acc_u_a1.name());
return -1;
}
}
if (input->ndim != 3){
PyErr_Format(PyExc_TypeError, "`%s' only processes 3D arrays of float64 for `%s`", Py_TYPE(self)->tp_name, acc_u_a1.name());
return -1;
}
}
if (input->shape[0] != (Py_ssize_t)self->cxx->getAccUA1().extent(0) && input->shape[1] != (Py_ssize_t)self->cxx->getAccUA1().extent(1) && input->shape[2] != (Py_ssize_t)self->cxx->getAccUA1().extent(2)) {
PyErr_Format(PyExc_TypeError, "`%s' 3D `input` array should have the shape [%" PY_FORMAT_SIZE_T "d, %" PY_FORMAT_SIZE_T "d, %" PY_FORMAT_SIZE_T "d] not [%" PY_FORMAT_SIZE_T "d, %" PY_FORMAT_SIZE_T "d, %" PY_FORMAT_SIZE_T "d] for `%s`", Py_TYPE(self)->tp_name, (Py_ssize_t)self->cxx->getAccUA1().extent(0), (Py_ssize_t)self->cxx->getAccUA1().extent(1), (Py_ssize_t)self->cxx->getAccUA1().extent(2), (Py_ssize_t)input->shape[0], (Py_ssize_t)input->shape[1], (Py_ssize_t)input->shape[2], acc_u_a1.name());
return -1;
}
}
auto b = PyBlitzArrayCxx_AsBlitz<double,3>(input, "acc_u_a1");
if (!b) return -1;
self->cxx->setAccUA1(*b);
......@@ -275,23 +275,23 @@ int PyBobLearnEMISVTrainer_set_acc_u_a2(PyBobLearnEMISVTrainerObject* self, PyOb
return -1;
}
auto o_ = make_safe(input);
// perform check on the input
// perform check on the input
if (input->type_num != NPY_FLOAT64){
PyErr_Format(PyExc_TypeError, "`%s' only supports 64-bit float arrays for input array `%s`", Py_TYPE(self)->tp_name, acc_u_a2.name());
return -1;
}
}
if (input->ndim != 2){
PyErr_Format(PyExc_TypeError, "`%s' only processes 2D arrays of float64 for `%s`", Py_TYPE(self)->tp_name, acc_u_a2.name());
return -1;
}
}
if (input->shape[0] != (Py_ssize_t)self->cxx->getAccUA2().extent(0) && input->shape[1] != (Py_ssize_t)self->cxx->getAccUA2().extent(1)) {
PyErr_Format(PyExc_TypeError, "`%s' 3D `input` array should have the shape [%" PY_FORMAT_SIZE_T "d, %" PY_FORMAT_SIZE_T "d] not [%" PY_FORMAT_SIZE_T "d, %" PY_FORMAT_SIZE_T "d] for `%s`", Py_TYPE(self)->tp_name, (Py_ssize_t)self->cxx->getAccUA2().extent(0), (Py_ssize_t)self->cxx->getAccUA2().extent(1), input->shape[0], input->shape[1], acc_u_a2.name());
return -1;
}
}
auto b = PyBlitzArrayCxx_AsBlitz<double,2>(input, "acc_u_a2");
if (!b) return -1;
self->cxx->setAccUA2(*b);
......@@ -319,12 +319,12 @@ int PyBobLearnEMISVTrainer_set_X(PyBobLearnEMISVTrainerObject* self, PyObject* v
PyErr_Format(PyExc_TypeError, "Expected a list in `%s'", __X__.name());
return -1;
}
std::vector<blitz::Array<double,2> > data;
if(list_as_vector(value ,data)==0){
self->cxx->setX(data);
}
return 0;
BOB_CATCH_MEMBER("__X__ could not be written", 0)
}
......@@ -349,18 +349,18 @@ int PyBobLearnEMISVTrainer_set_Z(PyBobLearnEMISVTrainerObject* self, PyObject* v
PyErr_Format(PyExc_TypeError, "Expected a list in `%s'", __Z__.name());
return -1;
}
std::vector<blitz::Array<double,1> > data;
if(list_as_vector(value ,data)==0){
self->cxx->setZ(data);
}
return 0;
BOB_CATCH_MEMBER("__Z__ could not be written", 0)
}
static PyGetSetDef PyBobLearnEMISVTrainer_getseters[] = {
static PyGetSetDef PyBobLearnEMISVTrainer_getseters[] = {
{
acc_u_a1.name(),
(getter)PyBobLearnEMISVTrainer_get_acc_u_a1,
......@@ -389,7 +389,7 @@ static PyGetSetDef PyBobLearnEMISVTrainer_getseters[] = {
__Z__.doc(),
0
},
{0} // Sentinel
};
......@@ -418,7 +418,7 @@ static PyObject* PyBobLearnEMISVTrainer_initialize(PyBobLearnEMISVTrainerObject*
PyBobLearnEMISVBaseObject* isv_base = 0;
PyObject* stats = 0;
PyBoostMt19937Object* rng = 0;
PyBoostMt19937Object* rng = 0;
if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O!O!|O!", kwlist, &PyBobLearnEMISVBase_Type, &isv_base,
&PyList_Type, &stats,
......@@ -484,11 +484,11 @@ static auto m_step = bob::extension::FunctionDoc(
static PyObject* PyBobLearnEMISVTrainer_m_step(PyBobLearnEMISVTrainerObject* self, PyObject* args, PyObject* kwargs) {
BOB_TRY
// Parses input arguments in a single shot
// Parses input arguments in a single shot
char** kwlist = m_step.kwlist(0);
PyBobLearnEMISVBaseObject* isv_base = 0;
PyObject* stats = 0;
PyObject* stats = 0;
if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O!|O!", kwlist, &PyBobLearnEMISVBase_Type, &isv_base,
&PyList_Type, &stats)) return 0;
......@@ -502,9 +502,9 @@ static PyObject* PyBobLearnEMISVTrainer_m_step(PyBobLearnEMISVTrainerObject* sel
/*** enrol ***/
static auto enrol = bob::extension::FunctionDoc(
"enrol",
/*** enroll ***/
static auto enroll = bob::extension::FunctionDoc(
"enroll",
"",
"",
true
......@@ -513,11 +513,11 @@ static auto enrol = bob::extension::FunctionDoc(
.add_parameter("isv_machine", ":py:class:`bob.learn.em.ISVMachine`", "ISVMachine Object")
.add_parameter("features", "list(:py:class:`bob.learn.em.GMMStats`)`", "")
.add_parameter("n_iter", "int", "Number of iterations");
static PyObject* PyBobLearnEMISVTrainer_enrol(PyBobLearnEMISVTrainerObject* self, PyObject* args, PyObject* kwargs) {
static PyObject* PyBobLearnEMISVTrainer_enroll(PyBobLearnEMISVTrainerObject* self, PyObject* args, PyObject* kwargs) {
BOB_TRY
// Parses input arguments in a single shot
char** kwlist = enrol.kwlist(0);
char** kwlist = enroll.kwlist(0);
PyBobLearnEMISVMachineObject* isv_machine = 0;
PyObject* stats = 0;
......@@ -529,9 +529,9 @@ static PyObject* PyBobLearnEMISVTrainer_enrol(PyBobLearnEMISVTrainerObject* self
std::vector<boost::shared_ptr<bob::learn::em::GMMStats> > training_data;
if(extract_GMMStats_1d(stats ,training_data)==0)
self->cxx->enrol(*isv_machine->cxx, training_data, n_iter);
self->cxx->enroll(*isv_machine->cxx, training_data, n_iter);
BOB_CATCH_MEMBER("cannot perform the enrol method", 0)
BOB_CATCH_MEMBER("cannot perform the enroll method", 0)
Py_RETURN_NONE;
}
......@@ -558,10 +558,10 @@ static PyMethodDef PyBobLearnEMISVTrainer_methods[] = {
m_step.doc()
},
{
enrol.name(),
(PyCFunction)PyBobLearnEMISVTrainer_enrol,
enroll.name(),
(PyCFunction)PyBobLearnEMISVTrainer_enroll,
METH_VARARGS|METH_KEYWORDS,
enrol.doc()
enroll.doc()
},
{0} /* Sentinel */
};
......@@ -602,4 +602,3 @@ bool init_BobLearnEMISVTrainer(PyObject* module)
Py_INCREF(&PyBobLearnEMISVTrainer_Type);
return PyModule_AddObject(module, "ISVTrainer", (PyObject*)&PyBobLearnEMISVTrainer_Type) >= 0;
}
......@@ -18,7 +18,7 @@ static int extract_GMMStats_1d(PyObject *list,
std::vector<boost::shared_ptr<bob::learn::em::GMMStats> >& training_data)
{
for (int i=0; i<PyList_GET_SIZE(list); i++){
PyBobLearnEMGMMStatsObject* stats;
if (!PyArg_Parse(PyList_GetItem(list, i), "O!", &PyBobLearnEMGMMStats_Type, &stats)){
PyErr_Format(PyExc_RuntimeError, "Expected GMMStats objects");
......@@ -69,7 +69,7 @@ int list_as_vector(PyObject* list, std::vector<blitz::Array<double,N> >& vec)
{
for (int i=0; i<PyList_GET_SIZE(list); i++)
{
PyBlitzArrayObject* blitz_object;
PyBlitzArrayObject* blitz_object;
if (!PyArg_Parse(PyList_GetItem(list, i), "O&", &PyBlitzArray_Converter, &blitz_object)){
PyErr_Format(PyExc_RuntimeError, "Expected numpy array object");
return -1;
......@@ -195,22 +195,22 @@ int PyBobLearnEMJFATrainer_set_acc_v_a1(PyBobLearnEMJFATrainerObject* self, PyOb
return -1;
}
auto o_ = make_safe(input);
// perform check on the input
// perform check on the input
if (input->type_num != NPY_FLOAT64){
PyErr_Format(PyExc_TypeError, "`%s' only supports 64-bit float arrays for input array `%s`", Py_TYPE(self)->tp_name, acc_v_a1.name());
return -1;
}
}
if (input->ndim != 3){
PyErr_Format(PyExc_TypeError, "`%s' only processes 3D arrays of float64 for `%s`", Py_TYPE(self)->tp_name, acc_v_a1.name());
return -1;
}
}
if (input->shape[0] != (Py_ssize_t)self->cxx->getAccVA1().extent(0) && input->shape[1] != (Py_ssize_t)self->cxx->getAccVA1().extent(1) && input->shape[2] != (Py_ssize_t)self->cxx->getAccVA1().extent(2)) {
PyErr_Format(PyExc_TypeError, "`%s' 3D `input` array should have the shape [%" PY_FORMAT_SIZE_T "d, %" PY_FORMAT_SIZE_T "d, %" PY_FORMAT_SIZE_T "d] not [%" PY_FORMAT_SIZE_T "d, %" PY_FORMAT_SIZE_T "d, %" PY_FORMAT_SIZE_T "d] for `%s`", Py_TYPE(self)->tp_name, (Py_ssize_t)self->cxx->getAccVA1().extent(0), (Py_ssize_t)self->cxx->getAccVA1().extent(1), (Py_ssize_t)self->cxx->getAccVA1().extent(2), (Py_ssize_t)input->shape[0], (Py_ssize_t)input->shape[1], (Py_ssize_t)input->shape[2], acc_v_a1.name());
return -1;
}
}
auto b = PyBlitzArrayCxx_AsBlitz<double,3>(input, "acc_v_a1");
if (!b) return -1;
......@@ -239,24 +239,24 @@ int PyBobLearnEMJFATrainer_set_acc_v_a2(PyBobLearnEMJFATrainerObject* self, PyOb
return -1;
}
auto o_ = make_safe(input);
// perform check on the input
// perform check on the input
if (input->type_num != NPY_FLOAT64){
PyErr_Format(PyExc_TypeError, "`%s' only supports 64-bit float arrays for input array `%s`", Py_TYPE(self)->tp_name, acc_v_a2.name());
return -1;
}
}
if (input->ndim != 2){
PyErr_Format(PyExc_TypeError, "`%s' only processes 2D arrays of float64 for `%s`", Py_TYPE(self)->tp_name, acc_v_a2.name());
return -1;
}
}
if (input->shape[0] != (Py_ssize_t)self->cxx->getAccVA2().extent(0) && input->shape[1] != (Py_ssize_t)self->cxx->getAccVA2().extent(1)) {
PyErr_Format(PyExc_TypeError, "`%s' 2D `input` array should have the shape [%" PY_FORMAT_SIZE_T "d, %" PY_FORMAT_SIZE_T "d] not [%" PY_FORMAT_SIZE_T "d, %" PY_FORMAT_SIZE_T "d] for `%s`", Py_TYPE(self)->tp_name, (Py_ssize_t)self->cxx->getAccVA2().extent(0), (Py_ssize_t)self->cxx->getAccVA2().extent(1), input->shape[0], input->shape[1], acc_v_a2.name());
return -1;
}
}
auto b = PyBlitzArrayCxx_AsBlitz<double,2>(input, "acc_v_a2");
if (!b) return -1;
self->cxx->setAccVA2(*b);
......@@ -284,23 +284,23 @@ int PyBobLearnEMJFATrainer_set_acc_u_a1(PyBobLearnEMJFATrainerObject* self, PyOb
return -1;
}
auto o_ = make_safe(input);
// perform check on the input
// perform check on the input
if (input->type_num != NPY_FLOAT64){
PyErr_Format(PyExc_TypeError, "`%s' only supports 64-bit float arrays for input array `%s`", Py_TYPE(self)->tp_name, acc_u_a1.name());
return -1;
}
}
if (input->ndim != 3){
PyErr_Format(PyExc_TypeError, "`%s' only processes 3D arrays of float64 for `%s`", Py_TYPE(self)->tp_name, acc_u_a1.name());
return -1;
}
}
if (input->shape[0] != (Py_ssize_t)self->cxx->getAccUA1().extent(0) && input->shape[1] != (Py_ssize_t)self->cxx->getAccUA1().extent(1) && input->shape[2] != (Py_ssize_t)self->cxx->getAccUA1().extent(2)) {
PyErr_Format(PyExc_TypeError, "`%s' 3D `input` array should have the shape [%" PY_FORMAT_SIZE_T "d, %" PY_FORMAT_SIZE_T "d, %" PY_FORMAT_SIZE_T "d] not [%" PY_FORMAT_SIZE_T "d, %" PY_FORMAT_SIZE_T "d, %" PY_FORMAT_SIZE_T "d] for `%s`", Py_TYPE(self)->tp_name, (Py_ssize_t)self->cxx->getAccUA1().extent(0), (Py_ssize_t)self->cxx->getAccUA1().extent(1), (Py_ssize_t)self->cxx->getAccUA1().extent(2), (Py_ssize_t)input->shape[0], (Py_ssize_t)input->shape[1], (Py_ssize_t)input->shape[2], acc_u_a1.name());
return -1;
}
}
auto b = PyBlitzArrayCxx_AsBlitz<double,3>(input, "acc_u_a1");
if (!b) return -1;
self->cxx->setAccUA1(*b);
......@@ -328,23 +328,23 @@ int PyBobLearnEMJFATrainer_set_acc_u_a2(PyBobLearnEMJFATrainerObject* self, PyOb
return -1;
}
auto o_ = make_safe(input);
// perform check on the input
// perform check on the input
if (input->type_num != NPY_FLOAT64){
PyErr_Format(PyExc_TypeError, "`%s' only supports 64-bit float arrays for input array `%s`", Py_TYPE(self)->tp_name, acc_u_a2.name());
return -1;
}
}
if (input->ndim != 2){
PyErr_Format(PyExc_TypeError, "`%s' only processes 2D arrays of float64 for `%s`", Py_TYPE(self)->tp_name, acc_u_a2.name());
return -1;
}
}
if (input->shape[0] != (Py_ssize_t)self->cxx