Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
d2b2e4fe
提交
d2b2e4fe
authored
1月 13, 2015
作者:
Frederic
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update nextml2015 pres
上级
e543f6ef
显示空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
84 行增加
和
50 行删除
+84
-50
presentation.tex
doc/nextml2015/presentation.tex
+84
-50
没有找到文件。
doc/nextml2015/presentation.tex
浏览文件 @
d2b2e4fe
...
@@ -145,6 +145,7 @@ We use the IMDB dataset.
...
@@ -145,6 +145,7 @@ We use the IMDB dataset.
\end{frame}
\end{frame}
\begin{frame}
{
Description
}
\begin{frame}
{
Description
}
TODO, merge with next slides
\begin{itemize}
\begin{itemize}
\item
Mathematical symbolic expression compiler
\item
Mathematical symbolic expression compiler
\item
Expressions mimic NumPy's syntax and semantics
\item
Expressions mimic NumPy's syntax and semantics
...
@@ -386,7 +387,7 @@ from theano import tensor as T
...
@@ -386,7 +387,7 @@ from theano import tensor as T
tensor3 = T.TensorType(
tensor3 = T.TensorType(
broadcastable=(False, False, False),
broadcastable=(False, False, False),
dtype='float32')
dtype='float32')
x = tensor3()
x =
T.
tensor3()
\end{lstlisting}
\end{lstlisting}
\end{frame}
\end{frame}
...
@@ -430,11 +431,31 @@ b = a.T
...
@@ -430,11 +431,31 @@ b = a.T
# Same as b
# Same as b
c = a.dimshuffle((0, 1))
c = a.dimshuffle((0, 1))
# Adding to larger tensor
# Adding to larger tensor
d = a.dimshuffle((0, 1,
``x'
'))
d = a.dimshuffle((0, 1,
'x
'))
e = a + d
e = a + d
\end{lstlisting}
\end{lstlisting}
\end{frame}
\end{frame}
\begin{frame}
\frametitle
{
Indexing
}
As NumPy!
\begin{itemize}
\item
This mean all slices, index selection return view:
\begin{itemize}
\item
a
\_
tensor[startstopstep, N] # return a view
\item
a
\_
tensor[-1] # reverse the vector, return a view
\end{itemize}
\item
Advanced indexing as NumPy:
\begin{itemize}
\item
This mean it can use vector/tensor of indices to use.
\item
this create a copy
\item
This can be mixed with slicing/index selection.
\item
GPU Support only this case: a
\_
tensor[an
\_
index
\_
vector]
\end{itemize}
\end{itemize}
\end{frame}
\subsection
{
Compiling/Running
}
\subsection
{
Compiling/Running
}
\begin{frame}
{
Compiling and running expression
}
\begin{frame}
{
Compiling and running expression
}
\begin{itemize}
\begin{itemize}
...
@@ -493,11 +514,11 @@ array(3.0)
...
@@ -493,11 +514,11 @@ array(3.0)
>>> updates[x] = x + 1
>>> updates[x] = x + 1
>>> f = function([], updates=updates)
>>> f = function([], updates=updates)
>>> f()
>>> f()
>>> x.get
\
_
value()
>>> x.get
_
value()
1.0
1.0
>>> x.set
\
_
value(100.)
>>> x.set
_
value(100.)
>>> f()
>>> f()
>>> x.get
\
_
value()
>>> x.get
_
value()
101.0
101.0
\end{lstlisting}
\end{lstlisting}
\end{frame}
\end{frame}
...
@@ -539,6 +560,7 @@ instead of compiled C code. Runs slow.
...
@@ -539,6 +560,7 @@ instead of compiled C code. Runs slow.
\item
DEBUG
\_
MODE: Adds lots of checks.
\item
DEBUG
\_
MODE: Adds lots of checks.
Raises error messages in situations other
Raises error messages in situations other
modes regard as fine.
modes regard as fine.
\item
optimizer=fast
\_
compile: as mode=FAST
\_
COMPILE, but with C code.
\end{itemize}
\end{itemize}
\end{frame}
\end{frame}
...
@@ -558,10 +580,12 @@ modes regard as fine.
...
@@ -558,10 +580,12 @@ modes regard as fine.
\begin{frame}
{
Modifying expressions
}
\begin{frame}
{
Modifying expressions
}
\begin{itemize}
\begin{itemize}
\item
The grad method
\item
The grad method
\item
Variable nodes
\item
Others
\item
Types
\item
Ops
% \item Variable nodes
\item
Apply nodes
% \item Types
% \item Ops
% \item Apply nodes
\end{itemize}
\end{itemize}
\end{frame}
\end{frame}
...
@@ -576,56 +600,66 @@ modes regard as fine.
...
@@ -576,56 +600,66 @@ modes regard as fine.
>>> x = T.scalar('x')
>>> x = T.scalar('x')
>>> y = 2. * x
>>> y = 2. * x
>>> g = T.grad(y, x)
>>> g = T.grad(y, x)
>>> from theano.printing import min
_
informative
_
str
>>> theano.printing.debugprint(g)
>>> print min
_
informative
_
str(g)
Elemwise
{
mul
}
[@A] ''
A. Elemwise
{
mul
}
|Elemwise
{
second,no
_
inplace
}
[@B] ''
B. Elemwise
{
second,no
_
inplace
}
| |Elemwise
{
mul,no
_
inplace
}
[@C] ''
C. Elemwise
{
mul,no
_
inplace
}
| | |TensorConstant
{
2.0
}
[@D]
D. TensorConstant
{
2.0
}
| | |x [@E]
E. x
| |TensorConstant
{
1.0
}
[@F]
F. TensorConstant
{
1.0
}
|TensorConstant
{
2.0
}
[@D]
<D>
\end{lstlisting}
\end{lstlisting}
\end{frame}
\end{frame}
\begin{frame}
{
Theano Variables
}
%%
\begin{frame}{Theano Variables}
\begin{itemize}
%%
\begin{itemize}
\item
A Variable is a theano expression
%%
\item A Variable is a theano expression
\item
Can come from T.scalar, T.matrix, etc.
%%
\item Can come from T.scalar, T.matrix, etc.
\item
Can come from doing operations on other Variables
%%
\item Can come from doing operations on other Variables
\item
Every Variable has a type field, identifying its Type
\newline
%%
\item Every Variable has a type field, identifying its Type \newline
e.g. TensorType((True, False), ‘float32’)
%%
e.g. TensorType((True, False), ‘float32’)
\item
Variables can be thought of as nodes in a graph
%%
\item Variables can be thought of as nodes in a graph
\end{itemize}
%%
\end{itemize}
\end{frame}
%%
\end{frame}
\begin{frame}
{
Ops
}
%%
\begin{frame}{Ops}
\begin{itemize}
%%
\begin{itemize}
\item
An Op is any class that describes a
%%
\item An Op is any class that describes a
mathematical function of some variables
%%
mathematical function of some variables
\item
Can call the op on some variables to get a
%%
\item Can call the op on some variables to get a
new variable or variables
%%
new variable or variables
\item
An Op class can supply other forms of
%%
\item An Op class can supply other forms of
information about the function, such as its
%%
information about the function, such as its
derivatives
%%
derivatives
\end{itemize}
%%
\end{itemize}
\end{frame}
%%
\end{frame}
\begin{frame}
{
Apply nodes
}
%% \begin{frame}{Apply nodes}
\begin{itemize}
%% \begin{itemize}
\item
The Apply class is a specific instance of an application of an Op
%% \item The Apply class is a specific instance of an application of an Op
\item
Notable fields:
%% \item Notable fields:
%% \begin{itemize}
%% \item op: The Op to be applied
%% \item inputs: The Variables to be used as input
%% \item outputs: The Variables produced
%% \end{itemize}
%% \item Variable.owner identifies the Apply that created the variable
%% \item Variable and Apply instances are nodes and owner/
%% inputs/outputs identify edges in a Theano graph
%% \end{itemize}
%% \end{frame}
\begin{frame}
{
Others
}
\begin{itemize}
\begin{itemize}
\item
op: The Op to be applied
\item
R
\_
op, L
\_
op for hessian free
\item
inputs: The Variables to be used as input
\item
hessian
\item
outputs: The Variables produced
\item
jacobian
\end{itemize}
\item
you can navigate the graph if you need
\item
Variable.owner identifies the Apply that created the variable
(go from the result of computation to its input, recursively)
\item
Variable and Apply instances are nodes and owner/
inputs/outputs identify edges in a Theano graph
\end{itemize}
\end{itemize}
\end{frame}
\end{frame}
%TODO place somewhere a computation graph example.
\subsection
{
Debugging
}
\subsection
{
Debugging
}
\begin{frame}
{
Debugging
}
\begin{frame}
{
Debugging
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论