提交 14fcbe82 authored 作者: Frédéric Bastien's avatar Frédéric Bastien

Merge pull request #1464 from delallea/minor

Minor fixes
差异被折叠。
...@@ -850,7 +850,7 @@ You can then proceed to the :ref:`windows_basic` or the :ref:`windows_bleeding_e ...@@ -850,7 +850,7 @@ You can then proceed to the :ref:`windows_basic` or the :ref:`windows_bleeding_e
Alternative: Canopy Alternative: Canopy
################### ###################
Another software from Enthought that install all Theano dependancy. Another software from Enthought that installs all Theano dependencies.
If you are affiliated with a university (as student or employee), you If you are affiliated with a university (as student or employee), you
can download the installation for free. can download the installation for free.
...@@ -863,8 +863,8 @@ can download the installation for free. ...@@ -863,8 +863,8 @@ can download the installation for free.
- In Canopy Package Manager, search and install packages "mingw 4.5.2" and "libpython 1.2" - In Canopy Package Manager, search and install packages "mingw 4.5.2" and "libpython 1.2"
- (Needed only for Theano 0.6rc3 or earlier) - (Needed only for Theano 0.6rc3 or earlier)
The "libpython 1.2" package installs files `libpython27.a` and `libmsvcr90.a` to The "libpython 1.2" package installs files `libpython27.a` and `libmsvcr90.a` to
`C:\Users\<USER>\AppData\Local\Enthought\Canopy\User\libs`. Copy the two files to `C:\\Users\\<USER>\\AppData\\Local\\Enthought\\Canopy\\User\\libs`. Copy the two files to
`C:\Users\<USER>\AppData\Local\Enthought\Canopy\App\appdata\canopy-1.0.0.1160.win-x86_64\libs`. `C:\\Users\\<USER>\\AppData\\Local\\Enthought\\Canopy\\App\\appdata\\canopy-1.0.0.1160.win-x86_64\libs`.
- (Needed only for Theano 0.6rc3 or earlier) Set the Theano flags - (Needed only for Theano 0.6rc3 or earlier) Set the Theano flags
``blas.ldflags=-LC:\Users\<USER>\AppData\Local\Enthought\Canopy\App\appdata\canopy-1.0.0.1160.win-x86_64\Scripts -lmk2_core -lmk2_intel_thread -lmk2_rt``. ``blas.ldflags=-LC:\Users\<USER>\AppData\Local\Enthought\Canopy\App\appdata\canopy-1.0.0.1160.win-x86_64\Scripts -lmk2_core -lmk2_intel_thread -lmk2_rt``.
......
...@@ -288,12 +288,12 @@ can be achieved as follows: ...@@ -288,12 +288,12 @@ can be achieved as follows:
To help understand what is happening in your graph, you can To help understand what is happening in your graph, you can
disable the ``local_elemwise_fusion`` and all ``inplace`` disable the ``local_elemwise_fusion`` and all ``inplace``
optimizations. The first is a speed optimization that merge elemwise optimizations. The first is a speed optimization that merges elemwise
operations together. This make it harder to know which particular operations together. This makes it harder to know which particular
elemwise cause the problem. The second optimization make some ops elemwise causes the problem. The second optimization makes some ops'
output overwrite its input. So, if an op create a bad output, you outputs overwrite their inputs. So, if an op creates a bad output, you
won't be able see the input that was overwriten in the ``post_fun`` will not be able to see the input that was overwriten in the ``post_func``
function. To disable those optimization (with a Theano version after function. To disable those optimizations (with a Theano version after
0.6rc3), define the MonitorMode like this: 0.6rc3), define the MonitorMode like this:
.. code-block:: python .. code-block:: python
...@@ -311,7 +311,7 @@ function. To disable those optimization (with a Theano version after ...@@ -311,7 +311,7 @@ function. To disable those optimization (with a Theano version after
mode with MonitorMode, as you need to define what you monitor. mode with MonitorMode, as you need to define what you monitor.
To be sure all inputs of the node are available during the call to To be sure all inputs of the node are available during the call to
``post_func``, you also must disable the garbage collector. Otherwise, ``post_func``, you must also disable the garbage collector. Otherwise,
the execution of the node can garbage collect its inputs that aren't the execution of the node can garbage collect its inputs that aren't
needed anymore by the Theano function. This can be done with the Theano needed anymore by the Theano function. This can be done with the Theano
flag: flag:
......
...@@ -37,14 +37,14 @@ class MonitorMode(Mode): ...@@ -37,14 +37,14 @@ class MonitorMode(Mode):
:param optimizer: The optimizer to use. One may use for instance :param optimizer: The optimizer to use. One may use for instance
'fast_compile' to skip optimizations. 'fast_compile' to skip optimizations.
:param linker: DO NOT USE. This mode use its own linker. :param linker: DO NOT USE. This mode uses its own linker.
The parameter is needed to allow selecting optimizers to use. The parameter is needed to allow selecting optimizers to use.
""" """
self.pre_func = pre_func self.pre_func = pre_func
self.post_func = post_func self.post_func = post_func
wrap_linker = theano.gof.WrapLinkerMany([theano.gof.OpWiseCLinker()], wrap_linker = theano.gof.WrapLinkerMany([theano.gof.OpWiseCLinker()],
[self.eval]) [self.eval])
if optimizer is 'default': if optimizer == 'default':
optimizer = theano.config.optimizer optimizer = theano.config.optimizer
if (linker is not None and if (linker is not None and
not isinstance(linker.mode, MonitorMode)): not isinstance(linker.mode, MonitorMode)):
......
...@@ -442,7 +442,8 @@ def pfunc(params, outputs=None, mode=None, updates=None, givens=None, ...@@ -442,7 +442,8 @@ def pfunc(params, outputs=None, mode=None, updates=None, givens=None,
if len(updates) > 0 and any(isinstance(v, Variable) if len(updates) > 0 and any(isinstance(v, Variable)
for v in iter_over_pairs(updates)): for v in iter_over_pairs(updates)):
raise ValueError( raise ValueError(
"The updates parameter must an OrderedDict/dict or a list of list/tuple with 2 elements") "The updates parameter must be an OrderedDict/dict or a list of "
"lists/tuples with 2 elements")
# transform params into theano.compile.In objects. # transform params into theano.compile.In objects.
inputs = [_pfunc_param_to_in(p, allow_downcast=allow_input_downcast) inputs = [_pfunc_param_to_in(p, allow_downcast=allow_input_downcast)
......
...@@ -1457,7 +1457,7 @@ def std_lib_dirs_and_libs(): ...@@ -1457,7 +1457,7 @@ def std_lib_dirs_and_libs():
# directories. # directories.
python_lib_dirs = [os.path.join(os.path.dirname(python_inc), 'libs')] python_lib_dirs = [os.path.join(os.path.dirname(python_inc), 'libs')]
if "Canopy" in python_lib_dirs[0]: if "Canopy" in python_lib_dirs[0]:
# Canopy store libpython27.a and libmsccr90.a in this directory. # Canopy stores libpython27.a and libmsccr90.a in this directory.
# For some reason, these files are needed when compiling Python # For some reason, these files are needed when compiling Python
# modules, even when libpython27.lib and python27.dll are # modules, even when libpython27.lib and python27.dll are
# available, and the *.a files have to be found earlier than # available, and the *.a files have to be found earlier than
...@@ -1467,7 +1467,7 @@ def std_lib_dirs_and_libs(): ...@@ -1467,7 +1467,7 @@ def std_lib_dirs_and_libs():
for f, lib in [('libpython27.a', 'libpython 1.2'), for f, lib in [('libpython27.a', 'libpython 1.2'),
('libmsvcr90.a', 'mingw 4.5.2')]: ('libmsvcr90.a', 'mingw 4.5.2')]:
if not os.path.exists(os.path.join(libdir, f)): if not os.path.exists(os.path.join(libdir, f)):
print ("Your python version is from Canopy. " + print ("Your Python version is from Canopy. " +
"You need to install the package '" + lib + "You need to install the package '" + lib +
"' from Canopy package manager." "' from Canopy package manager."
) )
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论