提交 79477c36 authored 作者: James Bergstra's avatar James Bergstra

merge

...@@ -14,23 +14,5 @@ Use the fast BLAS library that Fred installed, by setting ...@@ -14,23 +14,5 @@ Use the fast BLAS library that Fred installed, by setting
Tips for running on a cluster Tips for running on a cluster
----------------------------- -----------------------------
:ref:`mammouth`
OUTDATED(was for mammouth1, should be updated for mammouth2) For instructions on running Theano on the mammouth cluster.
Use something like the following in your .bashrc:
.. code-block:: bash
#use the intel math-kernel library for BLAS routines
THEANO_BLAS_LDFLAGS=-lmkl
# use up to two threads in the MKL routines
OMP_NUM_THREADS=2
You may also need to run the following from your shell:
.. code-block:: bash
module add python # for the current shell session
module initadd python # for this and future sessions
Lastly, if ``./filename.py`` doesn't work, try ``python filename.py``.
.. _mammouth:
=========================== ===========================
Running Theano on Mammouth Running Theano on Mammouth
=========================== ===========================
......
...@@ -137,6 +137,8 @@ if __name__ == '__main__': ...@@ -137,6 +137,8 @@ if __name__ == '__main__':
shutil.rmtree(workdir) shutil.rmtree(workdir)
except OSError, e: except OSError, e:
print 'OSError:', e print 'OSError:', e
except IOError, e:
print 'IOError:', e
...@@ -603,7 +603,7 @@ class Clip(ScalarOp): ...@@ -603,7 +603,7 @@ class Clip(ScalarOp):
def c_code(self, node, name, (x, min, max), (z, ), sub): def c_code(self, node, name, (x, min, max), (z, ), sub):
return "%(z)s = %(x)s < %(min)s ? %(min)s : %(x)s > %(max)s ? %(max)s : %(x)s;" % locals() return "%(z)s = %(x)s < %(min)s ? %(min)s : %(x)s > %(max)s ? %(max)s : %(x)s;" % locals()
def grad(self, (x, min, max), (gz, )): def grad(self, (x, min, max), (gz, )):
gx = (x > min and x < max) * gz gx = ((x > min) & (x < max)) * gz
return gx, None, None return gx, None, None
clip = Clip(transfer_type(0), name = 'clip') clip = Clip(transfer_type(0), name = 'clip')
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论