提交 f61067ec authored 作者: lamblin's avatar lamblin

Merge pull request #841 from nouiz/mixed

Mixed
...@@ -34,8 +34,8 @@ Download ...@@ -34,8 +34,8 @@ Download
======== ========
Theano is now `available on PyPI`_, and can be installed via ``easy_install Theano is now `available on PyPI`_, and can be installed via ``easy_install
Theano``, or by downloading and unpacking the tarball and typing ``python Theano``, ``pip install Theano`` or by downloading and unpacking the tarball
setup.py install``. and typing ``python setup.py install``.
Those interested in bleeding-edge features should obtain the latest development Those interested in bleeding-edge features should obtain the latest development
version, available via:: version, available via::
...@@ -48,6 +48,10 @@ directory, so that when you pull updates via Git, they will be ...@@ -48,6 +48,10 @@ directory, so that when you pull updates via Git, they will be
automatically reflected the "installed" version. For more information about automatically reflected the "installed" version. For more information about
installation and configuration, see :ref:`installing Theano <install>`. installation and configuration, see :ref:`installing Theano <install>`.
Master Tests Status:
.. image:: https://secure.travis-ci.org/Theano/Theano.png
.. _available on PyPI: http://pypi.python.org/pypi/Theano .. _available on PyPI: http://pypi.python.org/pypi/Theano
.. _Related Projects: https://github.com/Theano/Theano/wiki/Related-projects .. _Related Projects: https://github.com/Theano/Theano/wiki/Related-projects
......
...@@ -203,6 +203,10 @@ the Theano cache like this: ...@@ -203,6 +203,10 @@ the Theano cache like this:
Bleeding-edge install instructions Bleeding-edge install instructions
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Master Tests Status:
.. image:: https://secure.travis-ci.org/Theano/Theano.png
If you are a developer of Theano, then check out the :ref:`dev_start_guide`. If you are a developer of Theano, then check out the :ref:`dev_start_guide`.
If you want the bleeding-edge without developing the code you can use pip for If you want the bleeding-edge without developing the code you can use pip for
...@@ -740,6 +744,39 @@ pip is not included in EPD, but you can simply install it with:: ...@@ -740,6 +744,39 @@ pip is not included in EPD, but you can simply install it with::
easy_install pip easy_install pip
Alternative: Anaconda 0.8.3 (Linux VM on Windows)
#################################################
ContinuumIO_ provide a free Windows VM with Theano install. The VM is the CentOS6.2 64 bit OS.
- If you havan't a VMWare software install VMWare player(free): http://www.vmware.com/products/player/
- Download the VM: http://continuum.io/downloads.html
- Follow the instruction on the ContinuumIO website to start the VM
- Configure Theano by executing this:
.. code-block:: bash
echo "[blas]" >> ~/.theanorc
echo "ldflags=" >> ~/.theanorc
- [Optional] To enable the network, go into the VMWare setting for the vm and set the networking to NAT. Start the VM. In the VM, comment all lines in the file /etc/udev/rules.d/70-persistent-net.rules and restart the VM.
- [Optional] to install easy_install:
.. code-block:: bash
wget -c http://pypi.python.org/packages/source/s/setuptools/setuptools-0.6c11.tar.gz#md5=7df2a529a074f613b509fb44feefe74e
tar -zxf setuptools-0.6c11.tar.gz
cd setuptools-0.6c11
sudo /opt/anaconda/bin/python setup.py install
- [Optional] To install pip
.. code-block:: bash
#install setuptools
sudo /opt/anaconda/bin/easy_install pip
.. _ContinuumIO: http://continuum.io
Alternative: Python(x,y) Alternative: Python(x,y)
######################## ########################
......
...@@ -134,7 +134,7 @@ def run_tests(venv): ...@@ -134,7 +134,7 @@ def run_tests(venv):
try: try:
return True, check_output([iptest], stderr=STDOUT).decode('utf-8') return True, check_output([iptest], stderr=STDOUT).decode('utf-8')
except CalledProcessError as e: except CalledProcessError, e:
return False, e.output.decode('utf-8') return False, e.output.decode('utf-8')
finally: finally:
# Restore $PATH # Restore $PATH
......
...@@ -82,24 +82,24 @@ class T_updates(unittest.TestCase): ...@@ -82,24 +82,24 @@ class T_updates(unittest.TestCase):
def test_err_ndim(self): def test_err_ndim(self):
# Test that we raise a good error message when we don't # Test that we raise a good error message when we don't
# same the same number of dimensions. # have the same number of dimensions.
data = numpy.random.rand(10, 10).astype('float32') data = numpy.random.rand(10, 10).astype('float32')
output_var = f32sc(name="output", value=data) output_var = f32sc(name="output", value=data)
# the update_var has type matrix, and the update expression # the update_var has type matrix, and the update expression
# is a broadcasted scalar, and that should be allowed. # is a broadcasted scalar, and that should not be allowed.
self.assertRaises(TypeError, theano.function, inputs=[], outputs=[], self.assertRaises(TypeError, theano.function, inputs=[], outputs=[],
updates={output_var: updates={output_var:
output_var.sum()}) output_var.sum()})
def test_err_broadcast(self): def test_err_broadcast(self):
# Test that we raise a good error message when we don't # Test that we raise a good error message when we don't
# same the same number of dimensions. # have the same number of dimensions.
data = numpy.random.rand(10, 10).astype('float32') data = numpy.random.rand(10, 10).astype('float32')
output_var = f32sc(name="output", value=data) output_var = f32sc(name="output", value=data)
# the update_var has type matrix, and the update expression # the update_var has type matrix, and the update expression
# is a broadcasted scalar, and that should be allowed. # is a broadcasted scalar, and that should not be allowed.
self.assertRaises(TypeError, theano.function, inputs=[], outputs=[], self.assertRaises(TypeError, theano.function, inputs=[], outputs=[],
updates={output_var: updates={output_var:
output_var.sum().dimshuffle('x', 'x')}) output_var.sum().dimshuffle('x', 'x')})
......
...@@ -437,7 +437,9 @@ class SparseType(gof.Type): ...@@ -437,7 +437,9 @@ class SparseType(gof.Type):
# This is Fred suggestion for a quick and dirty way of checking # This is Fred suggestion for a quick and dirty way of checking
# aliasing .. this can potentially be further refined (ticket #374) # aliasing .. this can potentially be further refined (ticket #374)
if _is_sparse(a) and _is_sparse(b): if _is_sparse(a) and _is_sparse(b):
return a is b return (SparseType.may_share_memory(a, b.data) or
SparseType.may_share_memory(a, b.indices) or
SparseType.may_share_memory(a, b.indptr))
if _is_sparse(b) and isinstance(a, numpy.ndarray): if _is_sparse(b) and isinstance(a, numpy.ndarray):
a, b = b, a a, b = b, a
if _is_sparse(a) and isinstance(b, numpy.ndarray): if _is_sparse(a) and isinstance(b, numpy.ndarray):
......
...@@ -1323,6 +1323,10 @@ def test_may_share_memory(): ...@@ -1323,6 +1323,10 @@ def test_may_share_memory():
(b.indptr, a, False), (b.indptr, a, False),
(b.indices, a, False), (b.indices, a, False),
(as_ar(b.shape), a, False), (as_ar(b.shape), a, False),
(a.transpose(), a, True),
(b.transpose(), b, True),
(a.transpose(), b, False),
(b.transpose(), a, False),
]: ]:
assert SparseType.may_share_memory(a_, b_) == rep assert SparseType.may_share_memory(a_, b_) == rep
......
...@@ -86,8 +86,17 @@ def main(stdout=None, stderr=None, argv=None, theano_nose=None, ...@@ -86,8 +86,17 @@ def main(stdout=None, stderr=None, argv=None, theano_nose=None,
if argv is None: if argv is None:
argv = sys.argv argv = sys.argv
if theano_nose is None: if theano_nose is None:
theano_nose = os.path.join(theano.__path__[0], '..', #If Theano is installed with pip/easy_install, it can be in the
'bin', 'theano-nose') #*/lib/python2.7/site-packages/theano, but theano-nose in */bin
for i in range(1, 5):
path = theano.__path__[0]
for _ in range(i):
path = os.path.join(path, '..')
path = os.path.join(path, 'bin', 'theano-nose')
if os.path.exists(path):
theano_nose = path
if theano_nose is None:
raise Exception("Not able to find theano_nose")
if batch_size is None: if batch_size is None:
batch_size = 100 batch_size = 100
stdout_backup = sys.stdout stdout_backup = sys.stdout
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论