Commit 49e7f41b authored by André Anjos's avatar André Anjos 💬
Browse files

xbob -> bob

parent b965f010
......@@ -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.
......
......@@ -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;