Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
T
Toy-MT-Introduction
概览
Overview
Details
Activity
Cycle Analytics
版本库
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
问题
0
Issues
0
列表
Board
标记
里程碑
合并请求
0
Merge Requests
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
Snippets
成员
Collapse sidebar
Close sidebar
活动
图像
聊天
创建新问题
作业
提交
Issue Boards
Open sidebar
单韦乔
Toy-MT-Introduction
Commits
bcb189ce
Commit
bcb189ce
authored
Sep 02, 2019
by
xiaotong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update to the core file
parent
01bd6b80
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
116 行增加
和
7 行删除
+116
-7
Section05-Neural-Networks-and-Language-Modeling/section05-test.tex
+25
-3
Section05-Neural-Networks-and-Language-Modeling/section05.tex
+91
-4
没有找到文件。
Section05-Neural-Networks-and-Language-Modeling/section05-test.tex
查看文件 @
bcb189ce
...
...
@@ -123,45 +123,67 @@
\tikzstyle
{
neuronnode
}
= [minimum size=1.5em,circle,draw,ublue,very thick,fill=white,drop shadow=
{
shadow xshift=0.1em,shadow yshift=-0.1em
}
]
\node
[anchor=center,neuronnode] (neuron00) at (0,0)
{}
;
\visible
<2->
{
\node
[anchor=center,neuronnode] (neuron01) at ([yshift=-3em]neuron00)
{}
;
}
\visible
<3->
{
\node
[anchor=center,neuronnode] (neuron02) at ([yshift=-3em]neuron01)
{}
;
}
\node
[anchor=east] (x0) at ([xshift=-6em]neuron00.west)
{$
x
_
0
$}
;
\node
[anchor=east] (x1) at ([xshift=-6em]neuron01.west)
{$
x
_
1
$}
;
\node
[anchor=east] (x2) at ([xshift=-6em]neuron02.west)
{$
b
$}
;
\node
[anchor=west] (y0) at ([xshift=4em]neuron00.east)
{$
y
_
0
$}
;
\node
[anchor=west] (y1) at ([xshift=4em]neuron01.east)
{$
y
_
1
$}
;
\node
[anchor=west] (y2) at ([xshift=4em]neuron02.east)
{$
y
_
2
$}
;
\draw
[->] (x0.east) -- (neuron00.180) node [pos=0.
3
,above]
{
\tiny
{$
w
_{
00
}$}}
;
\draw
[->] (x0.east) -- (neuron00.180) node [pos=0.
1
,above]
{
\tiny
{$
w
_{
00
}$}}
;
\draw
[->] (x1.east) -- (neuron00.200) node [pos=0.1,above]
{
\tiny
{$
w
_{
10
}$}}
;
\draw
[->] (x2.east) -- (neuron00.220) node [pos=0.05,above,yshift=0.3em]
{
\tiny
{$
b
_{
0
}$}}
;
\draw
[->] (neuron00.east) -- (y0.west);
\visible
<2->
{
\node
[anchor=west] (y1) at ([xshift=4em]neuron01.east)
{$
y
_
1
$}
;
\draw
[->] (x0.east) -- (neuron01.160) node [pos=0.4,above]
{
\tiny
{$
w
_{
01
}$}}
;
\draw
[->] (x1.east) -- (neuron01.180) node [pos=0.35,above,yshift=-0.2em]
{
\tiny
{$
w
_{
11
}$}}
;
\draw
[->] (x2.east) -- (neuron01.200) node [pos=0.4,below]
{
\tiny
{$
b
_{
1
}$}}
;
\draw
[->] (neuron01.east) -- (y1.west);
}
\visible
<3->
{
\node
[anchor=west] (y2) at ([xshift=4em]neuron02.east)
{$
y
_
2
$}
;
\draw
[->] (x0.east) -- (neuron02.140) node [pos=0.1,below,yshift=-0.2em]
{
\tiny
{$
w
_{
02
}$}}
;
\draw
[->] (x1.east) -- (neuron02.160) node [pos=0.1,below]
{
\tiny
{$
w
_{
12
}$}}
;
\draw
[->] (x2.east) -- (neuron02.180) node [pos=0.3,below]
{
\tiny
{$
b
_{
2
}$}}
;
\draw
[->] (neuron02.east) -- (y2.west);
}
\visible
<4->
{
\node
[anchor=east,align=left] (inputlabel) at ([xshift=-0.1em]x1.west)
{
输入向量:
\\\small
{$
\textbf
{
x
}
=(
x
_
0
,x
_
1
)
$}}
;
}
\visible
<5->
{
\node
[anchor=west,align=left] (outputlabel) at ([xshift=0.1em]y1.east)
{
输出向量:
\\\small
{$
\textbf
{
y
}
=(
y
_
0
,y
_
1
,y
_
2
)
$}}
;
}
\begin{pgfonlayer}
{
background
}
\visible
<6->
{
\node
[rectangle,inner sep=0.4em,fill=red!20] [fit = (neuron00) (neuron01) (neuron02)] (layer)
{}
;
\node
[anchor=south] (layerlabel) at ([yshift=0.2em]layer.north)
{
一层神经元
}
;
}
\visible
<4->
{
\node
[rectangle,inner sep=0.1em,fill=ugreen!20] [fit = (x0) (x1)] (inputshadow)
{}
;
}
\visible
<5->
{
\node
[rectangle,inner sep=0.1em,fill=blue!20] [fit = (y0) (y1) (y2)] (outputshadow)
{}
;
}
\end{pgfonlayer}
\visible
<7->
{
\node
[anchor=north west] (wlabel) at ([yshift=-1em,xshift=-7em]x2.south)
{
参数(矩阵):
$
\textbf
{
w
}
=
\Big
(
\begin
{
array
}{
lll
}
w
_{
01
}
&
w
_{
01
}
&
w
_{
02
}
\\
w
_{
11
}
&
w
_{
11
}
&
w
_{
12
}
\end
{
array
}
\Big
)
$}
;
}
\visible
<8->
{
\node
[anchor=west] (blabel) at (wlabel.east)
{
参数(向量):
$
\textbf
{
b
}
=
(
b
_
0
, b
_
1
, b
_
2
)
$}
;
}
\end{scope}
\end{tikzpicture}
...
...
Section05-Neural-Networks-and-Language-Modeling/section05.tex
查看文件 @
bcb189ce
...
...
@@ -272,17 +272,17 @@ GPT-2 (Transformer) & Radford et al. & 2019 & \alert{35.7}
%%% 神经元
\begin{frame}
{
神经网络的基本单元 - 神经元
}
\begin{itemize}
\item
生物学上,神经元是神经系统的基本组成单元
,因此大家
想象的神经网络应该是这样的
\\
\item
生物学上,神经元是神经系统的基本组成单元
。很多人
想象的神经网络应该是这样的
\\
\begin{center}
\includegraphics
[scale=0.25]
{
./Figures/neuron-real.jpg
}
\\
\end{center}
\item
<2-> 但我们这里说的是
\textbf
{
人工神经元
}
,实际上是这样的 :)
\begin{itemize}
\item
输入
$
x
$
经过
$
w
$
进行线性变化,之后加上偏移
$
b
$
,在经过激活函数
$
f
$
,最后得到
$
y
$
- 啥东东???
\item
输入
$
\textbf
{
x
}$
经过
$
\textbf
{
w
}$
进行线性变化,之后加上偏移
$
\textbf
{
b
}$
,在经过激活函数
$
f
$
,最后得到
$
\textbf
{
y
}
$
- 啥东东???
\end{itemize}
{
\Large
\begin{displaymath}
y = f(w
\cdot
x + b
)
\textbf
{
y
}
= f(
\textbf
{
w
}
\cdot
\textbf
{
x
}
+
\textbf
{
b
}
)
\end{displaymath}
}
\\
...
...
@@ -690,7 +690,7 @@ y = f(w \cdot x + b)
\node
[anchor=north west,draw,ublue,very thick,rounded corners=4pt,text width=18em,align=left,fill=white,drop shadow=
{
shadow xshift=0.2em,shadow yshift=-0.2em
}
] (p21) at ([yshift=-1em]p1.south west)
{
\black
{
\textbf
{
2. 如何将简单的网络单元组合成更
}}
\\\black
{
\textbf
{
\hspace
{
0.9em
}
强大的模型?
}}}
;
\node
[anchor=north west,draw,ublue,very thick,rounded corners=4pt,text width=18em,align=left,fill=white,drop shadow=
{
shadow xshift=0.2em,shadow yshift=-0.2em
}
] (p22) at ([yshift=-1em]p21.south west)
{
\black
{
\textbf
{
3. 如何对模型中的参数进行学习,
}}
\\\black
{
\textbf
{
\hspace
{
0.9em
}
如何
使用学习到的模型进行推断?
}}}
;
\node
[anchor=north west,draw,ublue,very thick,rounded corners=4pt,text width=18em,align=left,fill=white,drop shadow=
{
shadow xshift=0.2em,shadow yshift=-0.2em
}
] (p22) at ([yshift=-1em]p21.south west)
{
\black
{
\textbf
{
3. 如何对模型中的参数进行学习,
}}
\\\black
{
\textbf
{
\hspace
{
0.9em
}
之后
使用学习到的模型进行推断?
}}}
;
}
\end{tikzpicture}
...
...
@@ -772,6 +772,93 @@ y = f(w \cdot x + b)
\end{frame}
%%%------------------------------------------------------------------------------------------------------------
%%% 层的概念
\begin{frame}
{
``层"的概念
}
\begin{itemize}
\item
对于一个问题(相同输入),可能会有多个输出,这时可以把
\alert
{
多个相同的神经元并列起来
}
,构成一
\alert
{
``层"
}
\begin{itemize}
\item
比如,天气预报需要同时预测湿度和温度
\end{itemize}
\end{itemize}
\vspace
{
-2em
}
\begin{center}
\begin{tikzpicture}
\begin{scope}
\tikzstyle
{
neuronnode
}
= [minimum size=1.5em,circle,draw,ublue,very thick,fill=white,drop shadow=
{
shadow xshift=0.1em,shadow yshift=-0.1em
}
]
\node
[anchor=center,neuronnode] (neuron00) at (0,0)
{}
;
\visible
<2->
{
\node
[anchor=center,neuronnode] (neuron01) at ([yshift=-3em]neuron00)
{}
;
}
\visible
<3->
{
\node
[anchor=center,neuronnode] (neuron02) at ([yshift=-3em]neuron01)
{}
;
}
\node
[anchor=east] (x0) at ([xshift=-6em]neuron00.west)
{$
x
_
0
$}
;
\node
[anchor=east] (x1) at ([xshift=-6em]neuron01.west)
{$
x
_
1
$}
;
\node
[anchor=east] (x2) at ([xshift=-6em]neuron02.west)
{$
b
$}
;
\node
[anchor=west] (y0) at ([xshift=4em]neuron00.east)
{$
y
_
0
$}
;
\draw
[->] (x0.east) -- (neuron00.180) node [pos=0.1,above]
{
\tiny
{$
w
_{
00
}$}}
;
\draw
[->] (x1.east) -- (neuron00.200) node [pos=0.1,above]
{
\tiny
{$
w
_{
10
}$}}
;
\draw
[->] (x2.east) -- (neuron00.220) node [pos=0.05,above,yshift=0.3em]
{
\tiny
{$
b
_{
0
}$}}
;
\draw
[->] (neuron00.east) -- (y0.west);
\visible
<2->
{
\node
[anchor=west] (y1) at ([xshift=4em]neuron01.east)
{$
y
_
1
$}
;
\draw
[->] (x0.east) -- (neuron01.160) node [pos=0.4,above]
{
\tiny
{$
w
_{
01
}$}}
;
\draw
[->] (x1.east) -- (neuron01.180) node [pos=0.35,above,yshift=-0.2em]
{
\tiny
{$
w
_{
11
}$}}
;
\draw
[->] (x2.east) -- (neuron01.200) node [pos=0.3,below,yshift=0.2em]
{
\tiny
{$
b
_{
1
}$}}
;
\draw
[->] (neuron01.east) -- (y1.west);
}
\visible
<3->
{
\node
[anchor=west] (y2) at ([xshift=4em]neuron02.east)
{$
y
_
2
$}
;
\draw
[->] (x0.east) -- (neuron02.140) node [pos=0.1,below,yshift=-0.2em]
{
\tiny
{$
w
_{
02
}$}}
;
\draw
[->] (x1.east) -- (neuron02.160) node [pos=0.1,below]
{
\tiny
{$
w
_{
12
}$}}
;
\draw
[->] (x2.east) -- (neuron02.180) node [pos=0.3,below]
{
\tiny
{$
b
_{
2
}$}}
;
\draw
[->] (neuron02.east) -- (y2.west);
}
\visible
<4->
{
\node
[anchor=east,align=left] (inputlabel) at ([xshift=-0.1em]x1.west)
{
输入向量:
\\\small
{$
\textbf
{
x
}
=(
x
_
0
,x
_
1
)
$}}
;
}
\visible
<5->
{
\node
[anchor=west,align=left] (outputlabel) at ([xshift=0.1em]y1.east)
{
输出向量:
\\\small
{$
\textbf
{
y
}
=(
y
_
0
,y
_
1
,y
_
2
)
$}}
;
}
\begin{pgfonlayer}
{
background
}
\visible
<6->
{
\node
[rectangle,inner sep=0.4em,fill=red!20] [fit = (neuron00) (neuron01) (neuron02)] (layer)
{}
;
\node
[anchor=south] (layerlabel) at ([yshift=0.2em]layer.north)
{
一层神经元
}
;
}
\visible
<4->
{
\node
[rectangle,inner sep=0.1em,fill=ugreen!20] [fit = (x0) (x1)] (inputshadow)
{}
;
}
\visible
<5->
{
\node
[rectangle,inner sep=0.1em,fill=blue!20] [fit = (y0) (y1) (y2)] (outputshadow)
{}
;
}
\end{pgfonlayer}
\visible
<7->
{
\node
[anchor=north west] (wlabel) at ([yshift=-1em,xshift=-7em]x2.south)
{
参数(矩阵):
$
\textbf
{
w
}
=
\Big
(
\begin
{
array
}{
lll
}
w
_{
00
}
&
w
_{
01
}
&
w
_{
02
}
\\
w
_{
10
}
&
w
_{
11
}
&
w
_{
12
}
\end
{
array
}
\Big
)
$}
;
}
\visible
<8->
{
\node
[anchor=west] (blabel) at (wlabel.east)
{
参数(向量):
$
\textbf
{
b
}
=
(
b
_
0
, b
_
1
, b
_
2
)
$}
;
}
\end{scope}
\end{tikzpicture}
\end{center}
\end{frame}
%%%------------------------------------------------------------------------------------------------------------
\subsection
{
多层神经网络
}
%%%------------------------------------------------------------------------------------------------------------
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论