Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
204338b0
提交
204338b0
authored
1月 19, 2010
作者:
James Bergstra
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
docs: revs to introduction
上级
8629ea7d
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
34 行增加
和
39 行删除
+34
-39
introduction.txt
doc/introduction.txt
+34
-39
没有找到文件。
doc/introduction.txt
浏览文件 @
204338b0
...
@@ -5,43 +5,40 @@
...
@@ -5,43 +5,40 @@
Theano at a Glance
Theano at a Glance
==================
==================
Theano is a Python library that allows you to define, optimize, and evaluate
Theano is a Python library that lets you to define, optimize, and evaluate
mathematical expressions involving multi-dimensional arrays. Using Theano it is
mathematical expressions, especially ones with multi-dimensional arrays
(numpy.ndarray). Using Theano it is
possible to attain speeds rivaling hand-crafted C implementations for problems
possible to attain speeds rivaling hand-crafted C implementations for problems
involving large amounts of data. It can also surpass C on a CPU by many orders
involving large amounts of data. It can also surpass C on a CPU by many orders
of magnitude by taking advantage of recent GPUs.
of magnitude by taking advantage of recent GPUs.
Theano melds some aspects of a computer algebra system (CAS) with
Theano combines aspects of a computer algebra system (CAS) with aspects of an
aspects of an optimizing compiler. It can even transform some or all
optimizing compiler. It can also generate customized C code for many
of the mathematical expression into C code and compile it into native
mathematical operations. This combination of CAS with optimizing compilation
machine instructions. This combination of CAS with optimizing
is particularly useful for tasks in which complicated mathematical expressions
compilation is particularly useful for tasks in which complicated
are evaluated repeatedly and evaluation speed is critical. For situations
mathematical expressions are evaluated repeatedly and evaluation speed
where many different expressions are each evaluated once Theano can minimize
is critical.
the amount of compilation/analysis overhead, but still provide symbolic
features such as automatic differentiation.
Theano supports a range of numerical types in multiple dimensions and
a number of well-tested operations. It also allows you to compute the
gradient of an expression with respect to another. Symbolic
expressions may be compiled into functions, which work on the same
data structures as numpy_, allowing for easy interoperability.
Theano's compiler applies many optimizations of varying complexity to
Theano's compiler applies many optimizations of varying complexity to
these symbolic expressions. These optimizations include, but are not
these symbolic expressions. These optimizations include, but are not
limited to:
limited to:
* use of GPU for computations
* constant folding
* constant folding
* merging of similar subgraphs, to avoid
calculating the same values
* merging of similar subgraphs, to avoid
redundant calculation
more than once
* arithmetic simplification (e.g. ``x*y/x -> y``, ``--x -> x``)
*
arithmetic simplification (``x*y/x -> y``)
*
inserting efficient BLAS_ operations (e.g. ``GEMM``) in a variety of
* inserting efficient BLAS_ operation
s
context
s
* using
inplace operations wherever it is safe to do so.
* using
memory aliasing to avoid calculation
* using inplace operations wherever it does not interfere with aliasing
Theano defines several optimizations which improve the numerical
* loop fusion for elementwise sub-expressions
stability of computations.
* improvements to numerical stability (e.g. :math:`\log(1+\exp(x))` and :math:`\log(\sum_i \exp(x[i]))`)
* for a complete list, see :ref:`_optimizations`
Theano was written at the LISA_ lab to support the development of
efficient machine learning algorithms while minimizing human time. We
Theano was written at the LISA_ lab to support rapid development of
use it especially in gradient-based learning techniques.
Theano is
efficient machine learning algorithms.
Theano is
named after the `Greek mathematician`_, who may have been Pythagoras'
named after the `Greek mathematician`_, who may have been Pythagoras'
wife. Theano is released under a BSD license (:ref:`link <license>`).
wife. Theano is released under a BSD license (:ref:`link <license>`).
...
@@ -92,30 +89,28 @@ machine instructions.
...
@@ -92,30 +89,28 @@ machine instructions.
What does it do that they don't?
What does it do that they don't?
================================
================================
Theano is a
p
ython library and optimizing compiler for manipulating
Theano is a
P
ython library and optimizing compiler for manipulating
and evaluating expressions, especially matrix-valued
and evaluating expressions, especially matrix-valued
ones. Manipulation of matrices is typically done using the numpy
ones. Manipulation of matrices is typically done using the numpy
package, so what does Theano do that Python and numpy do not?
package, so what does Theano do that Python and numpy do not?
- *execution speed optimizations*: Theano can use `g++` to compile
- *execution speed optimizations*: Theano can use `g++`
or `nvcc`
to compile
parts your expression graph into
native machine code, which runs
parts your expression graph into
CPU or GPU instructions, which run
much faster than python.
much faster than p
ure P
ython.
- *symbolic differentiation*: Theano can automatic build symbolic graphs
- *symbolic differentiation*: Theano can automatic build symbolic graphs
for computing gradients.
for computing gradients.
- *stability optimizations*: Theano can recognize numerically unstable
- *stability optimizations*: Theano can recognize
[some]
numerically unstable
expressions and compute them with more stable algorithms.
expressions and compute them with more stable algorithms.
There exist another symbolic package in Python, namely sympy_. Theano
The closest Python package to Theano is sympy_.
is different from sympy in the sense that while Theano allows symbolic
Theano focuses more on tensor expressions than Sympy, and has more machinery
manipulation it puts more emphasis on the evaluation of these expressions
for compilation. Sympy has more sophisticated algebra rules and can
and being able to repeatedly evaluate them on many different inputs. Theano
handle a wider variety of mathematical operations (such as series, limits, and integrals).
is also better suited to handling large tensors which have no
assumed structures.
If numpy_ is to be compared to MATLAB_ and sympy_ to Mathematica_,
If numpy_ is to be compared to MATLAB_ and sympy_ to Mathematica_,
Theano is a sort of hybrid of the two which tries to
mak
e the best of
Theano is a sort of hybrid of the two which tries to
combin
e the best of
both worlds.
both worlds.
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论