Skip to content
Snippets Groups Projects
Commit 49e7f41b authored by André Anjos's avatar André Anjos :speech_balloon:
Browse files

xbob -> bob

parent b965f010
No related branches found
No related tags found
No related merge requests found
Showing
with 195 additions and 181 deletions
......@@ -25,8 +25,8 @@ install:
- "python bootstrap.py"
- "CFLAGS=-coverage ./bin/buildout"
script:
- "./bin/python -c 'from xbob.learn.activation import get_config; print(get_config())'"
- "./bin/coverage run --source=xbob.learn.activation ./bin/nosetests -sv"
- "./bin/python -c 'from bob.learn.activation import get_config; print(get_config())'"
- "./bin/coverage run --source=bob.learn.activation ./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/activation *.cpp *.h
recursive-include bob/learn/activation *.cpp *.h
......@@ -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.activation.svg?branch=master
:target: https://travis-ci.org/bioidiap/xbob.learn.activation
.. image:: https://coveralls.io/repos/bioidiap/xbob.learn.activation/badge.png
:target: https://coveralls.io/r/bioidiap/xbob.learn.activation
.. image:: http://img.shields.io/github/tag/bioidiap/xbob.learn.activation.png
:target: https://github.com/bioidiap/xbob.learn.activation
.. image:: http://img.shields.io/pypi/v/xbob.learn.activation.png
:target: https://pypi.python.org/pypi/xbob.learn.activation
.. image:: http://img.shields.io/pypi/dm/xbob.learn.activation.png
:target: https://pypi.python.org/pypi/xbob.learn.activation
.. image:: https://travis-ci.org/bioidiap/bob.learn.activation.svg?branch=master
:target: https://travis-ci.org/bioidiap/bob.learn.activation
.. image:: https://coveralls.io/repos/bioidiap/bob.learn.activation/badge.png
:target: https://coveralls.io/r/bioidiap/bob.learn.activation
.. image:: http://img.shields.io/github/tag/bioidiap/bob.learn.activation.png
:target: https://github.com/bioidiap/bob.learn.activation
.. image:: http://img.shields.io/pypi/v/bob.learn.activation.png
:target: https://pypi.python.org/pypi/bob.learn.activation
.. image:: http://img.shields.io/pypi/dm/bob.learn.activation.png
:target: https://pypi.python.org/pypi/bob.learn.activation
=======================================================
Python bindings for bob.machine's Activation functors
......@@ -42,7 +42,7 @@ Testing
You can run a set of tests using the nose test runner::
$ nosetests -sv xbob.learn.activation
$ nosetests -sv bob.learn.activation
.. 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.activation
$ nosetests --with-coverage --cover-package=bob.learn.activation
The ``coverage`` egg must be installed for this to work properly.
......
File moved
File moved
......@@ -7,11 +7,11 @@
* Copyright (C) 2011-2014 Idiap Research Institute, Martigny, Switzerland
*/
#define XBOB_LEARN_ACTIVATION_MODULE
#include <xbob.learn.activation/api.h>
#include <xbob.io.base/api.h>
#include <xbob.blitz/cppapi.h>
#include <xbob.blitz/cleanup.h>
#define BOB_LEARN_ACTIVATION_MODULE
#include <bob.learn.activation/api.h>
#include <bob.io.base/api.h>
#include <bob.blitz/cppapi.h>
#include <bob.blitz/cleanup.h>
#include <bob/machine/Activation.h>
#include <boost/bind.hpp>
#include <boost/function.hpp>
......@@ -21,7 +21,7 @@
* Implementation of Activation base class *
*******************************************/
PyDoc_STRVAR(s_activation_str, XBOB_EXT_MODULE_PREFIX ".Activation");
PyDoc_STRVAR(s_activation_str, BOB_EXT_MODULE_PREFIX ".Activation");
PyDoc_STRVAR(s_activation_doc,
"Base class for activation functors.\n\
......@@ -429,7 +429,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\
");
......@@ -463,7 +463,7 @@ PyDoc_STRVAR(s_save_str, "save");
PyDoc_STRVAR(s_save_doc,
"o.save(f) -> None\n\
\n\
Saves itself to a :py:class:`xbob.io.HDF5File`\n\
Saves itself to a :py:class:`bob.io.HDF5File`\n\
\n\
");
......
......@@ -5,11 +5,11 @@
* @brief Implementation of the Identity Activation function
*/
#define XBOB_LEARN_ACTIVATION_MODULE
#include <xbob.learn.activation/api.h>
#define BOB_LEARN_ACTIVATION_MODULE
#include <bob.learn.activation/api.h>
PyDoc_STRVAR(s_identityactivation_str,
XBOB_EXT_MODULE_PREFIX ".Identity");
BOB_EXT_MODULE_PREFIX ".Identity");
PyDoc_STRVAR(s_identityactivation_doc,
"Identity() -> new Identity activation functor\n\
......
......@@ -5,16 +5,16 @@
* @brief C/C++ Python API for activation functors in bob::machine
*/
#ifndef XBOB_LEARN_ACTIVATION_H
#define XBOB_LEARN_ACTIVATION_H
#ifndef BOB_LEARN_ACTIVATION_H
#define BOB_LEARN_ACTIVATION_H
#include <Python.h>
#include <xbob.learn.activation/config.h>
#include <bob.learn.activation/config.h>
#include <bob/machine/Activation.h>
#include <bob/machine/LinearMachine.h>
#define XBOB_LEARN_ACTIVATION_MODULE_PREFIX xbob.learn.activation
#define XBOB_LEARN_ACTIVATION_MODULE_NAME _library
#define BOB_LEARN_ACTIVATION_MODULE_PREFIX bob.learn.activation
#define BOB_LEARN_ACTIVATION_MODULE_NAME _library
/*******************
* C API functions *
......@@ -22,33 +22,33 @@
/* Enum defining entries in the function table */
enum _PyBobLearnActivation_ENUM{
PyXbobLearnActivation_APIVersion_NUM = 0,
// Bindings for xbob.learn.activation.Activation
PyBobLearnActivation_APIVersion_NUM = 0,
// Bindings for bob.learn.activation.Activation
PyBobLearnActivation_Type_NUM,
PyBobLearnActivation_Check_NUM,
PyBobLearnActivation_NewFromActivation_NUM,
// Bindings for xbob.learn.activation.Identity
// Bindings for bob.learn.activation.Identity
PyBobLearnIdentityActivation_Type_NUM,
// Bindings for xbob.learn.activation.Linear
// Bindings for bob.learn.activation.Linear
PyBobLearnLinearActivation_Type_NUM,
// Bindings for xbob.learn.activation.Logistic
// Bindings for bob.learn.activation.Logistic
PyBobLearnLogisticActivation_Type_NUM,
// Bindings for xbob.learn.activation.HyperbolicTangent
// Bindings for bob.learn.activation.HyperbolicTangent
PyBobLearnHyperbolicTangentActivation_Type_NUM,
// Bindings for xbob.learn.activation.MultipliedHyperbolicTangent
// Bindings for bob.learn.activation.MultipliedHyperbolicTangent
PyBobLearnMultipliedHyperbolicTangentActivation_Type_NUM,
// Total number of C API pointers
PyXbobLearnActivation_API_pointers
PyBobLearnActivation_API_pointers
};
/**************
* Versioning *
**************/
#define PyXbobLearnActivation_APIVersion_TYPE int
#define PyBobLearnActivation_APIVersion_TYPE int
/*************************************************
* Bindings for xbob.learn.activation.Activation *
* Bindings for bob.learn.activation.Activation *
*************************************************/
typedef struct {
......@@ -65,7 +65,7 @@ typedef struct {
#define PyBobLearnActivation_NewFromActivation_PROTO (boost::shared_ptr<bob::machine::Activation> a)
/***********************************************
* Bindings for xbob.learn.activation.Identity *
* Bindings for bob.learn.activation.Identity *
***********************************************/
typedef struct {
......@@ -76,7 +76,7 @@ typedef struct {
#define PyBobLearnIdentityActivation_Type_TYPE PyTypeObject
/*********************************************
* Bindings for xbob.learn.activation.Linear *
* Bindings for bob.learn.activation.Linear *
*********************************************/
typedef struct {
......@@ -87,7 +87,7 @@ typedef struct {
#define PyBobLearnLinearActivation_Type_TYPE PyTypeObject
/***********************************************
* Bindings for xbob.learn.activation.Logistic *
* Bindings for bob.learn.activation.Logistic *
***********************************************/
typedef struct {
......@@ -98,7 +98,7 @@ typedef struct {
#define PyBobLearnLogisticActivation_Type_TYPE PyTypeObject
/********************************************************
* Bindings for xbob.learn.activation.HyperbolicTangent *
* Bindings for bob.learn.activation.HyperbolicTangent *
********************************************************/
typedef struct {
......@@ -109,7 +109,7 @@ typedef struct {
#define PyBobLearnHyperbolicTangentActivation_Type_TYPE PyTypeObject
/******************************************************************
* Bindings for xbob.learn.activation.MultipliedHyperbolicTangent *
* Bindings for bob.learn.activation.MultipliedHyperbolicTangent *
******************************************************************/
typedef struct {
......@@ -120,18 +120,18 @@ typedef struct {
#define PyBobLearnMultipliedHyperbolicTangentActivation_Type_TYPE PyTypeObject
#ifdef XBOB_LEARN_ACTIVATION_MODULE
#ifdef BOB_LEARN_ACTIVATION_MODULE
/* This section is used when compiling `xbob.learn.activation' itself */
/* This section is used when compiling `bob.learn.activation' itself */
/**************
* Versioning *
**************/
extern int PyXbobLearnActivation_APIVersion;
extern int PyBobLearnActivation_APIVersion;
/*************************************************
* Bindings for xbob.learn.activation.Activation *
* Bindings for bob.learn.activation.Activation *
*************************************************/
extern PyBobLearnActivation_Type_TYPE PyBobLearnActivation_Type;
......@@ -141,38 +141,38 @@ typedef struct {
PyBobLearnActivation_NewFromActivation_RET PyBobLearnActivation_NewFromActivation PyBobLearnActivation_NewFromActivation_PROTO;
/***********************************************
* Bindings for xbob.learn.activation.Identity *
* Bindings for bob.learn.activation.Identity *
***********************************************/
extern PyBobLearnIdentityActivation_Type_TYPE PyBobLearnIdentityActivation_Type;
/*********************************************
* Bindings for xbob.learn.activation.Linear *
* Bindings for bob.learn.activation.Linear *
*********************************************/
extern PyBobLearnLinearActivation_Type_TYPE PyBobLearnLinearActivation_Type;
/***********************************************
* Bindings for xbob.learn.activation.Logistic *
* Bindings for bob.learn.activation.Logistic *
***********************************************/
extern PyBobLearnLogisticActivation_Type_TYPE PyBobLearnLogisticActivation_Type;
/********************************************************
* Bindings for xbob.learn.activation.HyperbolicTangent *
* Bindings for bob.learn.activation.HyperbolicTangent *
********************************************************/
extern PyBobLearnHyperbolicTangentActivation_Type_TYPE PyBobLearnHyperbolicTangentActivation_Type;
/******************************************************************
* Bindings for xbob.learn.activation.MultipliedHyperbolicTangent *
* Bindings for bob.learn.activation.MultipliedHyperbolicTangent *
******************************************************************/
extern PyBobLearnMultipliedHyperbolicTangentActivation_Type_TYPE PyBobLearnMultipliedHyperbolicTangentActivation_Type;
#else
/* This section is used in modules that use `xbob.learn.activation's' C-API */
/* This section is used in modules that use `bob.learn.activation's' C-API */
/************************************************************************
* Macros to avoid symbol collision and allow for separate compilation. *
......@@ -181,18 +181,18 @@ typedef struct {
************************************************************************/
# if defined(PY_ARRAY_UNIQUE_SYMBOL)
# define XBOB_LEARN_ACTIVATION_MAKE_API_NAME_INNER(a) XBOB_LEARN_ACTIVATION_ ## a
# define XBOB_LEARN_ACTIVATION_MAKE_API_NAME(a) XBOB_LEARN_ACTIVATION_MAKE_API_NAME_INNER(a)
# define PyXbobLearnActivation_API XBOB_LEARN_ACTIVATION_MAKE_API_NAME(PY_ARRAY_UNIQUE_SYMBOL)
# define BOB_LEARN_ACTIVATION_MAKE_API_NAME_INNER(a) BOB_LEARN_ACTIVATION_ ## a
# define BOB_LEARN_ACTIVATION_MAKE_API_NAME(a) BOB_LEARN_ACTIVATION_MAKE_API_NAME_INNER(a)
# define PyBobLearnActivation_API BOB_LEARN_ACTIVATION_MAKE_API_NAME(PY_ARRAY_UNIQUE_SYMBOL)
# endif
# if defined(NO_IMPORT_ARRAY)
extern void **PyXbobLearnActivation_API;
extern void **PyBobLearnActivation_API;
# else
# if defined(PY_ARRAY_UNIQUE_SYMBOL)
void **PyXbobLearnActivation_API;
void **PyBobLearnActivation_API;
# else
static void **PyXbobLearnActivation_API=NULL;
static void **PyBobLearnActivation_API=NULL;
# endif
# endif
......@@ -200,47 +200,47 @@ typedef struct {
* Versioning *
**************/
# define PyXbobLearnActivation_APIVersion (*(PyXbobLearnActivation_APIVersion_TYPE *)PyXbobLearnActivation_API[PyXbobLearnActivation_APIVersion_NUM])
# define PyBobLearnActivation_APIVersion (*(PyBobLearnActivation_APIVersion_TYPE *)PyBobLearnActivation_API[PyBobLearnActivation_APIVersion_NUM])
/*************************************************
* Bindings for xbob.learn.activation.Activation *
* Bindings for bob.learn.activation.Activation *
*************************************************/
# define PyBobLearnActivation_Type (*(PyBobLearnActivation_Type_TYPE *)PyXbobLearnActivation_API[PyBobLearnActivation_Type_NUM])
# define PyBobLearnActivation_Type (*(PyBobLearnActivation_Type_TYPE *)PyBobLearnActivation_API[PyBobLearnActivation_Type_NUM])
# define PyBobLearnActivation_Check (*(PyBobLearnActivation_Check_RET (*)PyBobLearnActivation_Check_PROTO) PyXbobLearnActivation_API[PyBobLearnActivation_Check_NUM])
# define PyBobLearnActivation_Check (*(PyBobLearnActivation_Check_RET (*)PyBobLearnActivation_Check_PROTO) PyBobLearnActivation_API[PyBobLearnActivation_Check_NUM])
# define PyBobLearnActivation_NewFromActivation (*(PyBobLearnActivation_NewFromActivation_RET (*)PyBobLearnActivation_NewFromActivation_PROTO) PyXbobLearnActivation_API[PyBobLearnActivation_NewFromActivation_NUM])
# define PyBobLearnActivation_NewFromActivation (*(PyBobLearnActivation_NewFromActivation_RET (*)PyBobLearnActivation_NewFromActivation_PROTO) PyBobLearnActivation_API[PyBobLearnActivation_NewFromActivation_NUM])
/***********************************************
* Bindings for xbob.learn.activation.Identity *
* Bindings for bob.learn.activation.Identity *
***********************************************/
# define PyBobLearnIdentityActivation_Type (*(PyBobLearnIdentityActivation_Type_TYPE *)PyXbobLearnActivation_API[PyBobLearnIdentityActivation_Type_NUM])
# define PyBobLearnIdentityActivation_Type (*(PyBobLearnIdentityActivation_Type_TYPE *)PyBobLearnActivation_API[PyBobLearnIdentityActivation_Type_NUM])
/*********************************************
* Bindings for xbob.learn.activation.Linear *
* Bindings for bob.learn.activation.Linear *
*********************************************/
# define PyBobLearnLinearActivation_Type (*(PyBobLearnLinearActivation_Type_TYPE *)PyXbobLearnActivation_API[PyBobLearnLinearActivation_Type_NUM])
# define PyBobLearnLinearActivation_Type (*(PyBobLearnLinearActivation_Type_TYPE *)PyBobLearnActivation_API[PyBobLearnLinearActivation_Type_NUM])
/***********************************************
* Bindings for xbob.learn.activation.Logistic *
* Bindings for bob.learn.activation.Logistic *
***********************************************/
# define PyBobLearnLogisticActivation_Type (*(PyBobLearnLogisticActivation_Type_TYPE *)PyXbobLearnActivation_API[PyBobLearnLogisticActivation_Type_NUM])
# define PyBobLearnLogisticActivation_Type (*(PyBobLearnLogisticActivation_Type_TYPE *)PyBobLearnActivation_API[PyBobLearnLogisticActivation_Type_NUM])
/********************************************************
* Bindings for xbob.learn.activation.HyperbolicTangent *
* Bindings for bob.learn.activation.HyperbolicTangent *
********************************************************/
# define PyBobLearnHyperbolicTangentActivation_Type (*(PyBobLearnHyperbolicTangentActivation_Type_TYPE *)PyXbobLearnActivation_API[PyBobLearnHyperbolicTangentActivation_Type_NUM])
# define PyBobLearnHyperbolicTangentActivation_Type (*(PyBobLearnHyperbolicTangentActivation_Type_TYPE *)PyBobLearnActivation_API[PyBobLearnHyperbolicTangentActivation_Type_NUM])
/******************************************************************
* Bindings for xbob.learn.activation.MultipliedHyperbolicTangent *
* Bindings for bob.learn.activation.MultipliedHyperbolicTangent *
******************************************************************/
# define PyBobLearnMultipliedHyperbolicTangentActivation_Type (*(PyBobLearnMultipliedHyperbolicTangentActivation_Type_TYPE *)PyXbobLearnActivation_API[PyBobLearnMultipliedHyperbolicTangentActivation_Type_NUM])
# define PyBobLearnMultipliedHyperbolicTangentActivation_Type (*(PyBobLearnMultipliedHyperbolicTangentActivation_Type_TYPE *)PyBobLearnActivation_API[PyBobLearnMultipliedHyperbolicTangentActivation_Type_NUM])
# if !defined(NO_IMPORT_ARRAY)
......@@ -248,12 +248,12 @@ typedef struct {
* Returns -1 on error, 0 on success. PyCapsule_Import will set an exception
* if there's an error.
*/
static int import_xbob_learn_activation(void) {
static int import_bob_learn_activation(void) {
PyObject *c_api_object;
PyObject *module;
module = PyImport_ImportModule(BOOST_PP_STRINGIZE(XBOB_LEARN_ACTIVATION_MODULE_PREFIX) "." BOOST_PP_STRINGIZE(XBOB_LEARN_ACTIVATION_MODULE_NAME));
module = PyImport_ImportModule(BOOST_PP_STRINGIZE(BOB_LEARN_ACTIVATION_MODULE_PREFIX) "." BOOST_PP_STRINGIZE(BOB_LEARN_ACTIVATION_MODULE_NAME));
if (module == NULL) return -1;
......@@ -266,35 +266,35 @@ typedef struct {
# if PY_VERSION_HEX >= 0x02070000
if (PyCapsule_CheckExact(c_api_object)) {
PyXbobLearnActivation_API = (void **)PyCapsule_GetPointer(c_api_object,
PyBobLearnActivation_API = (void **)PyCapsule_GetPointer(c_api_object,
PyCapsule_GetName(c_api_object));
}
# else
if (PyCObject_Check(c_api_object)) {
PyXbobLearnActivation_API = (void **)PyCObject_AsVoidPtr(c_api_object);
PyBobLearnActivation_API = (void **)PyCObject_AsVoidPtr(c_api_object);
}
# endif
Py_DECREF(c_api_object);
Py_DECREF(module);
if (!PyXbobLearnActivation_API) {
if (!PyBobLearnActivation_API) {
PyErr_Format(PyExc_ImportError,
# if PY_VERSION_HEX >= 0x02070000
"cannot find C/C++ API capsule at `%s.%s._C_API'",
# else
"cannot find C/C++ API cobject at `%s.%s._C_API'",
# endif
BOOST_PP_STRINGIZE(XBOB_LEARN_ACTIVATION_MODULE_PREFIX),
BOOST_PP_STRINGIZE(XBOB_LEARN_ACTIVATION_MODULE_NAME));
BOOST_PP_STRINGIZE(BOB_LEARN_ACTIVATION_MODULE_PREFIX),
BOOST_PP_STRINGIZE(BOB_LEARN_ACTIVATION_MODULE_NAME));
return -1;
}
/* Checks that the imported version matches the compiled version */
int imported_version = *(int*)PyXbobLearnActivation_API[PyXbobLearnActivation_APIVersion_NUM];
int imported_version = *(int*)PyBobLearnActivation_API[PyBobLearnActivation_APIVersion_NUM];
if (XBOB_LEARN_ACTIVATION_API_VERSION != imported_version) {
PyErr_Format(PyExc_ImportError, "%s.%s import error: you compiled against API version 0x%04x, but are now importing an API with version 0x%04x which is not compatible - check your Python runtime environment for errors", BOOST_PP_STRINGIZE(XBOB_LEARN_ACTIVATION_MODULE_PREFIX), BOOST_PP_STRINGIZE(XBOB_LEARN_ACTIVATION_MODULE_NAME), XBOB_LEARN_ACTIVATION_API_VERSION, imported_version);
if (BOB_LEARN_ACTIVATION_API_VERSION != imported_version) {
PyErr_Format(PyExc_ImportError, "%s.%s import error: you compiled against API version 0x%04x, but are now importing an API with version 0x%04x which is not compatible - check your Python runtime environment for errors", BOOST_PP_STRINGIZE(BOB_LEARN_ACTIVATION_MODULE_PREFIX), BOOST_PP_STRINGIZE(BOB_LEARN_ACTIVATION_MODULE_NAME), BOB_LEARN_ACTIVATION_API_VERSION, imported_version);
return -1;
}
......@@ -305,6 +305,6 @@ typedef struct {
# endif //!defined(NO_IMPORT_ARRAY)
#endif /* XBOB_LEARN_ACTIVATION_MODULE */
#endif /* BOB_LEARN_ACTIVATION_MODULE */
#endif /* XBOB_LEARN_ACTIVATION_H */
#endif /* BOB_LEARN_ACTIVATION_H */
......@@ -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.activation
* @brief General directives for all modules in bob.learn.activation
*/
#ifndef XBOB_LEARN_ACTIVATION_CONFIG_H
#define XBOB_LEARN_ACTIVATION_CONFIG_H
#ifndef BOB_LEARN_ACTIVATION_CONFIG_H
#define BOB_LEARN_ACTIVATION_CONFIG_H
/* Macros that define versions and important names */
#define XBOB_LEARN_ACTIVATION_API_VERSION 0x0200
#define BOB_LEARN_ACTIVATION_API_VERSION 0x0200
#endif /* XBOB_LEARN_ACTIVATION_CONFIG_H */
#endif /* BOB_LEARN_ACTIVATION_CONFIG_H */
......@@ -5,10 +5,10 @@
* @brief Implementation of the Linear Activation function
*/
#define XBOB_LEARN_ACTIVATION_MODULE
#include <xbob.learn.activation/api.h>
#define BOB_LEARN_ACTIVATION_MODULE
#include <bob.learn.activation/api.h>
PyDoc_STRVAR(s_linearactivation_str, XBOB_EXT_MODULE_PREFIX ".Linear");
PyDoc_STRVAR(s_linearactivation_str, BOB_EXT_MODULE_PREFIX ".Linear");
PyDoc_STRVAR(s_linearactivation_doc,
"Linear([C=1.0]) -> new linear activation functor\n\
......
......@@ -5,10 +5,10 @@
* @brief Implementation of the Logistic Activation function
*/
#define XBOB_LEARN_ACTIVATION_MODULE
#include <xbob.learn.activation/api.h>
#define BOB_LEARN_ACTIVATION_MODULE
#include <bob.learn.activation/api.h>
PyDoc_STRVAR(s_logisticactivation_str, XBOB_EXT_MODULE_PREFIX ".Logistic");
PyDoc_STRVAR(s_logisticactivation_str, BOB_EXT_MODULE_PREFIX ".Logistic");
PyDoc_STRVAR(s_logisticactivation_doc,
"Logistic() -> new Logistic activation functor\n\
......
......@@ -5,15 +5,15 @@
* @brief Bindings to activation functors
*/
#define XBOB_LEARN_ACTIVATION_MODULE
#include <xbob.learn.activation/api.h>
#define BOB_LEARN_ACTIVATION_MODULE
#include <bob.learn.activation/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 <bob.blitz/capi.h>
#include <bob.blitz/cleanup.h>
#include <bob.io.base/api.h>
static PyMethodDef module_methods[] = {
{0} /* Sentinel */
......@@ -24,7 +24,7 @@ PyDoc_STRVAR(module_docstr, "classes for activation functors");
#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,
......@@ -32,7 +32,7 @@ static PyModuleDef module_definition = {
};
#endif
int PyXbobLearnActivation_APIVersion = XBOB_LEARN_ACTIVATION_API_VERSION;
int PyBobLearnActivation_APIVersion = BOB_LEARN_ACTIVATION_API_VERSION;
static PyObject* create_module (void) {
......@@ -60,14 +60,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_ACTIVATION_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_ACTIVATION_API_VERSION) < 0) return 0;
if (PyModule_AddStringConstant(m, "__version__", BOB_EXT_MODULE_VERSION) < 0) return 0;
/* register the types to python */
Py_INCREF(&PyBobLearnActivation_Type);
......@@ -88,7 +88,7 @@ static PyObject* create_module (void) {
Py_INCREF(&PyBobLearnMultipliedHyperbolicTangentActivation_Type);
if (PyModule_AddObject(m, "MultipliedHyperbolicTangent", (PyObject *)&PyBobLearnMultipliedHyperbolicTangentActivation_Type) < 0) return 0;
static void* PyXbobLearnActivation_API[PyXbobLearnActivation_API_pointers];
static void* PyBobLearnActivation_API[PyBobLearnActivation_API_pointers];
/* exhaustive list of C APIs */
......@@ -96,73 +96,73 @@ static PyObject* create_module (void) {
* Versioning *
**************/
PyXbobLearnActivation_API[PyXbobLearnActivation_APIVersion_NUM] = (void *)&PyXbobLearnActivation_APIVersion;
PyBobLearnActivation_API[PyBobLearnActivation_APIVersion_NUM] = (void *)&PyBobLearnActivation_APIVersion;
/*************************************************
* Bindings for xbob.learn.activation.Activation *
* Bindings for bob.learn.activation.Activation *
*************************************************/
PyXbobLearnActivation_API[PyBobLearnActivation_Type_NUM] = (void *)&PyBobLearnActivation_Type;
PyBobLearnActivation_API[PyBobLearnActivation_Type_NUM] = (void *)&PyBobLearnActivation_Type;
PyXbobLearnActivation_API[PyBobLearnActivation_Check_NUM] = (void *)&PyBobLearnActivation_Check;
PyBobLearnActivation_API[PyBobLearnActivation_Check_NUM] = (void *)&PyBobLearnActivation_Check;
PyXbobLearnActivation_API[PyBobLearnActivation_NewFromActivation_NUM] = (void *)&PyBobLearnActivation_NewFromActivation;
PyBobLearnActivation_API[PyBobLearnActivation_NewFromActivation_NUM] = (void *)&PyBobLearnActivation_NewFromActivation;
/***********************************************
* Bindings for xbob.learn.activation.Identity *
* Bindings for bob.learn.activation.Identity *
***********************************************/
PyXbobLearnActivation_API[PyBobLearnIdentityActivation_Type_NUM] = (void *)&PyBobLearnIdentityActivation_Type;
PyBobLearnActivation_API[PyBobLearnIdentityActivation_Type_NUM] = (void *)&PyBobLearnIdentityActivation_Type;
/*********************************************
* Bindings for xbob.learn.activation.Linear *
* Bindings for bob.learn.activation.Linear *
*********************************************/
PyXbobLearnActivation_API[PyBobLearnLinearActivation_Type_NUM] = (void *)&PyBobLearnLinearActivation_Type;
PyBobLearnActivation_API[PyBobLearnLinearActivation_Type_NUM] = (void *)&PyBobLearnLinearActivation_Type;
/***********************************************
* Bindings for xbob.learn.activation.Logistic *
* Bindings for bob.learn.activation.Logistic *
***********************************************/
PyXbobLearnActivation_API[PyBobLearnLogisticActivation_Type_NUM] = (void *)&PyBobLearnLogisticActivation_Type;
PyBobLearnActivation_API[PyBobLearnLogisticActivation_Type_NUM] = (void *)&PyBobLearnLogisticActivation_Type;
/********************************************************
* Bindings for xbob.learn.activation.HyperbolicTangent *
* Bindings for bob.learn.activation.HyperbolicTangent *
********************************************************/
PyXbobLearnActivation_API[PyBobLearnHyperbolicTangentActivation_Type_NUM] = (void *)&PyBobLearnHyperbolicTangentActivation_Type;
PyBobLearnActivation_API[PyBobLearnHyperbolicTangentActivation_Type_NUM] = (void *)&PyBobLearnHyperbolicTangentActivation_Type;
/******************************************************************
* Bindings for xbob.learn.activation.MultipliedHyperbolicTangent *
* Bindings for bob.learn.activation.MultipliedHyperbolicTangent *
******************************************************************/
PyXbobLearnActivation_API[PyBobLearnMultipliedHyperbolicTangentActivation_Type_NUM] = (void *)&PyBobLearnMultipliedHyperbolicTangentActivation_Type;
PyBobLearnActivation_API[PyBobLearnMultipliedHyperbolicTangentActivation_Type_NUM] = (void *)&PyBobLearnMultipliedHyperbolicTangentActivation_Type;
#if PY_VERSION_HEX >= 0x02070000
/* defines the PyCapsule */
PyObject* c_api_object = PyCapsule_New((void *)PyXbobLearnActivation_API,
XBOB_EXT_MODULE_PREFIX "." XBOB_EXT_MODULE_NAME "._C_API", 0);
PyObject* c_api_object = PyCapsule_New((void *)PyBobLearnActivation_API,
BOB_EXT_MODULE_PREFIX "." BOB_EXT_MODULE_NAME "._C_API", 0);
#else
PyObject* c_api_object = PyCObject_FromVoidPtr((void *)PyXbobLearnActivation_API, 0);
PyObject* c_api_object = PyCObject_FromVoidPtr((void *)PyBobLearnActivation_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;
}
......@@ -171,7 +171,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
......
......@@ -5,11 +5,11 @@
* @brief Implementation of the MultipliedHyperbolicTangent Activation function
*/
#define XBOB_LEARN_ACTIVATION_MODULE
#include <xbob.learn.activation/api.h>
#define BOB_LEARN_ACTIVATION_MODULE
#include <bob.learn.activation/api.h>
PyDoc_STRVAR(s_multtanhactivation_str,
XBOB_EXT_MODULE_PREFIX ".MultipliedHyperbolicTangent");
BOB_EXT_MODULE_PREFIX ".MultipliedHyperbolicTangent");
PyDoc_STRVAR(s_multtanhactivation_doc,
"MultipliedHyperbolicTangentActivation([C=1.0, [M=1.0]]) -> new multiplied hyperbolic tangent functor\n\
......
......@@ -5,11 +5,11 @@
* @brief Implementation of the HyperbolicTangent Activation function
*/
#define XBOB_LEARN_ACTIVATION_MODULE
#include <xbob.learn.activation/api.h>
#define BOB_LEARN_ACTIVATION_MODULE
#include <bob.learn.activation/api.h>
PyDoc_STRVAR(s_hyperbolictangentactivation_str,
XBOB_EXT_MODULE_PREFIX ".HyperbolicTangentActivation");
BOB_EXT_MODULE_PREFIX ".HyperbolicTangentActivation");
PyDoc_STRVAR(s_hyperbolictangentactivation_doc,
"HyperbolicTangentActivation() -> new HyperbolicTangentActivation\n\
......
File moved
......@@ -19,10 +19,10 @@
#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 <bob.blitz/capi.h>
#include <bob.blitz/cleanup.h>
#include <bob.io.base/config.h>
#include <bob.learn.activation/config.h>
static int dict_set(PyObject* d, const char* key, const char* value) {
PyObject* v = Py_BuildValue("s", value);
......@@ -98,17 +98,17 @@ 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));
}
static PyObject* build_version_dictionary() {
......@@ -122,8 +122,8 @@ 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.base", xbob_io_base_version())) return 0;
if (!dict_steal(retval, "bob.blitz", bob_blitz_version())) return 0;
if (!dict_steal(retval, "bob.io.base", bob_io_base_version())) return 0;
if (!dict_steal(retval, "Bob", bob_version())) return 0;
Py_INCREF(retval);
......@@ -141,7 +141,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,
......@@ -154,15 +154,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_ACTIVATION_API_VERSION) < 0)
if (PyModule_AddIntConstant(m, "api", BOB_LEARN_ACTIVATION_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();
......@@ -170,9 +170,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;
}
......@@ -181,7 +181,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
......
......@@ -4,25 +4,25 @@
[buildout]
parts = scripts
eggs = xbob.learn.activation
extensions = xbob.buildout
eggs = bob.learn.activation
extensions = bob.buildout
mr.developer
auto-checkout = *
develop = src/xbob.extension
src/xbob.blitz
src/xbob.io.base
develop = src/bob.extension
src/bob.blitz
src/bob.io.base
.
; options for xbob.buildout extension
; options for bob.buildout extension
debug = true
verbose = true
prefixes = /idiap/group/torch5spro/releases/preview/install/linux-x86_64-release
/Users/andre/work/bob/b/dbg/
[sources]
xbob.extension = git https://github.com/bioidiap/xbob.extension branch=prototype
xbob.blitz = git https://github.com/bioidiap/xbob.blitz
xbob.io.base = git https://github.com/bioidiap/xbob.io.base
bob.extension = git https://github.com/bioidiap/bob.extension
bob.blitz = git https://github.com/bioidiap/bob.blitz
bob.io.base = git https://github.com/bioidiap/bob.io.base
[scripts]
recipe = xbob.buildout:scripts
recipe = bob.buildout:scripts
......@@ -6,11 +6,11 @@
C++ API
=========
The C++ API of ``xbob.learn.activation`` allows users to leverage from
automatic converters for classes in :py:class:`xbob.learn.activation`. To use
The C++ API of ``bob.learn.activation`` allows users to leverage from
automatic converters for classes in :py:class:`bob.learn.activation`. To use
the C API, clients should first, include the header file
``<xbob.learn.activation/api.h>`` on their compilation units and then, make
sure to call once ``import_xbob_learn_activation()`` at their module
``<bob.learn.activation/api.h>`` on their compilation units and then, make
sure to call once ``import_bob_learn_activation()`` at their module
instantiation, as explained at the `Python manual
<http://docs.python.org/2/extending/extending.html#using-capsules>`_.
......@@ -19,7 +19,7 @@ the import function:
.. code-block:: c++
#include <xbob.learn.activation/api.h>
#include <bob.learn.activation/api.h>
PyMODINIT_FUNC initclient(void) {
......@@ -28,33 +28,33 @@ the import function:
if (!m) return;
// imports dependencies
if (import_xbob_blitz() < 0) {
if (import_bob_blitz() < 0) {
PyErr_Print();
PyErr_SetString(PyExc_ImportError, "cannot import module");
return 0;
}
if (import_xbob_io_base() < 0) {
if (import_bob_io_base() < 0) {
PyErr_Print();
PyErr_SetString(PyExc_ImportError, "cannot import module");
return 0;
}
if (import_xbob_learn_activation() < 0) {
if (import_bob_learn_activation() < 0) {
PyErr_Print();
PyErr_SetString(PyExc_ImportError, "cannot import module");
return 0;
}
// imports xbob.learn.activation C-API
import_xbob_learn_activation();
// imports bob.learn.activation C-API
import_bob_learn_activation();
}
.. note::
The include directory can be discovered using
:py:func:`xbob.learn.activation.get_include`.
:py:func:`bob.learn.activation.get_include`.
Activation Functors
-------------------
......
......@@ -58,12 +58,12 @@ source_suffix = '.rst'
master_doc = 'index'
# General information about the project.
project = u'xbob.learn.activation'
project = u'bob.learn.activation'
import time
copyright = u'%s, Idiap Research Institute' % time.strftime('%Y')
# Grab the setup entry
distribution = pkg_resources.require('xbob.learn.activation')[0]
distribution = pkg_resources.require('bob.learn.activation')[0]
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
......@@ -129,7 +129,7 @@ if sphinx.__version__ >= "1.0":
#html_title = None
# A shorter title for the navigation bar. Default is the same as html_title.
#html_short_title = 'xbob_learn_activation'
#html_short_title = 'bob_learn_activation'
# The name of an image file (relative to this directory) to place at the top
# of the sidebar.
......@@ -187,7 +187,7 @@ html_favicon = 'img/favicon.ico'
#html_file_suffix = None
# Output file base name for HTML help builder.
htmlhelp_basename = 'xbob_learn_activation_doc'
htmlhelp_basename = 'bob_learn_activation_doc'
# -- Options for LaTeX output --------------------------------------------------
......@@ -201,7 +201,7 @@ latex_font_size = '10pt'
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title, author, documentclass [howto/manual]).
latex_documents = [
('index', 'xbob_learn_activation.tex', u'Bob Activation Functions',
('index', 'bob_learn_activation.tex', u'Bob Activation Functions',
u'Biometrics Group, Idiap Research Institute', 'manual'),
]
......@@ -241,7 +241,7 @@ rst_epilog = """
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
('index', 'xbob_learn_activation', u'Bob Activation Function Documentation', [u'Idiap Research Institute'], 1)
('index', 'bob_learn_activation', u'Bob Activation Function Documentation', [u'Idiap Research Institute'], 1)
]
# Default processing flags for sphinx
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment