提交 a256d422 authored 作者: Joseph Turian's avatar Joseph Turian

merge

To install the package, use:
python setup.py build
python setup.py test
python setup.py install
For the documentation, see the project website:
http://pylearn.org/theano/
This may be easier than building the documentation yourself, because we have
custom ReST hooks that are used.
DIRECTORY LAYOUT DIRECTORY LAYOUT
Theano (current directory) is the distribution directory. Theano (current directory) is the distribution directory.
* Theano/theano contains the package * Theano/theano contains the package
* Theano/theano has several submodules: * Theano/theano has several submodules:
......
...@@ -8,6 +8,10 @@ efficiently evaluate mathematical expressions involving multi-dimensional ...@@ -8,6 +8,10 @@ efficiently evaluate mathematical expressions involving multi-dimensional
arrays. Using Theano, it is not uncommon to see speed improvements of arrays. Using Theano, it is not uncommon to see speed improvements of
ten-fold over using pure NumPy. ten-fold over using pure NumPy.
The latest release is version `0.1 <downloads/Theano-0.1.tar.gz>`.
You can download the `PDF documentation <theano.pdf>`, rather than reading it
online.
Choose your own adventure: Choose your own adventure:
* You have no idea what Theano is and you read the :ref:`introduction * You have no idea what Theano is and you read the :ref:`introduction
......
...@@ -46,81 +46,34 @@ The following libraries and software are optional: ...@@ -46,81 +46,34 @@ The following libraries and software are optional:
Easy install Easy install
------------ ------------
The following command will install the latest revision of Theano The following command will install the latest release of Theano
on your system: on your system:
.. TODO: Does this install the latest package version, or the latest Mercurial
.. revision ?
.. code-block:: bash .. code-block:: bash
easy_install http://pylearn.org/hg/theano/archive/tip.tar.gz easy_install Theano
.. TODO: make sure this works
.. TODO: change the command to install the latest *stable* version of
.. Theano, when we figure out where to put it.
Manual install Manual install
-------------- --------------
There are two ways to get the source: through mercurial (required for To install the latest release of Theano from source, visit the `downloads
library developers) or through a Unix compressed archive. There are <http://pylearn.org/theano/downloads/>` page and download the release you
no stable releases yet. want. Unpack the release, and type:
*To get the source via mercurial,* you must have `mercurial <http://www.selenic.com/mercurial/wiki/>`__ installed.
You can get the source like this:
.. code-block:: bash
hg clone http://pylearn.org/hg/theano Theano
The subdirectory Theano/theano has to be in your PYTHONPATH. In order to do
that, you can either create a symbolic link to Theano/theano in a directory
already mentionned in your PYTHONPATH environment variable, or modify the
PYTHONPATH so that it mentions Theano.
To create a symbolic link:
.. code-block:: bash
ln -s Theano/theano <someplace on your PYTHONPATH>/theano
To modify the environment variable PYTHONPATH in bash, you may do this:
.. code-block:: bash .. code-block:: bash
export PYTHONPATH=<path to Theano's parent dir>/Theano:$PYTHONPATH python setup.py build
python setup.py test
python setup.py install
In csh:
.. code-block:: csh Bleeding Edge
--------------
setenv PYTHONPATH <path to Theano's parent dir>/Theano:$PYTHONPATH
Once you have completed these steps, you should run the tests like this:
.. code-block:: bash
cd Theano
nosetests #execute all the tests
All tests should pass. If some test fails on your machine, you are
encouraged to tell us what went wrong on the ``theano-users@googlegroups.com`` mailing
list.
To update your library to the latest revision, change directory (``cd``)
to your `Theano` folder and execute the following command:
.. code-block:: bash
hg pull -u
You may also download the latest source directly as a gzip'd tar file: Feeling lucky and want to run bleeding-edge code?
`<http://pylearn.org/hg/theano/archive/tip.tar.gz>`__. Then check out the :ref:`dev_start_guide` guide.
I bet you also run with scissors.
Configuring the environment Configuring the environment
--------------------------- ---------------------------
...@@ -180,7 +133,7 @@ Mac ...@@ -180,7 +133,7 @@ Mac
- Set THEANO_BLAS_LDFLAGS to something which will link against said BLAS - Set THEANO_BLAS_LDFLAGS to something which will link against said BLAS
library. E.g., `THEANO_BLAS_LDFLAGS='-lcblas -latlas -lgfortran'`. library. E.g., `THEANO_BLAS_LDFLAGS='-lcblas -latlas -lgfortran'`.
TODO: check if this is still valid This advice has not been tested recently, so please inform us of your results.
...@@ -195,16 +148,12 @@ territory and inform us of your progress! ...@@ -195,16 +148,12 @@ territory and inform us of your progress!
Generating the documentation Generating the documentation
---------------------------- ----------------------------
This should give you the gist of it: Don't build the documentation, just find it on the web.
You can read the HTML documentation `here
.. code-block:: bash <http://pylearn.org/theano/contents.html>`.
You can download the PDF documentation `here
$ python doc/scripts/docgen.py --help <htt
Usage: doc/scripts/docgen.py [OPTIONS] You can download the latest PDF documentation `here
-o <dir>: output the html files in the specified dir <http://pylearn.org/theano/theano.pdf`.
--rst: only compile the doc (requires sphinx)
--nopdf: do not produce a PDF file from the doc, only HTML
--epydoc: only compile the api documentation (requires epydoc)
--help: this help
.. _theano-users: http://groups.google.com/group/theano-users?pli=1 .. _theano-users: http://groups.google.com/group/theano-users?pli=1
...@@ -31,37 +31,110 @@ password! We are using plain text http which is not secure. ...@@ -31,37 +31,110 @@ password! We are using plain text http which is not secure.
Theano code Theano code
=========== ===========
*To get the source via mercurial,* you must have `mercurial
<http://www.selenic.com/mercurial/wiki/>`__ installed.
The code that makes up Theano is in a single repository available in The code that makes up Theano is in a single repository available in
`<http://pylearn.org/hg/theano>`__. `<http://pylearn.org/hg/theano>`__.
As a developer, you should clone this repository like this: As a developer, you should clone this repository like this:
- `hg clone 'http://username:password@pylearn.org/hg/theano' theano` .. code-block:: bash
hg clone 'http://username:password@pylearn.org/hg/theano' theano
Nightly test You can also clone the code anonymously:
============
Each night we execute all the unit tests automatically. .. code-block:: bash
The result is sent by email to one of the developers, who (at his discretion) forwards it to the mailing list.
Said developer may not read his email obsessively (especially on the weekend) hg clone http://pylearn.org/hg/theano Theano
so there might be some latency in the process.
For more detail :ref:`see <metadocumentation_nightly_build>`.
Setting up your environment Setting up your environment
=========================== ===========================
Some notes on the environment variable $PYTHONPATH. Some notes on the environment variable $PYTHONPATH.
If theano lives in $DEV/theano, you should have $DEV in your $PYTHONPATH. You should '''not''' have $DEV/theano in your $PYTHONPATH. If theano lives in $DEV/theano, you should have $DEV in your
$PYTHONPATH. You should '''not''' have $DEV/theano in your $PYTHONPATH.
The subdirectory Theano/theano has to be in your PYTHONPATH. In order to do
that, you can either create a symbolic link to Theano/theano in a directory
already mentionned in your PYTHONPATH environment variable, or modify the
PYTHONPATH so that it mentions Theano.
To create a symbolic link:
.. code-block:: bash
ln -s Theano/theano <someplace on your PYTHONPATH>/theano
To modify the environment variable PYTHONPATH in bash, you may do this:
.. code-block:: bash
export PYTHONPATH=<path to Theano's parent dir>/Theano:$PYTHONPATH
In csh:
.. code-block:: csh
setenv PYTHONPATH <path to Theano's parent dir>/Theano:$PYTHONPATH
Olivier Breuleux explains: Olivier Breuleux explains:
$PYTHONPATH should contain a ":"-separated list of paths, each of which contains one or several Python packages, in the order in which you would like Python to search for them. If a package has sub-packages of interest to you, do _not_ add them in the path: it is not portable, might shadow other packages or short-circuit important things in its __init__. $PYTHONPATH should contain a ":"-separated list of paths, each of which
contains one or several Python packages, in the order in which you would
like Python to search for them. If a package has sub-packages of interest
to you, do _not_ add them in the path: it is not portable, might shadow
other packages or short-circuit important things in its __init__.
I advise to never import theano's files from outside theano itself (and I think that is good advice for Python packages in general). Use "from theano import tensor" instead of "import tensor". ... $PYTHONPATH ... should only contain paths to complete packages, so you don't get surprises if I add files that enter in conflict with other packages. I advise to never import theano's files from outside theano itself
(and I think that is good advice for Python packages in general). Use
"from theano import tensor" instead of "import tensor". ... $PYTHONPATH
... should only contain paths to complete packages, so you don't get
surprises if I add files that enter in conflict with other packages.
When you install a package, only the package name can be imported
directly. If you want a sub-package, you must import it from the main
package. That's how it will work in 99.9% of installs because it is the
default. Therefore, if you stray from this practice, your code will not
be portable. Also, some ways to circumvent circular dependencies might
make it so you have to import files in a certain order, which is best
handled by the package's own __init__.py.
More instructions
=================
Once you have completed these steps, you should run the tests like this:
.. code-block:: bash
cd Theano
nosetests #execute all the tests
All tests should pass. If some test fails on your machine, you are
encouraged to tell us what went wrong on the ``theano-users@googlegroups.com`` mailing
list.
To update your library to the latest revision, change directory (``cd``)
to your `Theano` folder and execute the following command:
.. code-block:: bash
hg pull -u
You may also download the latest source directly as a gzip'd tar file:
`<http://pylearn.org/hg/theano/archive/tip.tar.gz>`__.
Nightly test
============
Each night we execute all the unit tests automatically.
The result is sent by email to one of the developers, who (at his discretion) forwards it to the mailing list.
Said developer may not read his email obsessively (especially on the weekend)
so there might be some latency in the process.
For more detail :ref:`see <metadocumentation_nightly_build>`.
When you install a package, only the package name can be imported directly. If you want a sub-package, you must import it from the main package. That's how it will work in 99.9% of installs because it is the default. Therefore, if you stray from this practice, your code will not be portable. Also, some ways to circumvent circular dependencies might make it so you have to import files in a certain order, which is best handled by the package's own __init__.py.
.. _non-basic python: http://pylearn.org/theano/wiki/NonbasicPython .. _non-basic python: http://pylearn.org/theano/wiki/NonbasicPython
......
.. _how_to_release:
==================================================
How to make a release
==================================================
Clone the code::
ssh projects@pylearn.org
hg clone hg/theano Theano-0.X
Edit ``setup.py`` to contain the newest version number::
vi setup.py # Edit the version "field"
The homepage must link to the download URL, for PyPi to correctly get the
code.
Edit ``doc/index.txt`` to contain a link to what will be the download URL::
vi doc/index.txt # Edit the link to downloads/Theano-0.X.tar.gz
Tag the release. The syntax is something like the following::
cd Theano-0.X
hg tag
Now, package the release and move it to the static theano directory::
rm -Rf .hg*
cd ..
tar cvf Theano-0.X.tar Theano-0.X
gzip -9 Theano-0.X.tar
rm -Rf Theano-0.X
mv Theano-0.X.tar.gz www/theano_static/downloads/
~/repos/theano/.hg/refresh-epydoc.sh
Also, copy the latest documentation to the static directory and the target
directory::
cp www/theano/theano.pdf www/theano_static/downloads/Theano-0.X.pdf
cp www/theano/theano.pdf www/theano/downloads/Theano-0.X.pdf
Finally, use setuptools to register and upload the release::
python setup.py register sdist bdist_egg upload
I wrote the above without actually running it. This needs to be
scrutinized when you are actually do a release.
...@@ -17,3 +17,4 @@ If you're feeling ambitious, go fix some `pylint ...@@ -17,3 +17,4 @@ If you're feeling ambitious, go fix some `pylint
metadocumentation metadocumentation
python python
hg_primer hg_primer
how_to_release
...@@ -68,17 +68,33 @@ Let's say you are writing documentation, and want to see ...@@ -68,17 +68,33 @@ Let's say you are writing documentation, and want to see
the `epydoc <http://epydoc.sourceforge.net/>`__ and `sphinx the `epydoc <http://epydoc.sourceforge.net/>`__ and `sphinx
<http://sphinx.pocoo.org/>`__ output before you push it. <http://sphinx.pocoo.org/>`__ output before you push it.
The following technique uses Olivier's code to insert :api: links:: The following technique uses Olivier's code to insert :api: links:
.. code-block:: bash
cd Theano/ cd Theano/
python ./doc/scripts/docgen.py python ./doc/scripts/docgen.py
If you don't want to rerun epydoc, do the following:: If you don't want to rerun epydoc, do the following:
.. code-block:: bash
cd Theano/ cd Theano/
python ./doc/scripts/docgen.py --rst python ./doc/scripts/docgen.py --rst
For more details:
.. code-block:: bash
$ python doc/scripts/docgen.py --help
Usage: doc/scripts/docgen.py [OPTIONS]
-o <dir>: output the html files in the specified dir
--rst: only compile the doc (requires sphinx)
--nopdf: do not produce a PDF file from the doc, only HTML
--epydoc: only compile the api documentation (requires epydoc)
--help: this help
How documentation is auto-built on push How documentation is auto-built on push
--------------------------------------- ---------------------------------------
...@@ -88,12 +104,19 @@ When you push to the main repository, the following file is run:: ...@@ -88,12 +104,19 @@ When you push to the main repository, the following file is run::
projects@pylearn.org:~/repos/theano/.hg/refresh-epydoc.sh projects@pylearn.org:~/repos/theano/.hg/refresh-epydoc.sh
It calls ``epydoc`` and ``sphinx`` on the code. It calls ``epydoc`` and ``sphinx`` on the code.
Output is written to location ``TARGET_DIR=/home/projects/www/theano``.
Note that this location is *removed* at each invocation, and a fresh version
is copied in.
Static files should be kept in
``STATIC_DIR=/home/projects/www/theano_static``. For example, the
tar.gz'ed releases are in ``STATIC_DIR``. After ``TARGET_DIR`` is
recreated, the contents of ``STATIC_DIR`` are copied into ``TARGET_DIR``.
*It would be nice to explain this stuff in a little more depth:* *It would be nice to explain this stuff in a little more depth:*
* Who calls refresh-epydoc.sh ? * Who calls refresh-epydoc.sh ?
* What exactly does it do? * What exactly does it do?
* Where does the output go?
* Can we get links about mercurial hooks? * Can we get links about mercurial hooks?
* What happens if two people push at the same time? Does documentation get clobbered? * What happens if two people push at the same time? Does documentation get clobbered?
...@@ -116,7 +139,7 @@ The nightly build/tests process ...@@ -116,7 +139,7 @@ The nightly build/tests process
The user ``lisa`` runs a cronjob on the computer ``boltzmann``. The user ``lisa`` runs a cronjob on the computer ``boltzmann``.
This happens nightly. This happens nightly.
The cronjob executes the script ``~/nightly_build/do_nightly_build_theano``. The cronjob executes the script ``~/www/nightly_build/do_nightly_build_theano``.
This script performs a an "hg pull -u" of theano (and pylearn too). This script performs a an "hg pull -u" of theano (and pylearn too).
Then it executes something like Then it executes something like
......
[nosetests] [nosetest]
match=^test match=^test
nocapture=1 nocapture=1
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论