Commit 57dfa257 authored by André Anjos's avatar André Anjos 💬

xbob -> bob

parent f320fde6
......@@ -25,8 +25,8 @@ install:
- "python bootstrap.py"
- "CFLAGS=-coverage ./bin/buildout"
script:
- "./bin/python -c 'from xbob.learn.linear import get_config; print(get_config())'"
- "./bin/coverage run --source=xbob.learn.linear ./bin/nosetests -sv"
- "./bin/python -c 'from bob.learn.linear import get_config; print(get_config())'"
- "./bin/coverage run --source=bob.learn.linear ./bin/nosetests -sv"
- "./bin/sphinx-build -b doctest doc sphinx"
- "./bin/sphinx-build -b html doc sphinx"
after_success:
......
include LICENSE README.rst bootstrap.py buildout.cfg
recursive-include doc conf.py *.rst
recursive-include xbob/learn/linear *.cpp *.h
recursive-include xbob/learn/linear/data *.*
recursive-include bob/learn/linear *.cpp *.h
recursive-include bob/learn/linear/data *.*
......@@ -2,16 +2,16 @@
.. Andre Anjos <andre.anjos@idiap.ch>
.. Fri 13 Dec 2013 12:35:22 CET
.. image:: https://travis-ci.org/bioidiap/xbob.learn.linear.svg?branch=master
:target: https://travis-ci.org/bioidiap/xbob.learn.linear
.. image:: https://coveralls.io/repos/bioidiap/xbob.learn.linear/badge.png
:target: https://coveralls.io/r/bioidiap/xbob.learn.linear
.. image:: http://img.shields.io/github/tag/bioidiap/xbob.learn.linear.png
:target: https://github.com/bioidiap/xbob.learn.linear
.. image:: http://img.shields.io/pypi/v/xbob.learn.linear.png
:target: https://pypi.python.org/pypi/xbob.learn.linear
.. image:: http://img.shields.io/pypi/dm/xbob.learn.linear.png
:target: https://pypi.python.org/pypi/xbob.learn.linear
.. image:: https://travis-ci.org/bioidiap/bob.learn.linear.svg?branch=master
:target: https://travis-ci.org/bioidiap/bob.learn.linear
.. image:: https://coveralls.io/repos/bioidiap/bob.learn.linear/badge.png
:target: https://coveralls.io/r/bioidiap/bob.learn.linear
.. image:: http://img.shields.io/github/tag/bioidiap/bob.learn.linear.png
:target: https://github.com/bioidiap/bob.learn.linear
.. image:: http://img.shields.io/pypi/v/bob.learn.linear.png
:target: https://pypi.python.org/pypi/bob.learn.linear
.. image:: http://img.shields.io/pypi/dm/bob.learn.linear.png
:target: https://pypi.python.org/pypi/bob.learn.linear
==============================================================
Python bindings for bob.machine's LinearMachine and Trainers
......@@ -42,7 +42,7 @@ Testing
You can run a set of tests using the nose test runner::
$ nosetests -sv xbob.learn.linear
$ nosetests -sv bob.learn.linear
.. warning::
......@@ -59,7 +59,7 @@ You can run our documentation tests using sphinx itself::
You can test overall test coverage with::
$ nosetests --with-coverage --cover-package=xbob.learn.linear
$ nosetests --with-coverage --cover-package=bob.learn.linear
The ``coverage`` egg must be installed for this to work properly.
......
......@@ -16,7 +16,7 @@
#include <bob/math/linear.h>
#include <bob/math/stats.h>
#include <xbob.learn.linear/lda.h>
#include <bob.learn.linear/lda.h>
namespace bob { namespace learn { namespace linear {
......
......@@ -9,7 +9,7 @@
#include <bob/math/linear.h>
#include <limits>
#include <xbob.learn.linear/logreg.h>
#include <bob.learn.linear/logreg.h>
namespace bob { namespace learn { namespace linear {
......
......@@ -14,7 +14,7 @@
#include <bob/core/array_copy.h>
#include <bob/math/linear.h>
#include <xbob.learn.linear/machine.h>
#include <bob.learn.linear/machine.h>
namespace bob { namespace learn { namespace linear {
......
......@@ -17,7 +17,7 @@
#include <bob/math/svd.h>
#include <bob/math/eig.h>
#include <xbob.learn.linear/pca.h>
#include <bob.learn.linear/pca.h>
namespace bob { namespace learn { namespace linear {
......
......@@ -11,7 +11,7 @@
#include <bob/math/lu.h>
#include <bob/math/stats.h>
#include <xbob.learn.linear/wccn.h>
#include <bob.learn.linear/wccn.h>
namespace bob { namespace learn { namespace linear {
......
......@@ -10,7 +10,7 @@
#include <bob/math/lu.h>
#include <bob/math/stats.h>
#include <xbob.learn.linear/whitening.h>
#include <bob.learn.linear/whitening.h>
namespace bob { namespace learn { namespace linear {
......
......@@ -2,13 +2,13 @@
* @author Andre Anjos <andre.anjos@idiap.ch>
* @date Fri 13 Dec 2013 11:50:29 CET
*
* @brief General directives for all modules in xbob.learn.linear
* @brief General directives for all modules in bob.learn.linear
*/
#ifndef XBOB_LEARN_LINEAR_CONFIG_H
#define XBOB_LEARN_LINEAR_CONFIG_H
#ifndef BOB_LEARN_LINEAR_CONFIG_H
#define BOB_LEARN_LINEAR_CONFIG_H
/* Macros that define versions and important names */
#define XBOB_LEARN_LINEAR_API_VERSION 0x0200
#define BOB_LEARN_LINEAR_API_VERSION 0x0200
#endif /* XBOB_LEARN_LINEAR_CONFIG_H */
#endif /* BOB_LEARN_LINEAR_CONFIG_H */
......@@ -7,17 +7,17 @@
* Copyright (C) 2011-2014 Idiap Research Institute, Martigny, Switzerland
*/
#define XBOB_LEARN_LINEAR_MODULE
#include <xbob.blitz/cppapi.h>
#include <xbob.blitz/cleanup.h>
#include <xbob.learn.linear/api.h>
#define BOB_LEARN_LINEAR_MODULE
#include <bob.blitz/cppapi.h>
#include <bob.blitz/cleanup.h>
#include <bob.learn.linear/api.h>
#include <structmember.h>
/*************************************************
* Implementation of FisherLDATrainer base class *
*************************************************/
PyDoc_STRVAR(s_pcatrainer_str, XBOB_EXT_MODULE_PREFIX ".FisherLDATrainer");
PyDoc_STRVAR(s_pcatrainer_str, BOB_EXT_MODULE_PREFIX ".FisherLDATrainer");
PyDoc_STRVAR(s_pcatrainer_doc,
"FisherLDATrainer([use_pinv=False [, strip_to_rank=True]]) -> new FisherLDATrainer\n\
......@@ -50,7 +50,7 @@ flags indicating a couple of optional parameters:\n\
strip_to_rank (bool) - defaults to ``True``\n\
\n\
Specifies how to calculate the final size of the\n\
to-be-trained :py:class:`xbob.learn.linear.Machine`. The\n\
to-be-trained :py:class:`bob.learn.linear.Machine`. The\n\
default setting (``True``), makes the trainer return\n\
only the K-1 eigen-values/vectors limiting the output to\n\
the rank of :math:`S_w^{-1} S_b`. If you set this value\n\
......@@ -326,11 +326,11 @@ This method also returns the eigen values allowing you to\n\
implement your own compression scheme.\n\
\n\
The user may provide or not an object of type\n\
:py:class:`xbob.learn.linear.Machine` that will be set by this\n\
:py:class:`bob.learn.linear.Machine` that will be set by this\n\
method. If provided, machine should have the correct number of\n\
inputs and outputs matching, respectively, the number of columns\n\
in the input data arrays ``X`` and the output of the method\n\
:py:meth:`xbob.learn.linear.FisherLDATrainer.output_size` (see\n\
:py:meth:`bob.learn.linear.FisherLDATrainer.output_size` (see\n\
help).\n\
\n\
The value of ``X`` should be a sequence over as many 2D 64-bit\n\
......@@ -347,7 +347,7 @@ elements as classes you want to discriminate.\n\
:py:meth:`bob.trainer.FisherLDATrainer.output_size`\n\
eigen-values and vectors on the passed machine. You can\n\
compress the machine output further using\n\
:py:meth:`xbob.learn.linear.Machine.resize` if necessary.\n\
:py:meth:`bob.learn.linear.Machine.resize` if necessary.\n\
\n\
");
......
......@@ -7,17 +7,17 @@
* Copyright (C) 2011-2014 Idiap Research Institute, Martigny, Switzerland
*/
#define XBOB_LEARN_LINEAR_MODULE
#include <xbob.blitz/cppapi.h>
#include <xbob.blitz/cleanup.h>
#include <xbob.learn.linear/api.h>
#define BOB_LEARN_LINEAR_MODULE
#include <bob.blitz/cppapi.h>
#include <bob.blitz/cleanup.h>
#include <bob.learn.linear/api.h>
#include <structmember.h>
/************************************************
* Implementation of CGLogRegTrainer base class *
************************************************/
PyDoc_STRVAR(s_logregtrainer_str, XBOB_EXT_MODULE_PREFIX ".CGLogRegTrainer");
PyDoc_STRVAR(s_logregtrainer_str, BOB_EXT_MODULE_PREFIX ".CGLogRegTrainer");
PyDoc_STRVAR(s_logregtrainer_doc,
"CGLogRegTrainer([prior=0.5, [convergence_threshold=1e-5,\n\
......@@ -231,7 +231,7 @@ negatives, positives, 2D 64-bit float arrays\n\
\n\
machine, :py:class:`Machine` (optional)\n\
The user may provide or not an object of type\n\
:py:class:`xbob.learn.linear.Machine` that will be set by this\n\
:py:class:`bob.learn.linear.Machine` that will be set by this\n\
method. If provided, the machine should have 1 output and the\n\
correct number of inputs matching the number of columns in the\n\
input data arrays.\n\
......
......@@ -7,19 +7,19 @@
* Copyright (C) 2011-2013 Idiap Research Institute, Martigny, Switzerland
*/
#define XBOB_LEARN_LINEAR_MODULE
#include <xbob.blitz/cppapi.h>
#include <xbob.blitz/cleanup.h>
#include <xbob.io.base/api.h>
#include <xbob.learn.activation/api.h>
#include <xbob.learn.linear/api.h>
#define BOB_LEARN_LINEAR_MODULE
#include <bob.blitz/cppapi.h>
#include <bob.blitz/cleanup.h>
#include <bob.io.base/api.h>
#include <bob.learn.activation/api.h>
#include <bob.learn.linear/api.h>
#include <structmember.h>
/**********************************************
* Implementation of LinearMachine base class *
**********************************************/
PyDoc_STRVAR(s_linear_str, XBOB_EXT_MODULE_PREFIX ".Machine");
PyDoc_STRVAR(s_linear_str, BOB_EXT_MODULE_PREFIX ".Machine");
PyDoc_STRVAR(s_linear_doc,
"Machine([input_size=0, [output_size=0]])\n\
......@@ -564,7 +564,7 @@ PyObject* PyBobLearnLinearMachine_Repr(PyBobLearnLinearMachineObject* self) {
/**
* Expected output:
*
* <xbob.learn.linear.Machine float64@(3, 2) [act: f(z) = tanh(z)]>
* <bob.learn.linear.Machine float64@(3, 2) [act: f(z) = tanh(z)]>
*/
using bob::machine::IdentityActivation;
......@@ -607,7 +607,7 @@ PyObject* PyBobLearnLinearMachine_Str(PyBobLearnLinearMachineObject* self) {
/**
* Expected output:
*
* xbob.learn.linear.Machine (float64) 3 inputs, 2 outputs [act: f(z) = C*z]
* bob.learn.linear.Machine (float64) 3 inputs, 2 outputs [act: f(z) = C*z]
* subtract: [ 0. 0.5 0.5]
* divide: [ 0.5 1. 1. ]
* bias: [ 0.3 -3. ]
......@@ -811,7 +811,7 @@ PyDoc_STRVAR(s_load_str, "load");
PyDoc_STRVAR(s_load_doc,
"o.load(f) -> None\n\
\n\
Loads itself from a :py:class:`xbob.io.HDF5File`\n\
Loads itself from a :py:class:`bob.io.HDF5File`\n\
\n\
");
......@@ -845,7 +845,7 @@ PyDoc_STRVAR(s_save_str, "save");
PyDoc_STRVAR(s_save_doc,
"o.save(f) -> None\n\
\n\
Saves itself at a :py:class:`xbob.io.HDF5File`\n\
Saves itself at a :py:class:`bob.io.HDF5File`\n\
\n\
");
......
......@@ -5,16 +5,16 @@
* @brief Bindings to bob::learn::linear
*/
#define XBOB_LEARN_LINEAR_MODULE
#include <xbob.learn.linear/api.h>
#define BOB_LEARN_LINEAR_MODULE
#include <bob.learn.linear/api.h>
#ifdef NO_IMPORT_ARRAY
#undef NO_IMPORT_ARRAY
#endif
#include <xbob.blitz/capi.h>
#include <xbob.blitz/cleanup.h>
#include <xbob.io.base/api.h>
#include <xbob.learn.activation/api.h>
#include <bob.blitz/capi.h>
#include <bob.blitz/cleanup.h>
#include <bob.io.base/api.h>
#include <bob.learn.activation/api.h>
static PyMethodDef module_methods[] = {
{0} /* Sentinel */
......@@ -22,12 +22,12 @@ static PyMethodDef module_methods[] = {
PyDoc_STRVAR(module_docstr, "Bob's Linear machine and trainers");
int PyXbobLearnLinear_APIVersion = XBOB_LEARN_LINEAR_API_VERSION;
int PyBobLearnLinear_APIVersion = BOB_LEARN_LINEAR_API_VERSION;
#if PY_VERSION_HEX >= 0x03000000
static PyModuleDef module_definition = {
PyModuleDef_HEAD_INIT,
XBOB_EXT_MODULE_NAME,
BOB_EXT_MODULE_NAME,
module_docstr,
-1,
module_methods,
......@@ -58,14 +58,14 @@ static PyObject* create_module (void) {
# if PY_VERSION_HEX >= 0x03000000
PyObject* m = PyModule_Create(&module_definition);
# else
PyObject* m = Py_InitModule3(XBOB_EXT_MODULE_NAME, module_methods, module_docstr);
PyObject* m = Py_InitModule3(BOB_EXT_MODULE_NAME, module_methods, module_docstr);
# endif
if (!m) return 0;
auto m_ = make_safe(m);
/* register some constants */
if (PyModule_AddIntConstant(m, "__api_version__", XBOB_LEARN_LINEAR_API_VERSION) < 0) return 0;
if (PyModule_AddStringConstant(m, "__version__", XBOB_EXT_MODULE_VERSION) < 0) return 0;
if (PyModule_AddIntConstant(m, "__api_version__", BOB_LEARN_LINEAR_API_VERSION) < 0) return 0;
if (PyModule_AddStringConstant(m, "__version__", BOB_EXT_MODULE_VERSION) < 0) return 0;
/* register the types to python */
Py_INCREF(&PyBobLearnLinearMachine_Type);
......@@ -86,7 +86,7 @@ static PyObject* create_module (void) {
Py_INCREF(&PyBobLearnLinearWCCNTrainer_Type);
if (PyModule_AddObject(m, "WCCNTrainer", (PyObject *)&PyBobLearnLinearWCCNTrainer_Type) < 0) return 0;
static void* PyXbobLearnLinear_API[PyXbobLearnLinear_API_pointers];
static void* PyBobLearnLinear_API[PyBobLearnLinear_API_pointers];
/* exhaustive list of C APIs */
......@@ -94,89 +94,89 @@ static PyObject* create_module (void) {
* Versioning *
**************/
PyXbobLearnLinear_API[PyXbobLearnLinear_APIVersion_NUM] = (void *)&PyXbobLearnLinear_APIVersion;
PyBobLearnLinear_API[PyBobLearnLinear_APIVersion_NUM] = (void *)&PyBobLearnLinear_APIVersion;
/******************************************
* Bindings for xbob.learn.linear.Machine *
* Bindings for bob.learn.linear.Machine *
******************************************/
PyXbobLearnLinear_API[PyBobLearnLinearMachine_Type_NUM] = (void *)&PyBobLearnLinearMachine_Type;
PyBobLearnLinear_API[PyBobLearnLinearMachine_Type_NUM] = (void *)&PyBobLearnLinearMachine_Type;
PyXbobLearnLinear_API[PyBobLearnLinearMachine_Check_NUM] = (void *)&PyBobLearnLinearMachine_Check;
PyBobLearnLinear_API[PyBobLearnLinearMachine_Check_NUM] = (void *)&PyBobLearnLinearMachine_Check;
PyXbobLearnLinear_API[PyBobLearnLinearMachine_NewFromSize_NUM] = (void *)&PyBobLearnLinearMachine_NewFromSize;
PyBobLearnLinear_API[PyBobLearnLinearMachine_NewFromSize_NUM] = (void *)&PyBobLearnLinearMachine_NewFromSize;
/*********************************************
* Bindings for xbob.learn.linear.PCATrainer *
* Bindings for bob.learn.linear.PCATrainer *
*********************************************/
PyXbobLearnLinear_API[PyBobLearnLinearPCATrainer_Type_NUM] = (void *)&PyBobLearnLinearPCATrainer_Type;
PyBobLearnLinear_API[PyBobLearnLinearPCATrainer_Type_NUM] = (void *)&PyBobLearnLinearPCATrainer_Type;
PyXbobLearnLinear_API[PyBobLearnLinearPCATrainer_Check_NUM] = (void *)&PyBobLearnLinearPCATrainer_Check;
PyBobLearnLinear_API[PyBobLearnLinearPCATrainer_Check_NUM] = (void *)&PyBobLearnLinearPCATrainer_Check;
/***************************************************
* Bindings for xbob.learn.linear.FisherLDATrainer *
* Bindings for bob.learn.linear.FisherLDATrainer *
***************************************************/
PyXbobLearnLinear_API[PyBobLearnLinearFisherLDATrainer_Type_NUM] = (void *)&PyBobLearnLinearFisherLDATrainer_Type;
PyBobLearnLinear_API[PyBobLearnLinearFisherLDATrainer_Type_NUM] = (void *)&PyBobLearnLinearFisherLDATrainer_Type;
PyXbobLearnLinear_API[PyBobLearnLinearFisherLDATrainer_Check_NUM] = (void *)&PyBobLearnLinearFisherLDATrainer_Check;
PyBobLearnLinear_API[PyBobLearnLinearFisherLDATrainer_Check_NUM] = (void *)&PyBobLearnLinearFisherLDATrainer_Check;
/**************************************************
* Bindings for xbob.learn.linear.CGLogRegTrainer *
* Bindings for bob.learn.linear.CGLogRegTrainer *
**************************************************/
PyXbobLearnLinear_API[PyBobLearnLinearCGLogRegTrainer_Type_NUM] = (void *)&PyBobLearnLinearCGLogRegTrainer_Type;
PyBobLearnLinear_API[PyBobLearnLinearCGLogRegTrainer_Type_NUM] = (void *)&PyBobLearnLinearCGLogRegTrainer_Type;
PyXbobLearnLinear_API[PyBobLearnLinearCGLogRegTrainer_Check_NUM] = (void *)&PyBobLearnLinearCGLogRegTrainer_Check;
PyBobLearnLinear_API[PyBobLearnLinearCGLogRegTrainer_Check_NUM] = (void *)&PyBobLearnLinearCGLogRegTrainer_Check;
/***************************************************
* Bindings for xbob.learn.linear.WhiteningTrainer *
* Bindings for bob.learn.linear.WhiteningTrainer *
***************************************************/
PyXbobLearnLinear_API[PyBobLearnLinearWhiteningTrainer_Type_NUM] = (void *)&PyBobLearnLinearWhiteningTrainer_Type;
PyBobLearnLinear_API[PyBobLearnLinearWhiteningTrainer_Type_NUM] = (void *)&PyBobLearnLinearWhiteningTrainer_Type;
PyXbobLearnLinear_API[PyBobLearnLinearWhiteningTrainer_Check_NUM] = (void *)&PyBobLearnLinearWhiteningTrainer_Check;
PyBobLearnLinear_API[PyBobLearnLinearWhiteningTrainer_Check_NUM] = (void *)&PyBobLearnLinearWhiteningTrainer_Check;
/***************************************************
* Bindings for xbob.learn.linear.WCCNTrainer *
* Bindings for bob.learn.linear.WCCNTrainer *
***************************************************/
PyXbobLearnLinear_API[PyBobLearnLinearWCCNTrainer_Type_NUM] = (void *)&PyBobLearnLinearWCCNTrainer_Type;
PyBobLearnLinear_API[PyBobLearnLinearWCCNTrainer_Type_NUM] = (void *)&PyBobLearnLinearWCCNTrainer_Type;
PyXbobLearnLinear_API[PyBobLearnLinearWCCNTrainer_Check_NUM] = (void *)&PyBobLearnLinearWCCNTrainer_Check;
PyBobLearnLinear_API[PyBobLearnLinearWCCNTrainer_Check_NUM] = (void *)&PyBobLearnLinearWCCNTrainer_Check;
#if PY_VERSION_HEX >= 0x02070000
/* defines the PyCapsule */
PyObject* c_api_object = PyCapsule_New((void *)PyXbobLearnLinear_API,
XBOB_EXT_MODULE_PREFIX "." XBOB_EXT_MODULE_NAME "._C_API", 0);
PyObject* c_api_object = PyCapsule_New((void *)PyBobLearnLinear_API,
BOB_EXT_MODULE_PREFIX "." BOB_EXT_MODULE_NAME "._C_API", 0);
#else
PyObject* c_api_object = PyCObject_FromVoidPtr((void *)PyXbobLearnLinear_API, 0);
PyObject* c_api_object = PyCObject_FromVoidPtr((void *)PyBobLearnLinear_API, 0);
#endif
if (c_api_object) PyModule_AddObject(m, "_C_API", c_api_object);
/* imports dependencies */
if (import_xbob_blitz() < 0) {
if (import_bob_blitz() < 0) {
PyErr_Print();
PyErr_Format(PyExc_ImportError, "cannot import `%s'", XBOB_EXT_MODULE_NAME);
PyErr_Format(PyExc_ImportError, "cannot import `%s'", BOB_EXT_MODULE_NAME);
return 0;
}
if (import_xbob_io_base() < 0) {
if (import_bob_io_base() < 0) {
PyErr_Print();
PyErr_Format(PyExc_ImportError, "cannot import `%s'", XBOB_EXT_MODULE_NAME);
PyErr_Format(PyExc_ImportError, "cannot import `%s'", BOB_EXT_MODULE_NAME);
return 0;
}
if (import_xbob_learn_activation() < 0) {
if (import_bob_learn_activation() < 0) {
PyErr_Print();
PyErr_Format(PyExc_ImportError, "cannot import `%s'", XBOB_EXT_MODULE_NAME);
PyErr_Format(PyExc_ImportError, "cannot import `%s'", BOB_EXT_MODULE_NAME);
return 0;
}
......@@ -185,7 +185,7 @@ static PyObject* create_module (void) {
}
PyMODINIT_FUNC XBOB_EXT_ENTRY_NAME (void) {
PyMODINIT_FUNC BOB_EXT_ENTRY_NAME (void) {
# if PY_VERSION_HEX >= 0x03000000
return
# endif
......
......@@ -7,17 +7,17 @@
* Copyright (C) 2011-2014 Idiap Research Institute, Martigny, Switzerland
*/
#define XBOB_LEARN_LINEAR_MODULE
#include <xbob.blitz/cppapi.h>
#include <xbob.blitz/cleanup.h>
#include <xbob.learn.linear/api.h>
#define BOB_LEARN_LINEAR_MODULE
#include <bob.blitz/cppapi.h>
#include <bob.blitz/cleanup.h>
#include <bob.learn.linear/api.h>
#include <structmember.h>
/*******************************************
* Implementation of PCATrainer base class *
*******************************************/
PyDoc_STRVAR(s_pcatrainer_str, XBOB_EXT_MODULE_PREFIX ".PCATrainer");
PyDoc_STRVAR(s_pcatrainer_str, BOB_EXT_MODULE_PREFIX ".PCATrainer");
PyDoc_STRVAR(s_pcatrainer_doc,
"PCATrainer([use_svd=True]) -> new PCATrainer\n\
......@@ -113,10 +113,10 @@ corresponds to its eigen values.\n\
Our implementation uses LAPACK's ``dgesdd`` to compute the\n\
solution to this linear equation.\n\
\n\
The corresponding :py:class:`xbob.learn.Linear.Machine` and\n\
The corresponding :py:class:`bob.learn.Linear.Machine` and\n\
returned eigen-values of :math:`\\Sigma`, are pre-sorted in\n\
descending order (the first eigen-vector - or column - of the\n\
weight matrix in the :py:class:`xbob.learn.Linear.Machine`\n\
weight matrix in the :py:class:`bob.learn.Linear.Machine`\n\
corresponds to the highest eigen value obtained).\n\
\n\
.. note::\n\
......@@ -311,11 +311,11 @@ rows in ``X`` (samples) and :math:`F` the number of columns\n\
eigen-value automatically. You don't need to sort the results.\n\
\n\
The user may provide or not an object of type\n\
:py:class:`xbob.learn.linear.Machine` that will be set by this\n\
:py:class:`bob.learn.linear.Machine` that will be set by this\n\
method. If provided, machine should have the correct number of\n\
inputs and outputs matching, respectively, the number of columns\n\
in the input data array ``X`` and the output of the method\n\
:py:meth:`xbob.learn.linear.PCATrainer.output_size` (see\n\
:py:meth:`bob.learn.linear.PCATrainer.output_size` (see\n\
help).\n\
\n\
The input data matrix :math:`X` should correspond to a 64-bit\n\
......
......@@ -16,10 +16,10 @@ import numpy
from . import Machine, PCATrainer, FisherLDATrainer, CGLogRegTrainer, \
WhiteningTrainer, WCCNTrainer
import xbob.io.base
from xbob.learn.activation import HyperbolicTangent, Identity
from xbob.io.base import HDF5File
from xbob.io.base.test_utils import datafile
import bob.io.base
from bob.learn.activation import HyperbolicTangent, Identity
from bob.io.base import HDF5File
from bob.io.base.test_utils import datafile
def F(f):
"""Returns the test file on the "data" subdirectory"""
......@@ -777,11 +777,11 @@ def test_cglogreg_norm():
# read some real test data;
# for toy examples the results are quite different...
pos1 = xbob.io.base.load(datafile('positives_isv.hdf5', __name__))
neg1 = xbob.io.base.load(datafile('negatives_isv.hdf5', __name__))
pos1 = bob.io.base.load(datafile('positives_isv.hdf5', __name__))
neg1 = bob.io.base.load(datafile('negatives_isv.hdf5', __name__))
pos2 = xbob.io.base.load(datafile('positives_lda.hdf5', __name__))
neg2 = xbob.io.base.load(datafile('negatives_lda.hdf5', __name__))
pos2 = bob.io.base.load(datafile('positives_lda.hdf5', __name__))
neg2 = bob.io.base.load(datafile('negatives_lda.hdf5', __name__))
negatives = numpy.vstack((neg1, neg2)).T
positives = numpy.vstack((pos1, pos2)).T
......@@ -821,11 +821,11 @@ def test_cglogreg_norm():
@nose.tools.nottest
def test_cglogreg_norm_slow():
pos1 = xbob.io.base.load(datafile('positives_isv.hdf5', __name__))
neg1 = xbob.io.base.load(datafile('negatives_isv.hdf5', __name__))
pos1 = bob.io.base.load(datafile('positives_isv.hdf5', __name__))
neg1 = bob.io.base.load(datafile('negatives_isv.hdf5', __name__))
pos2 = xbob.io.base.load(datafile('positives_lda.hdf5', __name__))
neg2 = xbob.io.base.load(datafile('negatives_lda.hdf5', __name__))
pos2 = bob.io.base.load(datafile('positives_lda.hdf5', __name__))
neg2 = bob.io.base.load(datafile('negatives_lda.hdf5', __name__))
negatives = numpy.vstack((neg1, neg2)).T
positives = numpy.vstack((pos1, pos2)).T
......
......@@ -19,11 +19,11 @@
#ifdef NO_IMPORT_ARRAY
#undef NO_IMPORT_ARRAY
#endif
#include <xbob.blitz/capi.h>
#include <xbob.blitz/cleanup.h>
#include <xbob.io.base/config.h>
#include <xbob.learn.activation/config.h>
#include <xbob.learn.linear/config.h>
#include <bob.blitz/capi.h>
#include <bob.blitz/cleanup.h>
#include <bob.io.base/config.h>
#include <bob.learn.activation/config.h>
#include <bob.learn.linear/config.h>
static int dict_set(PyObject* d, const char* key, const char* value) {
PyObject* v = Py_BuildValue("s", value);
......@@ -99,24 +99,24 @@ static PyObject* numpy_version() {
}
/**
* xbob.blitz c/c++ api version
* bob.blitz c/c++ api version
*/
static PyObject* xbob_blitz_version() {
return Py_BuildValue("{ss}", "api", BOOST_PP_STRINGIZE(XBOB_BLITZ_API_VERSION));
static PyObject* bob_blitz_version() {
return Py_BuildValue("{ss}", "api", BOOST_PP_STRINGIZE(BOB_BLITZ_API_VERSION));
}
/**
* xbob.io.base c/c++ api version
* bob.io.base c/c++ api version
*/
static PyObject* xbob_io_base_version() {
return Py_BuildValue("{ss}", "api", BOOST_PP_STRINGIZE(XBOB_IO_BASE_API_VERSION));
static PyObject* bob_io_base_version() {
return Py_BuildValue("{ss}", "api", BOOST_PP_STRINGIZE(BOB_IO_BASE_API_VERSION));
}
/**
* xbob.io c/c++ api version
* bob.io c/c++ api version
*/
static PyObject* xbob_learn_activation_version() {
return Py_BuildValue("{ss}", "api", BOOST_PP_STRINGIZE(XBOB_LEARN_ACTIVATION_API_VERSION));
static PyObject* bob_learn_activation_version() {
return Py_BuildValue("{ss}", "api", BOOST_PP_STRINGIZE(BOB_LEARN_ACTIVATION_API_VERSION));
}
static PyObject* build_version_dictionary() {
......@@ -130,9 +130,9 @@ static PyObject* build_version_dictionary() {
if (!dict_steal(retval, "Compiler", compiler_version())) return 0;
if (!dict_steal(retval, "Python", python_version())) return 0;
if (!dict_steal(retval, "NumPy", numpy_version())) return 0;
if (!dict_steal(retval, "xbob.blitz", xbob_blitz_version())) return 0;
if (!dict_steal(retval, "xbob.io", xbob_io_base_version())) return 0;
if (!dict_steal(retval, "xbob.learn.activation", xbob_learn_activation_version())) return 0;
if (!dict_steal(retval, "bob.blitz", bob_blitz_version())) return 0;
if (!dict_steal(retval, "bob.io", bob_io_base_version())) return 0;
if (!dict_steal(retval, "bob.learn.activation", bob_learn_activation_version())) return 0;
if (!dict_steal(retval, "Bob", bob_version())) return 0;
Py_INCREF(retval);
......@@ -150,7 +150,7 @@ PyDoc_STRVAR(module_docstr,
#if PY_VERSION_HEX >= 0x03000000
static PyModuleDef module_definition = {
PyModuleDef_HEAD_INIT,
XBOB_EXT_MODULE_NAME,
BOB_EXT_MODULE_NAME,
module_docstr,
-1,
module_methods,
......@@ -163,15 +163,15 @@ static PyObject* create_module (void) {
# if PY_VERSION_HEX >= 0x03000000
PyObject* m = PyModule_Create(&module_definition);
# else
PyObject* m = Py_InitModule3(XBOB_EXT_MODULE_NAME, module_methods, module_docstr);
PyObject* m = Py_InitModule3(BOB_EXT_MODULE_NAME, module_methods, module_docstr);
# endif
if (!m) return 0;
auto m_ = make_safe(m); ///< protects against early returns
/* register version numbers and constants */
if (PyModule_AddIntConstant(m, "api", XBOB_LEARN_LINEAR_API_VERSION) < 0)
if (PyModule_AddIntConstant(m, "api", BOB_LEARN_LINEAR_API_VERSION) < 0)
return 0;
if (PyModule_AddStringConstant(m, "module", XBOB_EXT_MODULE_VERSION) < 0)
if (PyModule_AddStringConstant(m, "module", BOB_EXT_MODULE_VERSION) < 0)
return 0;
PyObject* externals = build_version_dictionary();
......@@ -179,9 +179,9 @@ static PyObject* create_module (void) {
if (PyModule_AddObject(m, "externals", externals) < 0) return 0;
/* imports dependencies */
if (import_xbob_blitz() < 0) {
if (import_bob_blitz() < 0) {
PyErr_Print();
PyErr_Format(PyExc_ImportError, "cannot import `%s'", XBOB_EXT_MODULE_NAME);
PyErr_Format(PyExc_ImportError, "cannot import `%s'", BOB_EXT_MODULE_NAME);
return 0;
}
......@@ -190,7 +190,7 @@ static PyObject* create_module (void) {
}
PyMODINIT_FUNC XBOB_EXT_ENTRY_NAME (void) {
PyMODINIT_FUNC BOB_EXT_ENTRY_NAME (void) {
# if PY_VERSION_HEX >= 0x03000000
return
# endif
......
......@@ -7,18 +7,18 @@
* Copyright (C) 2011-2014 Idiap Research Institute, Martigny, Switzerland