提交 53df7d6c authored 作者: nouiz's avatar nouiz

Merge pull request #972 from delallea/minor2

Minor stuff
...@@ -29,7 +29,7 @@ instructions below for detailed installation steps): ...@@ -29,7 +29,7 @@ instructions below for detailed installation steps):
Not technically required but *highly* recommended, in order to compile Not technically required but *highly* recommended, in order to compile
generated C code. Theano `can` fall back on a NumPy-based Python execution generated C code. Theano `can` fall back on a NumPy-based Python execution
model, but a C compiler allows for vastly faster execution. model, but a C compiler allows for vastly faster execution.
g++ >= 4.2 (for openmp that is currently always used) g++ >= 4.2 (for openmp that is currently always used)
more recent version recommended! more recent version recommended!
`NumPy <http://numpy.scipy.org/>`_ >= 1.5.0 `NumPy <http://numpy.scipy.org/>`_ >= 1.5.0
...@@ -41,7 +41,7 @@ instructions below for detailed installation steps): ...@@ -41,7 +41,7 @@ instructions below for detailed installation steps):
>=0.8 if you are using sparse matrices, because ``scipy.sparse`` >=0.8 if you are using sparse matrices, because ``scipy.sparse``
is buggy in 0.6 (the ``scipy.csc_matrix`` version of ``dot()`` has a is buggy in 0.6 (the ``scipy.csc_matrix`` version of ``dot()`` has a
bug with singleton dimensions, there may be more bugs) and we do not bug with singleton dimensions, there may be more bugs) and we do not
tests with 0.7*. run tests with 0.7.
A `BLAS`_ installation (with Level 3 functionality) A `BLAS`_ installation (with Level 3 functionality)
Including the development headers (``-dev``, ``-devel``, depending on Including the development headers (``-dev``, ``-devel``, depending on
......
...@@ -15,7 +15,7 @@ Note that you want SciPy >= 0.8.0. ...@@ -15,7 +15,7 @@ Note that you want SciPy >= 0.8.0.
dimensions. There may be more bugs. It also has inconsistent dimensions. There may be more bugs. It also has inconsistent
implementation of sparse matrices. implementation of sparse matrices.
We do not test again SciPy 0.7.*. We do not test against SciPy 0.7.*.
We describe the details of the compressed sparse matrix types. We describe the details of the compressed sparse matrix types.
``scipy.sparse.csc_matrix`` ``scipy.sparse.csc_matrix``
......
...@@ -49,17 +49,17 @@ Faster Small Theano function ...@@ -49,17 +49,17 @@ Faster Small Theano function
For Theano 0.6 and up. For Theano 0.6 and up.
For Theano function that don't do much work like a regular logistic For Theano functions that don't do much work, like a regular logistic
regression, the overhead of checking the input can be significant. You regression, the overhead of checking the input can be significant. You
can disable it by setting f.trust_input to True to remove this can disable it by setting ``f.trust_input`` to True.
check. Make sure you pass argument as what you said when compiling the Make sure the types of arguments you provide match those defined when
Theano function. the function was compiled.
Also for small Theano function, you can remove more python overhead by Also, for small Theano functions, you can remove more Python overhead by
making a Theano function that don't take any inputs. You can use shared making a Theano function that does not take any input. You can use shared
variable to help you. Then you can call it like this: ``f.fn()`` or variables to achieve this. Then you can call it like this: ``f.fn()`` or
``f.fn(n_calls=N)`` to speed up. In the last case, only the last ``f.fn(n_calls=N)`` to speed it up. In the last case, only the last
function output is returned. function output (out of N calls) is returned.
Related Projects Related Projects
---------------- ----------------
......
import os, logging, sys import logging
import os
import sys
import theano import theano
from theano import config from theano import config
......
...@@ -96,7 +96,7 @@ class BinCountOp(theano.Op): ...@@ -96,7 +96,7 @@ class BinCountOp(theano.Op):
if not bool(numpy_ver >= [1, 6]): if not bool(numpy_ver >= [1, 6]):
raise NotImplementedError( raise NotImplementedError(
"BinCountOp with minlength attribute" "BinCountOp with minlength attribute"
" need NumPy 1.6 or higher.") " requires NumPy 1.6 or higher.")
def __eq__(self, other): def __eq__(self, other):
return (type(self) == type(other) and return (type(self) == type(other) and
...@@ -152,7 +152,7 @@ class BinCountOp(theano.Op): ...@@ -152,7 +152,7 @@ class BinCountOp(theano.Op):
if weights is not None and weights.shape != x.shape: if weights is not None and weights.shape != x.shape:
raise TypeError("All inputs must have the same shape.") raise TypeError("All inputs must have the same shape.")
#Needed for numpy 1.4.1 compatibility # Needed for numpy 1.4.1 compatibility
if self.minlength: if self.minlength:
out = np.bincount(x, weights=weights, minlength=self.minlength) out = np.bincount(x, weights=weights, minlength=self.minlength)
else: else:
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论