This repository has been archived by the owner on Jan 6, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathp5.html
191 lines (153 loc) · 26.3 KB
/
p5.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
<!DOCTYPE html>
<html>
<link rel="shortcut icon" href="favicon.ico">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" href="highlight.css">
<meta name="author" content="sunprinceS" >
<meta property="og:image" content="joy.png"/>
<title>Machine Learning (2017, Spring)</title>
<xmp theme="cerulean" style="display:none;">
# Problem 5: Analyze the Model by Visualizing Filters
Problem Description:
* use **Gradient Ascent** method mentioned in class to find the image that activates the selected filter the most and plot them (start from white noise).
* Feed an image in your validation set to the model, and plot the output of that filter
* Describe what you observed, and explain it
Hint:
* you can use other model with poor performance to see what is the difference
* you can also try to find which image will activate the specific class the most
* you can start from natural image (not white noise), and try to create the <a href="https://arxiv.org/pdf/1412.6572.pdf" target="_blank">**adversial image**</a>
## Lecture
<img src="lec.png" alt="Drawing" style="width: 1000px;"/>
## 範例
* **[Note] 請不要直接使用助教的圖來當成作業交上來**
* **[Note] 請不要使用這張範例圖**
<img src="17.png" alt="Drawing" style="width: 200px;"/>
* **[Note] colormap 請不要使用 Purples**
<img src="http://i.imgur.com/HdQ9oQU.png" alt="Drawing" style="width: 1300px;"/>
<img src="http://i.imgur.com/xEvPeW8.png" alt="Drawing" style="width: 1300px;"/>
## TA hour
<i class="fa fa-diamond"></i> Keywords: `keras.backend`, `gradients`
#### 畫圖
以下的程式碼為matplotlib.pyplot的簡單示範,你也可以使用不同的呈現方式及函式庫
<div class="highlight"><pre><span></span><span class="kn">import</span> <span class="nn">matplotlib.pyplot</span> <span class="kn">as</span> <span class="nn">plt</span>
<span class="k">def</span> <span class="nf">main</span><span class="p">():</span>
<span class="n">fig</span> <span class="o">=</span> <span class="n">plt</span><span class="o">.</span><span class="n">figure</span><span class="p">(</span><span class="n">figsize</span><span class="o">=</span><span class="p">(</span><span class="mi">14</span><span class="p">,</span><span class="mi">8</span><span class="p">))</span> <span class="c1"># 大小可自行決定</span>
<span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="n">nb\_filter</span><span class="p">):</span> <span class="c1"># 畫出每一個filter</span>
<span class="n">ax</span> <span class="o">=</span> <span class="n">fig</span><span class="o">.</span><span class="n">add\_subplot</span><span class="p">(</span><span class="n">nb\_filter</span><span class="o">/</span><span class="mi">16</span><span class="p">,</span><span class="mi">16</span><span class="p">,</span><span class="n">i</span><span class="o">+</span><span class="mi">1</span><span class="p">)</span> <span class="c1"># 每16個小圖一行</span>
<span class="n">ax</span><span class="o">.</span><span class="n">imshow</span><span class="p">(</span><span class="n">image</span><span class="p">,</span><span class="n">cmap</span><span class="o">=</span><span class="s1">'BuGn'</span><span class="p">)</span> <span class="c1"># image為某個filter的output或最能activate某個filter的input image</span>
<span class="n">plt</span><span class="o">.</span><span class="n">xticks</span><span class="p">(</span><span class="n">np</span><span class="o">.</span><span class="n">array</span><span class="p">([]))</span>
<span class="n">plt</span><span class="o">.</span><span class="n">yticks</span><span class="p">(</span><span class="n">np</span><span class="o">.</span><span class="n">array</span><span class="p">([]))</span>
<span class="n">plt</span><span class="o">.</span><span class="n">xlabel</span><span class="p">(</span><span class="s1">'whatever subfigure title you want'</span><span class="p">)</span> <span class="c1"># 如果你想在子圖下加小標的話</span>
<span class="n">plt</span><span class="o">.</span><span class="n">tight\_layout</span><span class="p">()</span>
<span class="n">fig</span><span class="o">.</span><span class="n">suptitle</span><span class="p">(</span><span class="s1">'Whatever title you want'</span><span class="p">)</span>
<span class="n">fig</span><span class="o">.</span><span class="n">savefig</span><span class="p">(</span><span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">img\_path</span><span class="p">,</span><span class="s1">'Whatever filename you want'</span><span class="p">))</span> <span class="c1">#將圖片儲存至disk</span>
</pre></div>
以下會以 **Keras** 為使用的套件來做介紹 (並以tensorflow作為backend)
#### 利用梯度遞增法,找出最能激活特定filter的圖片(從白噪音開始)
<div class="highlight"><pre><span></span><span class="ch">#!/usr/bin/env python</span>
<span class="c1"># -*- coding: utf-8 -*-</span>
<span class="kn">import</span> <span class="nn">os</span>
<span class="kn">import</span> <span class="nn">matplotlib.pyplot</span> <span class="kn">as</span> <span class="nn">plt</span>
<span class="kn">from</span> <span class="nn">keras.models</span> <span class="kn">import</span> <span class="n">load\_model</span>
<span class="kn">from</span> <span class="nn">keras</span> <span class="kn">import</span> <span class="n">backend</span> <span class="k">as</span> <span class="n">K</span>
<span class="kn">from</span> <span class="nn">utils</span> <span class="kn">import</span> <span class="o">\*</span>
<span class="kn">from</span> <span class="nn">marcos</span> <span class="kn">import</span> <span class="o">\*</span>
<span class="kn">import</span> <span class="nn">numpy</span> <span class="kn">as</span> <span class="nn">np</span>
<span class="k">def</span> <span class="nf">normalize</span><span class="p">(</span><span class="n">x</span><span class="p">):</span>
<span class="c1"># utility function to normalize a tensor by its L2 norm</span>
<span class="k">return</span> <span class="n">x</span> <span class="o">/</span> <span class="p">(</span><span class="n">K</span><span class="o">.</span><span class="n">sqrt</span><span class="p">(</span><span class="n">K</span><span class="o">.</span><span class="n">mean</span><span class="p">(</span><span class="n">K</span><span class="o">.</span><span class="n">square</span><span class="p">(</span><span class="n">x</span><span class="p">)))</span> <span class="o">+</span> <span class="mf">1e-7</span><span class="p">)</span>
<span class="k">def</span> <span class="nf">grad\_ascent</span><span class="p">(</span><span class="n">num\_step</span><span class="p">,</span><span class="n">input\_image\_data</span><span class="p">,</span><span class="n">iter\_func</span><span class="p">):</span>
<span class="sd">"""</span>
<span class="sd"> Implement this function!</span>
<span class="sd"> """</span>
<span class="k">return</span> <span class="n">filter\_images</span>
<span class="k">def</span> <span class="nf">main</span><span class="p">():</span>
<span class="n">emotion\_classifier</span> <span class="o">=</span> <span class="n">load\_model</span><span class="p">(</span><span class="n">model\_path</span><span class="p">)</span>
<span class="n">layer\_dict</span> <span class="o">=</span> <span class="nb">dict</span><span class="p">([</span><span class="n">layer</span><span class="o">.</span><span class="n">name</span><span class="p">,</span> <span class="n">layer</span><span class="p">]</span> <span class="k">for</span> <span class="n">layer</span> <span class="ow">in</span> <span class="n">emotion\_classifier</span><span class="o">.</span><span class="n">layers</span><span class="p">[</span><span class="mi">1</span><span class="p">:])</span>
<span class="n">input\_img</span> <span class="o">=</span> <span class="n">emotion\_classifier</span><span class="o">.</span><span class="n">input</span>
<span class="n">name\_ls</span> <span class="o">=</span> <span class="p">[</span><span class="s2">"names of the layers you want to get their outputs"</span><span class="p">]</span>
<span class="n">collect\_layers</span> <span class="o">=</span> <span class="p">[</span> <span class="n">layer\_dict</span><span class="p">[</span><span class="n">name</span><span class="p">]</span><span class="o">.</span><span class="n">output</span> <span class="k">for</span> <span class="n">name</span> <span class="ow">in</span> <span class="n">name\_ls</span> <span class="p">]</span>
<span class="k">for</span> <span class="n">cnt</span><span class="p">,</span> <span class="n">c</span> <span class="ow">in</span> <span class="nb">enumerate</span><span class="p">(</span><span class="n">collect\_layers</span><span class="p">):</span>
<span class="n">filter\_imgs</span> <span class="o">=</span> <span class="p">[[]</span> <span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="n">NUM\_STEPS</span><span class="o">//</span><span class="n">RECORD\_FREQ</span><span class="p">)]</span>
<span class="k">for</span> <span class="n">filter\_idx</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="n">nb\_filter</span><span class="p">):</span>
<span class="n">input\_img\_data</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">random</span><span class="o">.</span><span class="n">random</span><span class="p">((</span><span class="mi">1</span><span class="p">,</span> <span class="mi">48</span><span class="p">,</span> <span class="mi">48</span><span class="p">,</span> <span class="mi">1</span><span class="p">))</span> <span class="c1"># random noise</span>
<span class="n">target</span> <span class="o">=</span> <span class="n">K</span><span class="o">.</span><span class="n">mean</span><span class="p">(</span><span class="n">c</span><span class="p">[:,</span> <span class="p">:,</span> <span class="p">:,</span> <span class="n">filter\_idx</span><span class="p">])</span>
<span class="n">grads</span> <span class="o">=</span> <span class="n">normalize</span><span class="p">(</span><span class="n">K</span><span class="o">.</span><span class="n">gradients</span><span class="p">(</span><span class="n">target</span><span class="p">,</span> <span class="n">input\_img</span><span class="p">)[</span><span class="mi">0</span><span class="p">])</span>
<span class="n">iterate</span> <span class="o">=</span> <span class="n">K</span><span class="o">.</span><span class="n">function</span><span class="p">([</span><span class="n">input\_img</span><span class="p">],</span> <span class="p">[</span><span class="n">target</span><span class="p">,</span> <span class="n">grads</span><span class="p">])</span>
<span class="c1">###</span>
<span class="s2">"You need to implement it."</span>
<span class="n">filter\_imgs</span> <span class="o">=</span> <span class="n">grad\_ascent</span><span class="p">(</span><span class="n">num\_step</span><span class="p">,</span> <span class="n">input\_img\_data</span><span class="p">,</span> <span class="n">iterate</span><span class="p">)</span>
<span class="c1">###</span>
<span class="k">for</span> <span class="n">it</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="n">NUM\_STEPS</span><span class="o">//</span><span class="n">RECORD\_FREQ</span><span class="p">):</span>
<span class="n">fig</span> <span class="o">=</span> <span class="n">plt</span><span class="o">.</span><span class="n">figure</span><span class="p">(</span><span class="n">figsize</span><span class="o">=</span><span class="p">(</span><span class="mi">14</span><span class="p">,</span> <span class="mi">8</span><span class="p">))</span>
<span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="n">nb\_filter</span><span class="p">):</span>
<span class="n">ax</span> <span class="o">=</span> <span class="n">fig</span><span class="o">.</span><span class="n">add\_subplot</span><span class="p">(</span><span class="n">nb\_filter</span><span class="o">/</span><span class="mi">16</span><span class="p">,</span> <span class="mi">16</span><span class="p">,</span> <span class="n">i</span><span class="o">+</span><span class="mi">1</span><span class="p">)</span>
<span class="n">ax</span><span class="o">.</span><span class="n">imshow</span><span class="p">(</span><span class="n">filter\_imgs</span><span class="p">[</span><span class="n">it</span><span class="p">][</span><span class="n">i</span><span class="p">][</span><span class="mi">0</span><span class="p">],</span> <span class="n">cmap</span><span class="o">=</span><span class="s1">'BuGn'</span><span class="p">)</span>
<span class="n">plt</span><span class="o">.</span><span class="n">xticks</span><span class="p">(</span><span class="n">np</span><span class="o">.</span><span class="n">array</span><span class="p">([]))</span>
<span class="n">plt</span><span class="o">.</span><span class="n">yticks</span><span class="p">(</span><span class="n">np</span><span class="o">.</span><span class="n">array</span><span class="p">([]))</span>
<span class="n">plt</span><span class="o">.</span><span class="n">xlabel</span><span class="p">(</span><span class="s1">'{:.3f}'</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">filter\_imgs</span><span class="p">[</span><span class="n">it</span><span class="p">][</span><span class="n">i</span><span class="p">][</span><span class="mi">1</span><span class="p">]))</span>
<span class="n">plt</span><span class="o">.</span><span class="n">tight\_layout</span><span class="p">()</span>
<span class="n">fig</span><span class="o">.</span><span class="n">suptitle</span><span class="p">(</span><span class="s1">'Filters of layer {} (# Ascent Epoch {} )'</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">name\_ls</span><span class="p">[</span><span class="n">cnt</span><span class="p">],</span> <span class="n">it</span><span class="o">\*</span><span class="n">RECORD\_FREQ</span><span class="p">))</span>
<span class="n">img\_path</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">filter\_dir</span><span class="p">,</span> <span class="s1">'{}-{}'</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">store\_path</span><span class="p">,</span> <span class="n">name\_ls</span><span class="p">[</span><span class="n">cnt</span><span class="p">]))</span>
<span class="k">if</span> <span class="ow">not</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">isdir</span><span class="p">(</span><span class="n">img\_path</span><span class="p">):</span>
<span class="n">os</span><span class="o">.</span><span class="n">mkdir</span><span class="p">(</span><span class="n">img\_path</span><span class="p">)</span>
<span class="n">fig</span><span class="o">.</span><span class="n">savefig</span><span class="p">(</span><span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">img\_path</span><span class="p">,</span><span class="s1">'e{}'</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">it</span><span class="o">*</span><span class="n">RECORD\_FREQ</span><span class="p">)))</span>
<span class="k">if</span> <span class="vm">\_\_name\_\_</span> <span class="o">==</span> <span class="s2">"\_\_main\_\_"</span><span class="p">:</span>
<span class="n">main</span><span class="p">()</span>
</pre></div>
#### 給定輸入圖片,取出特定層的輸出
<div class="highlight"><pre><span></span><span class="ch">#!/usr/bin/env python</span>
<span class="c1"># -*- coding: utf-8 -*-</span>
<span class="kn">import</span> <span class="nn">os</span>
<span class="kn">import</span> <span class="nn">matplotlib.pyplot</span> <span class="kn">as</span> <span class="nn">plt</span>
<span class="kn">from</span> <span class="nn">keras.models</span> <span class="kn">import</span> <span class="n">load\_model</span>
<span class="kn">from</span> <span class="nn">keras</span> <span class="kn">import</span> <span class="n">backend</span> <span class="k">as</span> <span class="n">K</span>
<span class="kn">from</span> <span class="nn">utils</span> <span class="kn">import</span> <span class="o">\*</span>
<span class="kn">from</span> <span class="nn">marcos</span> <span class="kn">import</span> <span class="o">\*</span>
<span class="kn">import</span> <span class="nn">numpy</span> <span class="kn">as</span> <span class="nn">np</span>
<span class="k">def</span> <span class="nf">main</span><span class="p">():</span>
<span class="n">emotion\_classifier</span> <span class="o">=</span> <span class="n">load\_model</span><span class="p">(</span><span class="n">model\_path</span><span class="p">)</span>
<span class="n">layer\_dict</span> <span class="o">=</span> <span class="nb">dict</span><span class="p">([</span><span class="n">layer</span><span class="o">.</span><span class="n">name</span><span class="p">,</span> <span class="n">layer</span><span class="p">]</span> <span class="k">for</span> <span class="n">layer</span> <span class="ow">in</span> <span class="n">emotion\_classifier</span><span class="o">.</span><span class="n">layers</span><span class="p">[</span><span class="mi">1</span><span class="p">:])</span>
<span class="n">input\_img</span> <span class="o">=</span> <span class="n">emotion\_classifier</span><span class="o">.</span><span class="n">input</span>
<span class="n">name\_ls</span> <span class="o">=</span> <span class="p">[</span><span class="s2">"names of the layers you want to get their outputs"</span><span class="p">]</span>
<span class="n">collect\_layers</span> <span class="o">=</span> <span class="p">[</span> <span class="n">K</span><span class="o">.</span><span class="n">function</span><span class="p">([</span><span class="n">input\_img</span><span class="p">,</span> <span class="n">K</span><span class="o">.</span><span class="n">learning\_phase</span><span class="p">()],</span> <span class="p">[</span><span class="n">layer\_dict</span><span class="p">[</span><span class="n">name</span><span class="p">]</span><span class="o">.</span><span class="n">output</span><span class="p">])</span> <span class="k">for</span> <span class="n">name</span> <span class="ow">in</span> <span class="n">name\_ls</span> <span class="p">]</span>
<span class="n">private\_pixels</span> <span class="o">=</span> <span class="n">load\_pickle</span><span class="p">(</span><span class="s1">'../fer2013/privateTest\_pixels.pkl'</span><span class="p">)</span>
<span class="n">private\_pixels</span> <span class="o">=</span> <span class="p">[</span> <span class="n">np</span><span class="o">.</span><span class="n">fromstring</span><span class="p">(</span><span class="n">private\_pixels</span><span class="p">[</span><span class="n">i</span><span class="p">],</span> <span class="n">dtype</span><span class="o">=</span><span class="nb">float</span><span class="p">,</span> <span class="n">sep</span><span class="o">=</span><span class="s1">' '</span><span class="p">)</span><span class="o">.</span><span class="n">reshape</span><span class="p">((</span><span class="mi">1</span><span class="p">,</span> <span class="mi">48</span><span class="p">,</span> <span class="mi">48</span><span class="p">,</span> <span class="mi">1</span><span class="p">))</span>
<span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="nb">len</span><span class="p">(</span><span class="n">private\_pixels</span><span class="p">))</span> <span class="p">]</span>
<span class="n">choose\_id</span> <span class="o">=</span> <span class="mi">17</span>
<span class="n">photo</span> <span class="o">=</span> <span class="n">private\_pixels</span><span class="p">[</span><span class="n">choose\_id</span><span class="p">]</span>
<span class="k">for</span> <span class="n">cnt</span><span class="p">,</span> <span class="n">fn</span> <span class="ow">in</span> <span class="nb">enumerate</span><span class="p">(</span><span class="n">collect\_layers</span><span class="p">):</span>
<span class="n">im</span> <span class="o">=</span> <span class="n">fn</span><span class="p">([</span><span class="n">photo</span><span class="p">,</span> <span class="mi">0</span><span class="p">])</span> <span class="c1">#get the output of that layer</span>
<span class="n">fig</span> <span class="o">=</span> <span class="n">plt</span><span class="o">.</span><span class="n">figure</span><span class="p">(</span><span class="n">figsize</span><span class="o">=</span><span class="p">(</span><span class="mi">14</span><span class="p">,</span> <span class="mi">8</span><span class="p">))</span>
<span class="n">nb\_filter</span> <span class="o">=</span> <span class="n">im</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span><span class="o">.</span><span class="n">shape</span><span class="p">[</span><span class="mi">3</span><span class="p">]</span>
<span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="n">nb\_filter</span><span class="p">):</span>
<span class="n">ax</span> <span class="o">=</span> <span class="n">fig</span><span class="o">.</span><span class="n">add\_subplot</span><span class="p">(</span><span class="n">nb\_filter</span><span class="o">/</span><span class="mi">16</span><span class="p">,</span> <span class="mi">16</span><span class="p">,</span> <span class="n">i</span><span class="o">+</span><span class="mi">1</span><span class="p">)</span>
<span class="n">ax</span><span class="o">.</span><span class="n">imshow</span><span class="p">(</span><span class="n">im</span><span class="p">[</span><span class="mi">0</span><span class="p">][</span><span class="mi">0</span><span class="p">,</span> <span class="p">:,</span> <span class="p">:,</span> <span class="n">i</span><span class="p">],</span> <span class="n">cmap</span><span class="o">=</span><span class="s1">'BuGn'</span><span class="p">)</span>
<span class="n">plt</span><span class="o">.</span><span class="n">xticks</span><span class="p">(</span><span class="n">np</span><span class="o">.</span><span class="n">array</span><span class="p">([]))</span>
<span class="n">plt</span><span class="o">.</span><span class="n">yticks</span><span class="p">(</span><span class="n">np</span><span class="o">.</span><span class="n">array</span><span class="p">([]))</span>
<span class="n">plt</span><span class="o">.</span><span class="n">tight\_layout</span><span class="p">()</span>
<span class="n">fig</span><span class="o">.</span><span class="n">suptitle</span><span class="p">(</span><span class="s1">'Output of layer{} (Given image{})'</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">cnt</span><span class="p">,</span> <span class="n">choose\_id</span><span class="p">))</span>
<span class="n">img\_path</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">vis\_dir</span><span class="p">,</span> <span class="n">store\_path</span><span class="p">)</span>
<span class="k">if</span> <span class="ow">not</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">isdir</span><span class="p">(</span><span class="n">img\_path</span><span class="p">):</span>
<span class="n">os</span><span class="o">.</span><span class="n">mkdir</span><span class="p">(</span><span class="n">img\_path</span><span class="p">)</span>
<span class="n">fig</span><span class="o">.</span><span class="n">savefig</span><span class="p">(</span><span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">img\_path</span><span class="p">,</span><span class="s1">'layer{}'</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">cnt</span><span class="p">)))</span>
</pre></div>
## Reference
→ [Visualize your convolution neural network](https://blog.keras.io/how-convolutional-neural-networks-see-the-world.html)
</xmp>
</xmp> <script src="strapdown.js"></script> </html>
<footer>
<center><a href="./index.html"><i class="fa fa-home"></i></a></center>
<center><i class="fa fa-github"></i></a> Posted by: <a href="https://github.com/sunprinceS/" target="_blank">sunprinceS</a> </center>
<center><i class="fa fa-envelope"></i> Contact information: <a href="mailto:"> [email protected] </a>.</center>
<center><i class="fa fa-mortar-board"></i> Course information: <a href="http://speech.ee.ntu.edu.tw/~tlkagk/courses_ML17.html", target="_blank">Machine Learning (2017, Spring) @ National Taiwan University</a>.</center>
</footer>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-59748795-2', 'auto');
ga('send', 'pageview');
</script>
</html>