diff --git a/.gitignore b/.gitignore index 8842b5006da4c55df0ee78e80f1911ca69b2a8ee..dae95ef0644140d1c14bdc82855252e51625a8de 100644 --- a/.gitignore +++ b/.gitignore @@ -2,12 +2,9 @@ *.swp *.pyc *.so -*.so.* *.dylib -CMakeLists.txt bin eggs -src parts .installed.cfg .mr.developer.cfg @@ -19,6 +16,4 @@ dist .gdb_history build *.egg -opsnr.stt -.coverage -.DS_Store +src/ diff --git a/.travis.yml b/.travis.yml index f000ad3e6572aa238eb85a6704366b7190aa6949..3db3a759555a76f1a73f8bceddf13616b43ef532 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,6 +6,7 @@ matrix: env: - secure: TEPqit10h7L/l4kbv8zbvKH9freS6f1p2pIfUuMMfASKuZHAzizljSv14NKqeXhrpr5kPbQhNAcMrme8x7Is7bQCVxN4/8K6BQNmp2V6hWxBAh+2wk/9Bxv+FNlDBhjQM3rNIM0Wjzf5JW5OM+CMeZjxI1Mi/vNI/oN2vtvFfsA= - secure: glYEyCLOew9QZXhgTHKkP9JGt/pAT7P/Pfk/SqyX++6wyTjyMrnj0DeSJW7khxtxo6kL+d23eojQVy6Q0izZ3US3KGt3PsLxYf+2Yi4Lhji/RjhZG4qgpz4XUb3cZcmb2wTJ/qFYZbGRjr5KvzkICvzv1IjxCeTuEwnj1ctz62Y= + - BOB_DOCUMENTATION_SERVER=https://www.idiap.ch/software/bob/docs/latest/bioidiap/%s/master - python: 3.2 env: - NUMPYSPEC===1.7.1 @@ -15,7 +16,7 @@ matrix: before_install: - sudo add-apt-repository -y ppa:biometrics/bob - sudo apt-get update -qq -- sudo apt-get install -qq --force-yes libboost-all-dev libblitz1-dev libhdf5-serial-dev +- sudo apt-get install -qq --force-yes libboost-all-dev libblitz1-dev libhdf5-serial-dev texlive-latex-recommended texlive-latex-extra texlive-fonts-recommended - if [ -n "${NUMPYSPEC}" ]; then sudo apt-get install -qq libatlas-dev libatlas-base-dev liblapack-dev gfortran; fi - if [ -n "${NUMPYSPEC}" ]; then pip install --upgrade pip setuptools; fi - if [ -n "${NUMPYSPEC}" ]; then pip install --find-links http://wheels.astropy.org/ --find-links http://wheels2.astropy.org/ --use-wheel numpy$NUMPYSPEC; fi diff --git a/README.rst b/README.rst index 62929c7512c238117740e4964d86b86a0890ebed..bcb7efa52b9e63418051b642c7b61db6b4f7eecd 100644 --- a/README.rst +++ b/README.rst @@ -2,79 +2,36 @@ .. Andre Anjos <andre.anjos@idiap.ch> .. Fri 13 Dec 2013 12:35:22 CET -.. image:: https://travis-ci.org/bioidiap/bob.learn.activation.svg?branch=master - :target: https://travis-ci.org/bioidiap/bob.learn.activation +.. image:: http://img.shields.io/badge/docs-stable-yellow.png + :target: http://pythonhosted.org/bob.learn.activation/index.html .. image:: http://img.shields.io/badge/docs-latest-orange.png :target: https://www.idiap.ch/software/bob/docs/latest/bioidiap/bob.learn.activation/master/index.html +.. 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:: https://img.shields.io/badge/github-master-0000c0.png + :target: https://github.com/bioidiap/bob.learn.activation/tree/master .. 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 -======================================================= +============================ + Activation functors of Bob +============================ -This package contains a set of Pythonic bindings for Bob's machine Activation -functors. +This package contains Bob's Activation functors, which used in several learning packages of Bob in the namespace ``bob.learn``. Installation ------------ - -Install it through normal means, via PyPI or use ``zc.buildout`` to bootstrap -the package and run test units. +To install this package -- alone or together with other `Packages of Bob <https://github.com/idiap/bob/wiki/Packages>`_ -- please read the `Installation Instructions <https://github.com/idiap/bob/wiki/Installation>`_. +For Bob_ to be able to work properly, some dependent packages are required to be installed. +Please make sure that you have read the `Dependencies <https://github.com/idiap/bob/wiki/Dependencies>`_ for your operating system. Documentation ------------- +For further documentation on this package, please read the `Stable Version <http://pythonhosted.org/bob.learn.activation/index.html>`_ or the `Latest Version <https://www.idiap.ch/software/bob/docs/latest/bioidiap/bob.learn.activation/master/index.html>`_ of the documentation. +For a list of tutorials on this or the other packages ob Bob_, or information on submitting issues, asking questions and starting discussions, please visit its website. -The latest version of the documentation can be found `here <https://www.idiap.ch/software/bob/docs/latest/bioidiap/bob.learn.activation/master/index.html>`_. - -Otherwise, you can generate the documentation for this package yourself, after installation, using Sphinx:: - - $ sphinx-build -b html doc sphinx - -This shall place in the directory ``sphinx``, the current version for the -documentation of the package. - -Testing -------- - -You can run a set of tests using the nose test runner:: - - $ nosetests -sv - -.. warning:: - - If Bob <= 1.2.1 is installed on your python path, nose will automatically - load the old version of the insulate plugin available in Bob, which will - trigger the loading of incompatible shared libraries (from Bob itself), in - to your working binary. This will cause a stack corruption. Either remove - the centrally installed version of Bob, or build your own version of Python - in which Bob <= 1.2.1 is not installed. - -You can run our documentation tests using sphinx itself:: - - $ sphinx-build -b doctest doc sphinx - -You can test overall test coverage with:: - - $ nosetests --with-coverage --cover-package=bob.learn.activation - -The ``coverage`` egg must be installed for this to work properly. - -Development ------------ - -To develop this package, install using ``zc.buildout``, using the buildout -configuration found on the root of the package:: - - $ python bootstrap.py - ... - $ ./bin/buildout - -Tweak the options in ``buildout.cfg`` to disable/enable verbosity and debug -builds. +.. _bob: https://www.idiap.ch/software/bob diff --git a/bob/learn/activation/activation.cpp b/bob/learn/activation/activation.cpp index d162668a12265b9a3f38ae3702d360f79b4a8e95..2591e12999401b59507f0f46ce5204ea5f27bd1a 100644 --- a/bob/learn/activation/activation.cpp +++ b/bob/learn/activation/activation.cpp @@ -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:`bob.io.HDF5File`\n\ +Loads itself from a :py:class:`bob.io.base.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:`bob.io.HDF5File`\n\ +Saves itself to a :py:class:`bob.io.base.HDF5File`\n\ \n\ "); diff --git a/bob/learn/activation/linear.cpp b/bob/learn/activation/linear.cpp index 574b316152124185d682d082212b92b34cb5c841..0efdaed56880954a19a7b7714de6f638bb03f4cb 100644 --- a/bob/learn/activation/linear.cpp +++ b/bob/learn/activation/linear.cpp @@ -18,7 +18,7 @@ Computes :math:`f(z) = C \\cdot z` as activation function.\n\ The constructor builds a new linear activation function\n\ with a given constant. Don't use this if you just want to\n\ set constant to the default value (1.0). In such a case,\n\ -prefer to use the more efficient :py:class:`IdentityActivation`.\n\ +prefer to use the more efficient :py:class:`Identity` activation.\n\ "); static int PyBobLearnLinearActivation_init diff --git a/bob/learn/activation/mult_tanh.cpp b/bob/learn/activation/mult_tanh.cpp index 68ad93bd37f499871d044e9fde50eb95b5cf55c9..cd7f1cac75287610e6e072e9390da545413941aa 100644 --- a/bob/learn/activation/mult_tanh.cpp +++ b/bob/learn/activation/mult_tanh.cpp @@ -12,7 +12,7 @@ PyDoc_STRVAR(s_multtanhactivation_str, BOB_EXT_MODULE_PREFIX ".MultipliedHyperbolicTangent"); PyDoc_STRVAR(s_multtanhactivation_doc, -"MultipliedHyperbolicTangentActivation([C=1.0, [M=1.0]]) -> new multiplied hyperbolic tangent functor\n\ +"MultipliedHyperbolicTangent([C=1.0, [M=1.0]]) -> new multiplied hyperbolic tangent functor\n\ \n\ Computes :math:`f(z) = C \\cdot \\tanh(Mz)` as activation\n\ function.\n\ @@ -21,7 +21,7 @@ Builds a new hyperbolic tangent activation function with a given\n\ constant for the inner and outter products. Don't use this if you\n\ just want to set the constants to the default values (1.0). In\n\ such a case, prefer to use the more efficient\n\ -:py:class:`bob.learn.activation.HyperbolicTangentActivation`.\n\ +:py:class:`HyperbolicTangent` activation.\n\ "); static int PyBobLearnMultipliedHyperbolicTangentActivation_init diff --git a/bob/learn/activation/tanh.cpp b/bob/learn/activation/tanh.cpp index b9ce64b7863b570359347b78d0156c8e361dfe48..5d953b8c5757114a34d3a71de52628336c2a0008 100644 --- a/bob/learn/activation/tanh.cpp +++ b/bob/learn/activation/tanh.cpp @@ -9,10 +9,10 @@ #include <bob.learn.activation/api.h> PyDoc_STRVAR(s_hyperbolictangentactivation_str, - BOB_EXT_MODULE_PREFIX ".HyperbolicTangentActivation"); + BOB_EXT_MODULE_PREFIX ".HyperbolicTangent"); PyDoc_STRVAR(s_hyperbolictangentactivation_doc, -"HyperbolicTangentActivation() -> new HyperbolicTangentActivation\n\ +"HyperbolicTangent() -> new HyperbolicTangent\n\ \n\ Computes :math:`f(z) = \\tanh(z)` as activation function.\n\ \n\ diff --git a/buildout.cfg b/buildout.cfg index 90db2937a894cd070fdc0642945a4351063dfcfe..72b9f557e3f826bb16fe604a91919d603af00e8f 100644 --- a/buildout.cfg +++ b/buildout.cfg @@ -17,6 +17,7 @@ develop = src/bob.extension ; options for bob.buildout extension debug = true verbose = true +newest = false [sources] bob.extension = git https://github.com/bioidiap/bob.extension diff --git a/doc/conf.py b/doc/conf.py index f8a2caa88f25dd396a128e15689ece1b258afb3c..6518b2e3fd8989283ea704a7d13cb5a7d386b602 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -249,36 +249,10 @@ autoclass_content = 'both' autodoc_member_order = 'bysource' autodoc_default_flags = ['members', 'undoc-members', 'inherited-members', 'show-inheritance'] -def smaller_than(v1, v2): - """Compares scipy/numpy version numbers""" - - c1 = v1.split('.') - c2 = v2.split('.')[:len(c1)] #clip to the compared version - for i, k in enumerate(c2): - n1 = c1[i] - n2 = c2[i] - try: - n1 = int(n1) - n2 = int(n2) - except ValueError: - n1 = str(n1) - n2 = str(n2) - if n1 > n2: return False - return True - -# Some name mangling to find the correct sphinx manuals for some packages -numpy_version = __import__('numpy').version.version -if smaller_than(numpy_version, '1.5.z'): - numpy_version = '.'.join(numpy_version.split('.')[:-1]) + '.x' -else: - numpy_version = '.'.join(numpy_version.split('.')[:-1]) + '.0' -numpy_manual = 'http://docs.scipy.org/doc/numpy-%s/' % numpy_version - # For inter-documentation mapping: -intersphinx_mapping = { - 'http://docs.python.org/%d.%d/' % sys.version_info[:2]: None, - numpy_manual: None, - } +from bob.extension.utils import link_documentation +intersphinx_mapping = link_documentation() + def setup(app): pass diff --git a/doc/index.rst b/doc/index.rst index afd7480446c498f0e513e0459d3350d66366b205..b07cf9d9b77ddb205f10acc3581aa355bb22ef7e 100644 --- a/doc/index.rst +++ b/doc/index.rst @@ -10,9 +10,8 @@ .. todolist:: -This module contains some functionality from Bob bound to Python, available in -the C++ counter-part ``bob::machine``. It includes Activation functors from the -Machine Learning core. +This module includes Activation functors from the Machine Learning core of Bob. +These Activation functors are used in several other packages like `bob.learn.linear <http://pypi.python.org/pypi/bob.learn.linear>`_ or `bob.learn.mlp <http://pypi.python.org/pypi/bob.learn.mlp>`_. Documentation ------------- diff --git a/setup.py b/setup.py index ce7f5944e779eb32facd9b6833ffe538d1eee4f8..03144eb7bec74f85724d2dc0a4f3a8bd0f684fe4 100644 --- a/setup.py +++ b/setup.py @@ -84,7 +84,8 @@ setup( }, classifiers = [ - 'Development Status :: 3 - Alpha', + 'Framework :: Bob', + 'Development Status :: 4 - Beta', 'Intended Audience :: Developers', 'License :: OSI Approved :: BSD License', 'Natural Language :: English', @@ -93,4 +94,4 @@ setup( 'Topic :: Software Development :: Libraries :: Python Modules', ], - ) +)