Skip to content
Snippets Groups Projects
Commit 2e863924 authored by Manuel Günther's avatar Manuel Günther
Browse files

New README and documentation strategy.

parent 816abecf
No related branches found
Tags v3.0.2
No related merge requests found
...@@ -6,6 +6,7 @@ matrix: ...@@ -6,6 +6,7 @@ matrix:
env: env:
- secure: gX4Yr/32b9tOVFiAxjzFsbIm1VWiB6WJ1rXOd4hCd6ncBaXw83e4B/jaP1Ci2uKRi6PYO9y7AHj8y64OcTeS2Uwr+5QECRSRgf6+AKCde4VgKoh5wUpVOp4QLaZlJLNM6L/EwGWih5K2yoM/17cRLyGQC/x6QID/ZfEjwtZni2M= - secure: gX4Yr/32b9tOVFiAxjzFsbIm1VWiB6WJ1rXOd4hCd6ncBaXw83e4B/jaP1Ci2uKRi6PYO9y7AHj8y64OcTeS2Uwr+5QECRSRgf6+AKCde4VgKoh5wUpVOp4QLaZlJLNM6L/EwGWih5K2yoM/17cRLyGQC/x6QID/ZfEjwtZni2M=
- secure: kq32QuV+vu0Qaqo1wn4UvUNAglNF4HGJv96XNwf263G+uZekCMpx6DJdiVJouxoYRcOsgkoJgbc1rxAFGUZ7PZ4gfP6srQ9i3ZT7H3zghVBr8ULwmi9+TR58W/P+KBZl/lLVSsdKeMVfT2hJ9XpF1P6G8GM/3UkTP3Rp0t8SIug= - secure: kq32QuV+vu0Qaqo1wn4UvUNAglNF4HGJv96XNwf263G+uZekCMpx6DJdiVJouxoYRcOsgkoJgbc1rxAFGUZ7PZ4gfP6srQ9i3ZT7H3zghVBr8ULwmi9+TR58W/P+KBZl/lLVSsdKeMVfT2hJ9XpF1P6G8GM/3UkTP3Rp0t8SIug=
- BOB_DOCUMENTATION_SERVER=https://www.idiap.ch/software/bob/docs/latest/bioidiap/%s/master
- python: 3.2 - python: 3.2
env: env:
- NUMPYSPEC===1.7.1 - NUMPYSPEC===1.7.1
...@@ -15,7 +16,7 @@ matrix: ...@@ -15,7 +16,7 @@ matrix:
before_install: before_install:
- sudo add-apt-repository -y ppa:biometrics/bob - sudo add-apt-repository -y ppa:biometrics/bob
- sudo apt-get update -qq - sudo apt-get update -qq
- sudo apt-get install -qq --force-yes libboost-all-dev libblitz1-dev libhdf5-serial-dev libatlas-dev libatlas-base-dev liblapack-dev - sudo apt-get install -qq --force-yes libboost-all-dev libblitz1-dev libhdf5-serial-dev libatlas-dev libatlas-base-dev liblapack-dev texlive-latex-recommended texlive-latex-extra texlive-fonts-recommended
- if [ -n "${NUMPYSPEC}" ]; then sudo apt-get install -qq gfortran; fi - if [ -n "${NUMPYSPEC}" ]; then sudo apt-get install -qq gfortran; fi
- if [ -n "${NUMPYSPEC}" ]; then pip install --upgrade pip setuptools; 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 - if [ -n "${NUMPYSPEC}" ]; then pip install --find-links http://wheels.astropy.org/ --find-links http://wheels2.astropy.org/ --use-wheel numpy$NUMPYSPEC; fi
......
...@@ -2,78 +2,36 @@ ...@@ -2,78 +2,36 @@
.. Andre Anjos <andre.anjos@idiap.ch> .. Andre Anjos <andre.anjos@idiap.ch>
.. Thu 24 Apr 17:24:10 2014 CEST .. Thu 24 Apr 17:24:10 2014 CEST
.. image:: https://travis-ci.org/bioidiap/bob.learn.mlp.svg?branch=master .. image:: http://img.shields.io/badge/docs-stable-yellow.png
:target: https://travis-ci.org/bioidiap/bob.learn.mlp :target: http://pythonhosted.org/bob.learn.mlp/index.html
.. image:: http://img.shields.io/badge/docs-latest-orange.png .. image:: http://img.shields.io/badge/docs-latest-orange.png
:target: https://www.idiap.ch/software/bob/docs/latest/bioidiap/bob.learn.mlp/master/index.html :target: https://www.idiap.ch/software/bob/docs/latest/bioidiap/bob.learn.mlp/master/index.html
.. image:: https://travis-ci.org/bioidiap/bob.learn.mlp.svg?branch=master
:target: https://travis-ci.org/bioidiap/bob.learn.mlp
.. image:: https://coveralls.io/repos/bioidiap/bob.learn.mlp/badge.png .. image:: https://coveralls.io/repos/bioidiap/bob.learn.mlp/badge.png
:target: https://coveralls.io/r/bioidiap/bob.learn.mlp :target: https://coveralls.io/r/bioidiap/bob.learn.mlp
.. image:: http://img.shields.io/github/tag/bioidiap/bob.learn.mlp.png .. image:: https://img.shields.io/badge/github-master-0000c0.png
:target: https://github.com/bioidiap/bob.learn.mlp :target: https://github.com/bioidiap/bob.learn.mlp/tree/master
.. image:: http://img.shields.io/pypi/v/bob.learn.mlp.png .. image:: http://img.shields.io/pypi/v/bob.learn.mlp.png
:target: https://pypi.python.org/pypi/bob.learn.mlp :target: https://pypi.python.org/pypi/bob.learn.mlp
.. image:: http://img.shields.io/pypi/dm/bob.learn.mlp.png .. image:: http://img.shields.io/pypi/dm/bob.learn.mlp.png
:target: https://pypi.python.org/pypi/bob.learn.mlp :target: https://pypi.python.org/pypi/bob.learn.mlp
=============================================================== ============================================
Python bindings for Bob's Multi-Layer Perceptron and Trainers Multi-Layer Perceptron and Trainers in Bob
=============================================================== ============================================
This package contains a set of Pythonic bindings for Bob's MLP and Trainers. This package contains a set of Pythonic bindings for Bob's MLP and Trainers.
Installation Installation
------------ ------------
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>`_.
Install it through normal means, via PyPI or use ``zc.buildout`` to bootstrap For Bob_ to be able to work properly, some dependent packages are required to be installed.
the package and run test units. Please make sure that you have read the `Dependencies <https://github.com/idiap/bob/wiki/Dependencies>`_ for your operating system.
Documentation Documentation
------------- -------------
For further documentation on this package, please read the `Stable Version <http://pythonhosted.org/bob.learn.mlp/index.html>`_ or the `Latest Version <https://www.idiap.ch/software/bob/docs/latest/bioidiap/bob.learn.mlp/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.mlp/master/index.html>`_. .. _bob: https://www.idiap.ch/software/bob
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.mlp
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.
...@@ -33,12 +33,12 @@ class Machine: ...@@ -33,12 +33,12 @@ class Machine:
hidden_activation hidden_activation
The activation function to use for the hidden neurons of the network. The activation function to use for the hidden neurons of the network.
Should be one of the classes derived from Should be one of the classes derived from
:py:class:`bob.machine.Activation`. :py:class:`bob.learn.activation.Activation`.
output_activation output_activation
The activation function to use for the output neurons of the network. The activation function to use for the output neurons of the network.
Should be one of the classes derived from Should be one of the classes derived from
:py:class:`bob.machine.Activation`. :py:class:`bob.learn.activation.Activation`.
""" """
if bias is None: if bias is None:
...@@ -112,7 +112,7 @@ class TrainableMachine(Machine): ...@@ -112,7 +112,7 @@ class TrainableMachine(Machine):
b b
This is the error back-propagated through the last neuron by any of the This is the error back-propagated through the last neuron by any of the
available :py:class:`bob.trainer.Cost` functors. Every row in b matches available :py:class:`bob.learn.mlp.Cost` functors. Every row in b matches
one example. one example.
self.d self.d
......
...@@ -220,7 +220,7 @@ PyDoc_STRVAR(s_cost_object_str, "cost_object"); ...@@ -220,7 +220,7 @@ PyDoc_STRVAR(s_cost_object_str, "cost_object");
PyDoc_STRVAR(s_cost_object_doc, PyDoc_STRVAR(s_cost_object_doc,
"An object, derived from :py:class:`bob.learn.mlp.Cost` (e.g.\n\ "An object, derived from :py:class:`bob.learn.mlp.Cost` (e.g.\n\
:py:class:`bob.learn.mlp.SquareError` or \n\ :py:class:`bob.learn.mlp.SquareError` or \n\
:py:class:`bob.trainer.CrossEntropyLoss`), that is used to evaluate\n\ :py:class:`bob.learn.mlp.CrossEntropyLoss`), that is used to evaluate\n\
the cost (a.k.a. *loss*) and the derivatives given the input, the\n\ the cost (a.k.a. *loss*) and the derivatives given the input, the\n\
target and the MLP structure."); target and the MLP structure.");
......
...@@ -19,6 +19,7 @@ develop = src/bob.extension ...@@ -19,6 +19,7 @@ develop = src/bob.extension
; options for bob.buildout extension ; options for bob.buildout extension
debug = true debug = true
verbose = true verbose = true
newest = false
[sources] [sources]
bob.extension = git https://github.com/bioidiap/bob.extension bob.extension = git https://github.com/bioidiap/bob.extension
......
...@@ -249,36 +249,11 @@ autoclass_content = 'both' ...@@ -249,36 +249,11 @@ autoclass_content = 'both'
autodoc_member_order = 'bysource' autodoc_member_order = 'bysource'
autodoc_default_flags = ['members', 'undoc-members', 'inherited-members', 'show-inheritance'] 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: # For inter-documentation mapping:
intersphinx_mapping = { from bob.extension.utils import link_documentation
'http://docs.python.org/%d.%d/' % sys.version_info[:2]: None, # the documentation also links to bob.learn.linear
numpy_manual: None, intersphinx_mapping = link_documentation(['python', 'numpy', 'bob.learn.linear'])
}
def setup(app): def setup(app):
pass pass
...@@ -100,7 +100,7 @@ this example: ...@@ -100,7 +100,7 @@ this example:
Once the network weights and biases are set, we can feed forward an example Once the network weights and biases are set, we can feed forward an example
through this machine. This is done using the ``()`` operator, like for a through this machine. This is done using the ``()`` operator, like for a
:py:class:`bob.learn.Linear.Machine`: :py:class:`bob.learn.linear.Machine`:
.. doctest:: .. doctest::
...@@ -120,7 +120,7 @@ available MLP trainers in two different 2D `NumPy`_ arrays, one for the input ...@@ -120,7 +120,7 @@ available MLP trainers in two different 2D `NumPy`_ arrays, one for the input
>>> t0 = numpy.array([[.0]]) # target >>> t0 = numpy.array([[.0]]) # target
The class used to train a MLP [1]_ with backpropagation [2]_ is The class used to train a MLP [1]_ with backpropagation [2]_ is
:py:class:`bob.learn.MLP.BackProp`. An example is shown below. :py:class:`bob.learn.mlp.BackProp`. An example is shown below.
.. doctest:: .. doctest::
......
...@@ -21,7 +21,7 @@ setup( ...@@ -21,7 +21,7 @@ setup(
name='bob.learn.mlp', name='bob.learn.mlp',
version=version, version=version,
description='Bindings for bob.machine\'s Multi-layer Perceptron and Trainers', description='Bob\'s Multi-layer Perceptron and Trainers',
url='http://github.com/bioidiap/bob.learn.mlp', url='http://github.com/bioidiap/bob.learn.mlp',
license='BSD', license='BSD',
author='Andre Anjos', author='Andre Anjos',
...@@ -39,7 +39,7 @@ setup( ...@@ -39,7 +39,7 @@ setup(
namespace_packages=[ namespace_packages=[
"bob", "bob",
"bob.learn", "bob.learn",
], ],
ext_modules = [ ext_modules = [
Extension("bob.learn.mlp.version", Extension("bob.learn.mlp.version",
...@@ -97,13 +97,14 @@ setup( ...@@ -97,13 +97,14 @@ setup(
}, },
classifiers = [ classifiers = [
'Development Status :: 3 - Alpha', 'Framework :: Bob',
'Development Status :: 4 - Beta',
'Intended Audience :: Developers', 'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License', 'License :: OSI Approved :: BSD License',
'Natural Language :: English', 'Natural Language :: English',
'Programming Language :: Python', 'Programming Language :: Python',
'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3',
'Topic :: Software Development :: Libraries :: Python Modules', 'Topic :: Software Development :: Libraries :: Python Modules',
], ],
) )
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