Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
839eda94
提交
839eda94
authored
1月 15, 2010
作者:
Razvan Pascanu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
changes into the tutorials
上级
0fc7c8ca
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
33 行增加
和
12 行删除
+33
-12
adding.txt
doc/tutorial/adding.txt
+4
-6
examples.txt
doc/tutorial/examples.txt
+3
-0
index.txt
doc/tutorial/index.txt
+1
-1
numpy.txt
doc/tutorial/numpy.txt
+25
-5
scan.py
theano/sandbox/scan.py
+0
-0
test_scan.py
theano/sandbox/test_scan.py
+0
-0
没有找到文件。
doc/tutorial/adding.txt
浏览文件 @
839eda94
...
...
@@ -8,8 +8,8 @@ Baby steps - Adding two numbers together
Adding two scalars
==================
So, to get us started
and get a feel of what we're working with, let's
make a simple function: add two numbers together. Here is how you do
So, to get us started
with Theano and get a feel of what we're working with,
let's
make a simple function: add two numbers together. Here is how you do
it:
>>> x = T.dscalar('x')
...
...
@@ -26,7 +26,7 @@ array(28.4)
Let's break this down into several steps. The first step is to define
two symbols
, or Variables,
representing the quantities that you want
two symbols
representing the quantities that you want
to add. Note that from now on, we will use the term :term:`Variable`
to mean "symbol" (in other words, ``x``, ``y``, ``z`` are all Variable
objects). The output of the function ``f`` is a ``numpy.ndarray``
...
...
@@ -36,7 +36,6 @@ If you are following along and typing into an interpreter, you may have
noticed that there was a slight delay in executing the ``function``
instruction. Behind the scenes, ``f`` was being compiled into C code.
.. TODO: help
-------------------------------------------
...
...
@@ -64,8 +63,7 @@ TensorType(float64, scalar)
>>> x.type == T.dscalar
True
You can learn more about the structures in Theano in
the :ref:`advtutorial` and in :ref:`graphstructures`.
You can learn more about the structures in Theano in :ref:`graphstructures`.
By calling ``T.dscalar`` with a string argument, you create a
:term:`Variable` representing a floating-point scalar quantity with the
...
...
doc/tutorial/examples.txt
浏览文件 @
839eda94
...
...
@@ -137,6 +137,9 @@ with respect to the second. In this way, Theano can be used for
`automatic differentiation`_.
.. note::
The second argument of ``T.grad`` can be a list, case in which it
will
The variable of ``T.grad`` has the same dimensions as the
second argument. This is exactly like the first derivative if the
...
...
doc/tutorial/index.txt
浏览文件 @
839eda94
...
...
@@ -10,7 +10,7 @@ Let's start an interactive session and import Theano.
>>> from theano import *
Many of symbols you will need to use are in the ``tensor`` subpackage
of
t
heano. Let's import that subpackage under a handy name. I like
of
T
heano. Let's import that subpackage under a handy name. I like
``T`` (and many tutorials use this convention).
>>> import theano.tensor as T
...
...
doc/tutorial/numpy.txt
浏览文件 @
839eda94
...
...
@@ -8,10 +8,9 @@ NumPy refresher
Here are some quick guides to NumPy:
* `Numpy quick guide for Matlab users <http://www.scipy.org/NumPy_for_Matlab_Users>`__
* `More detailed table showing the NumPy equivalent of Matlab commands <http://www.scribd.com/doc/26685/Matlab-Python-and-R>`__
* `Numpy User Guide <http://docs.scipy.org/doc/numpy/user/index.html>`__
* `More detailed Numpy tutorial <http://www.scipy.org/Tentative_NumPy_Tutorial>`__
.. TODO [DefineBroadcasting Broadcasting]
.. Broadcastable - Implicitly assume that all previous entries are true.
.. [TODO: More doc, e.g. see _test_tensor.py]
...
...
@@ -20,8 +19,10 @@ Matrix conventions for machine learning
Rows are horizontal and columns are vertical.
Every row is an example. Therefore, inputs[10,5] is a matrix of 10 examples with 5 dimensions per.
So to make a NN out of it, multiply by a weight matrix of size (5, #hid).
Every row is an example. Therefore, inputs[10,5] is a matrix of 10 examples
where each example has dimension 5. If this would be the input of a
neural network then the weights from the input the the first hidden
layer would represent a matrix of size (5, #hid).
If I have an array:
...
...
@@ -43,3 +44,22 @@ To access the entry in the 3rd row (row #2) and the 1st column (column #0):
To remember this, keep in mind that we read left-to-right, top-to-bottom,
so each thing that is contiguous is a row. That is, there are 3 rows
and 2 columns.
Broadcasting
============
Numpy does :term:`broadcasting` of numpy arrays of different shapes during
arithmetic operations. What this means in general is that the smaller
array is *broadcasted* across the larger array so that they have
compatible shapes. The example below shows an instance of
*broadcastaing*:
>>> a = numpy.asarray([1.0, 2.0, 3.0])
>>> b = 2.0
>>> a * b
array([2., 4., 6.])
The smaller array ``b`` in this case is *broadcasted* to the same size
as a during the multiplication. This trick is often useful in
simplifying how expression are written. More details about *broadcasting*
can be found at `numpy user guide <http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html>`__ .
theano/sandbox/scan.py
浏览文件 @
839eda94
差异被折叠。
点击展开。
theano/sandbox/test_scan.py
浏览文件 @
839eda94
差异被折叠。
点击展开。
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论