Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
a085da4c
提交
a085da4c
authored
1月 14, 2015
作者:
Frederic Bastien
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update Theano section
上级
6da87579
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
46 行增加
和
94 行删除
+46
-94
presentation.tex
doc/nextml2015/presentation.tex
+46
-94
没有找到文件。
doc/nextml2015/presentation.tex
浏览文件 @
a085da4c
...
@@ -21,6 +21,8 @@ Département d'Informatique et de Recherche Opérationnelle \newline
...
@@ -21,6 +21,8 @@ Département d'Informatique et de Recherche Opérationnelle \newline
Université de Montréal
\newline
Université de Montréal
\newline
Montréal, Canada
\newline
Montréal, Canada
\newline
\texttt
{
bastienf@iro.umontreal.ca
}
\newline
\newline
\texttt
{
bastienf@iro.umontreal.ca
}
\newline
\newline
Presentation prepared with Pierre-Luc Carrier, KyungHyun Cho and
\newline
Çağlar Gülçehre
}
}
\date
{
Next.ML 2015
}
\date
{
Next.ML 2015
}
...
@@ -40,8 +42,6 @@ Montréal, Canada \newline
...
@@ -40,8 +42,6 @@ Montréal, Canada \newline
\begin{frame}
\begin{frame}
\frametitle
{
Task
}
\frametitle
{
Task
}
LSTM Networks for Sentiment Analysis
This is a classification task where we need to tell if the review was
This is a classification task where we need to tell if the review was
positive or negative.
positive or negative.
...
@@ -61,7 +61,7 @@ We use the IMDB dataset.
...
@@ -61,7 +61,7 @@ We use the IMDB dataset.
\item
SciPy: sparse matrix objects and more scientific computing functionality
\item
SciPy: sparse matrix objects and more scientific computing functionality
\item
libgpuarray: GPU
$
n
$
-dimensional array object in C for CUDA and OpenCL
\item
libgpuarray: GPU
$
n
$
-dimensional array object in C for CUDA and OpenCL
\item
Theano: compiler/symbolic graph manipulation
\item
Theano: compiler/symbolic graph manipulation
\item
Pylearn2: machine learning framework
\item
Pylearn2: machine learning framework
for researchers
\end{itemize}
\end{itemize}
\end{frame}
\end{frame}
...
@@ -145,42 +145,8 @@ We use the IMDB dataset.
...
@@ -145,42 +145,8 @@ We use the IMDB dataset.
\end{frame}
\end{frame}
\begin{frame}
{
Description
}
\begin{frame}
{
Description
}
TODO, merge with next slides
\begin{itemize}
\item
Mathematical symbolic expression compiler
\item
Expressions mimic NumPy's syntax and semantics
\item
Dynamic C/CUDA code generation
\begin{itemize}
\item
C/C++, CUDA, OpenCL, PyCUDA, Cython, Numba,
\ldots
\end{itemize}
\item
Efficient symbolic differentiation
%\begin{itemize}
% \item Derivatives of functions with one or many inputs.
% \item Computation of the Jacobian, Hessian, R and L op.
%\end{itemize}
\item
Speed and stability optimizations
\begin{itemize}
\item
Gives the right answer for ``
$
\log
(
1
+
x
)
$
'' even if
$
x
$
is really tiny.
\end{itemize}
\item
Extensive unit-testing and self-verification
%\begin{itemize}
% \item Detects and diagnoses many types of errors
%\end{itemize}
\item
Works on Linux, OS X and Windows
\item
Transparent use of a GPU
\begin{itemize}
\item
{
\tt
float32
}
only for now (libgpuarray provides much more)
\item
Limited support on Windows
\end{itemize}
% \item Statically typed and purely functional
\item
Sparse operations (CPU only)
\end{itemize}
\end{frame}
\begin{frame}
{
Theano
}
High-level domain-specific language
tailored to
numeric computation.
High-level domain-specific language
for
numeric computation.
\begin{itemize}
\begin{itemize}
\item
Syntax as close to NumPy as possible
\item
Syntax as close to NumPy as possible
...
@@ -195,10 +161,12 @@ TODO, merge with next slides
...
@@ -195,10 +161,12 @@ TODO, merge with next slides
\item
Automatic speed and stability optimizations
\item
Automatic speed and stability optimizations
\item
Can reuse other technologies for best performance.
\item
Can reuse other technologies for best performance.
\begin{itemize}
\begin{itemize}
\item
BLAS, SciPy, Cython, Numba, PyCUDA, CUDA
\item
BLAS, SciPy, Cython, Numba, PyCUDA, CUDA
, ...
\end{itemize}
\end{itemize}
\item
Automatic differentiation and R op
\item
Automatic differentiation and R op
\item
Sparse matrices
\item
Sparse matrices (CPU only)
\item
Extensive unit-testing and self-verification
\item
Works on Linux, OS X and Windows
\end{itemize}
\end{itemize}
\end{frame}
\end{frame}
...
@@ -240,14 +208,14 @@ TODO, merge with next slides
...
@@ -240,14 +208,14 @@ TODO, merge with next slides
\end{frame}
\end{frame}
\begin{frame}
{
Overview of Library
}
%%
\begin{frame}{Overview of Library}
Theano is many things
%%
Theano is many things
\begin{itemize}
%%
\begin{itemize}
\item
Language
%%
\item Language
\item
Compiler
%%
\item Compiler
\item
Python library
%%
\item Python library
\end{itemize}
%%
\end{itemize}
\end{frame}
%%
\end{frame}
\begin{frame}
{
Overview Language
}
\begin{frame}
{
Overview Language
}
\begin{itemize}
\begin{itemize}
...
@@ -255,6 +223,9 @@ TODO, merge with next slides
...
@@ -255,6 +223,9 @@ TODO, merge with next slides
\item
Linear algebra
\item
Linear algebra
\item
Element-wise nonlinearities
\item
Element-wise nonlinearities
\item
Convolution
\item
Convolution
\item
Indexing, slicing and advanced indexing.
\item
Reduction
\item
Dimshuffle (n-dim transpose)
\item
Extensible
\item
Extensible
\end{itemize}
\end{itemize}
\end{frame}
\end{frame}
...
@@ -288,24 +259,11 @@ int f(int x, int y){
...
@@ -288,24 +259,11 @@ int f(int x, int y){
\end{itemize}
\end{itemize}
\end{frame}
\end{frame}
\subsection
{
Building
}
\begin{frame}
{
Building expressions
}
\begin{itemize}
\item
Scalars
\item
Vectors
\item
Matrices
\item
Tensors
\item
Reduction
\item
Dimshuffle
\end{itemize}
\end{frame}
\begin{frame}
[fragile]
\begin{frame}
[fragile]
\frametitle
{
Scalar math
}
\frametitle
{
Scalar math
}
Using Theano:
Using Theano:
\begin{itemize}
\begin{itemize}
\item
define expression
$
f
(
x,y
)
=
x
+
y
$
\item
define
SYMBOLIC
expression
$
f
(
x,y
)
=
x
+
y
$
\item
compile expression
\item
compile expression
\end{itemize}
\end{itemize}
\lstset
{
language=Python,
\lstset
{
language=Python,
...
@@ -340,7 +298,7 @@ y = T.vector()
...
@@ -340,7 +298,7 @@ y = T.vector()
a = x * y
a = x * y
# Vector dot product
# Vector dot product
b = T.dot(x, y)
b = T.dot(x, y)
# Broadcasting
# Broadcasting
(as NumPy, very powerful)
c = a + b
c = a + b
\end{lstlisting}
\end{lstlisting}
\end{frame}
\end{frame}
...
@@ -368,15 +326,10 @@ c = T.dot(x, a)
...
@@ -368,15 +326,10 @@ c = T.dot(x, a)
\frametitle
{
Tensors
}
\frametitle
{
Tensors
}
Using Theano:
Using Theano:
\begin{itemize}
\begin{itemize}
\item
define expression
$
f
(
x,y
)
=
x
+
y
$
\item
Dimensionality defined by length of ``broadcastable'' argument
\item
compile expression
\item
Can add (or do other elemwise op) on two
\begin{itemize}
tensors with same dimensionality
\item
Dimensionality defined by length of ``broadcastable'' argument
\item
Duplicate tensors along broadcastable axes to make size match
\item
Can add (or do other elemwise op) on two
tensors with same dimensionality
\item
Duplicate tensors along broadcastable axes to
make size match
\end{itemize}
\end{itemize}
\end{itemize}
\lstset
{
language=Python,
\lstset
{
language=Python,
commentstyle=
\itshape\color
{
blue
}
,
commentstyle=
\itshape\color
{
blue
}
,
...
@@ -393,11 +346,6 @@ x = T.tensor3()
...
@@ -393,11 +346,6 @@ x = T.tensor3()
\begin{frame}
[fragile]
\begin{frame}
[fragile]
\frametitle
{
Reductions
}
\frametitle
{
Reductions
}
Using Theano:
\begin{itemize}
\item
define expression
$
f
(
x,y
)
=
x
+
y
$
\item
compile expression
\end{itemize}
\lstset
{
language=Python,
\lstset
{
language=Python,
commentstyle=
\itshape\color
{
blue
}
,
commentstyle=
\itshape\color
{
blue
}
,
stringstyle=
\color
{
violet
}
,
stringstyle=
\color
{
violet
}
,
...
@@ -423,7 +371,8 @@ mx = x.max(axis=1)
...
@@ -423,7 +371,8 @@ mx = x.max(axis=1)
}
}
\begin{lstlisting}
\begin{lstlisting}
from theano import tensor as T
from theano import tensor as T
tensor3 = T.TensorType(broadcastable=(False, False, False), dtype=''float32'')
tensor3 = T.TensorType(
broadcastable=(False, False, False))
x = tensor3()
x = tensor3()
y = x.dimshuffle((2, 1, 0))
y = x.dimshuffle((2, 1, 0))
a = T.matrix()
a = T.matrix()
...
@@ -436,24 +385,27 @@ e = a + d
...
@@ -436,24 +385,27 @@ e = a + d
\end{lstlisting}
\end{lstlisting}
\end{frame}
\end{frame}
\begin{frame}
\begin{frame}
[fragile]
\frametitle
{
Indexing
}
\frametitle
{
Indexing
}
As NumPy!
As NumPy!
This mean all slices, index selection return view
\begin{itemize}
\lstset
{
language=Python,
\item
This mean all slices, index selection return view:
commentstyle=
\itshape\color
{
blue
}
,
\begin{itemize}
stringstyle=
\color
{
violet
}
,
\item
a
\_
tensor[startstopstep, N]
\#
return a view
}
\item
a
\_
tensor[-1]
\#
reverse the vector, return a view
\begin{lstlisting}
\end{itemize}
# return views
\item
Advanced indexing as NumPy:
a
_
tensor[int]
\begin{itemize}
a
_
tensor[int, int]
\item
This mean it can use vector/tensor of indices to use.
a
_
tensor[start:stop:step, start:stop:step]
\item
this create a copy
a
_
tensor[::-1] # reverse the first dimension
\item
This can be mixed with slicing/index selection.
\item
GPU Support only this case: a
\_
tensor[an
\_
index
\_
vector]
# Advanced indexing, return copy
\end{itemize}
a
_
tensor[an
_
index
_
vector] # Supported on GPU.
\end{itemize}
a
_
tensor[an
_
index
_
vector, an
_
index
_
vector]
a
_
tensor[int, an
_
index
_
vector]
a
_
tensor[an
_
index
_
tensor, ...]
\end{lstlisting}
\end{frame}
\end{frame}
\subsection
{
Compiling/Running
}
\subsection
{
Compiling/Running
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论