-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathautoencoder_noiseipynb
426 lines (426 loc) · 44.6 KB
/
autoencoder_noiseipynb
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
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"Using TensorFlow backend.\n"
]
}
],
"source": [
"import numpy as np\n",
"from keras.datasets import mnist\n",
"from keras.layers import Conv2D, Flatten, Activation, Dense, Input\n",
"from keras.layers import Conv2DTranspose\n",
"from keras.layers import Reshape\n",
"import matplotlib.pyplot as plt\n",
"from keras.models import Model"
]
},
{
"cell_type": "code",
"execution_count": 15,
"metadata": {},
"outputs": [],
"source": [
"(x_train, y_train), (x_test, y_test) = mnist.load_data()\n",
"\n",
"x_train = x_train.astype('float32')\n",
"x_test = x_test.astype('float32')\n",
"x_train /= 255\n",
"x_test /= 255\n",
"\n",
"input_shape = (28, 28, 1)\n",
"\n",
"x_train = x_train.reshape((x_train.shape[0], ) + input_shape ) \n",
"x_test = x_test.reshape((x_test.shape[0], ) + input_shape)"
]
},
{
"cell_type": "code",
"execution_count": 16,
"metadata": {},
"outputs": [],
"source": [
"noise = np.random.normal(loc=0.5, scale=0.5, size=x_train.shape)\n",
"noise_test = np.random.normal(loc=0.5, scale=0.5, size=x_test.shape)"
]
},
{
"cell_type": "code",
"execution_count": 17,
"metadata": {},
"outputs": [],
"source": [
"x_train_with_noise = np.clip((x_train + noise), 0., 1.)\n",
"x_test_with_noise = np.clip((x_test + noise_test), 0., 1.)"
]
},
{
"cell_type": "code",
"execution_count": 18,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"(10000, 28, 28, 1)"
]
},
"execution_count": 18,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"x_test_with_noise.shape"
]
},
{
"cell_type": "code",
"execution_count": 19,
"metadata": {},
"outputs": [],
"source": [
"def get_shape(layer):\n",
" shape = ()\n",
" for i in layer.shape:\n",
" shape += (i.value, )\n",
" return shape"
]
},
{
"cell_type": "code",
"execution_count": 24,
"metadata": {},
"outputs": [],
"source": [
"#encoder\n",
"encoder_inputs = Input(shape=input_shape)\n",
"x = encoder_inputs\n",
"x = Conv2D(filters=32,\n",
" kernel_size=(3, 3),\n",
" activation='relu',\n",
" strides = 2,\n",
" padding='same')(x)\n",
"x = Conv2D(filters=64,\n",
" kernel_size=(3, 3),\n",
" activation='relu',\n",
" strides = 2,\n",
" padding='same')(x)\n",
"shape = get_shape(x)\n",
"x = Flatten()(x)\n",
"output = Dense(16)(x)\n",
"encoder = Model(encoder_inputs, output, name='encoder')"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": 25,
"metadata": {},
"outputs": [],
"source": [
"input_from_encoder = Input(shape=(16,))\n",
"x = Dense(shape[1] * shape[2] * shape[3])(input_from_encoder)\n",
"x = Reshape((shape[1], shape[2], shape[3]))(x)\n",
"\n",
"x = Conv2DTranspose(filters=64,\n",
" kernel_size=(3, 3),\n",
" activation='relu',\n",
" strides = 2,\n",
" padding='same')(x)\n",
"x = Conv2DTranspose(filters=32,\n",
" kernel_size=(3, 3),\n",
" activation='relu',\n",
" strides = 2,\n",
" padding='same')(x)\n",
"x = Conv2DTranspose(filters=1,\n",
" kernel_size=(3, 3),\n",
" padding='same')(x)\n",
"\n",
"output_image = Activation('sigmoid')(x)\n",
"decoder = Model(input_from_encoder, output_image, name='decoder')"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": 26,
"metadata": {},
"outputs": [],
"source": [
"autoencoder = Model(encoder_inputs, decoder(encoder(encoder_inputs)))"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": 27,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Epoch 1/10\n",
"60000/60000 [==============================] - 192s 3ms/step - loss: 0.0739 - acc: 0.8045\n",
"Epoch 2/10\n",
"60000/60000 [==============================] - 250s 4ms/step - loss: 0.0481 - acc: 0.7977\n",
"Epoch 3/10\n",
"60000/60000 [==============================] - 213s 4ms/step - loss: 0.0335 - acc: 0.8026\n",
"Epoch 4/10\n",
"60000/60000 [==============================] - 176s 3ms/step - loss: 0.0290 - acc: 0.8051\n",
"Epoch 5/10\n",
"60000/60000 [==============================] - 244s 4ms/step - loss: 0.0265 - acc: 0.8065\n",
"Epoch 6/10\n",
"60000/60000 [==============================] - 303s 5ms/step - loss: 0.0248 - acc: 0.8074\n",
"Epoch 7/10\n",
"60000/60000 [==============================] - 420s 7ms/step - loss: 0.0236 - acc: 0.8080\n",
"Epoch 8/10\n",
"60000/60000 [==============================] - 410s 7ms/step - loss: 0.0227 - acc: 0.8085\n",
"Epoch 9/10\n",
"60000/60000 [==============================] - 297s 5ms/step - loss: 0.0221 - acc: 0.8088\n",
"Epoch 10/10\n",
"60000/60000 [==============================] - 234s 4ms/step - loss: 0.0215 - acc: 0.8090\n"
]
},
{
"data": {
"text/plain": [
"<keras.callbacks.History at 0x7f893dbb0978>"
]
},
"execution_count": 27,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"autoencoder.compile(loss='mse', optimizer='adam', metrics=['accuracy'])\n",
"autoencoder.fit(x_train_with_noise,\n",
" x_train,\n",
" epochs=10,\n",
" batch_size=256)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": 28,
"metadata": {},
"outputs": [],
"source": [
"test_image = x_test_with_noise[0]"
]
},
{
"cell_type": "code",
"execution_count": 29,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"<matplotlib.image.AxesImage at 0x7f893d4cc240>"
]
},
"execution_count": 29,
"metadata": {},
"output_type": "execute_result"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAP8AAAD8CAYAAAC4nHJkAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAGwhJREFUeJzt3Xl4FNS5BvD3IyTsIoSdRCCByCqIEXGpIqgscsUVQRFEBHfqrUspthe1rcXautS6oaJQRbRXWa6gKaKAKFtUVtmTICFAAsGwB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gXyLylYiMiXZnTqJp4Nj048enN4lyf34s6MnNkfSjk6WrzGNXnhOvwy0axX+y03+q0pDDharaHUB/APcE/ryl0IR0cnOknORk6SqhvCdeh1s0ij8bQOIJ3ycAyIlCP05KVXMC/+YCmIGqd/rw7uOHpAb+zY1yf/6tKp3cfLKTpVEFHruqdOJ1NIp/BYB2ItJGROIADAEwOwr9+AkRqRP4IAYiUgfAFah6pw/PBjAi8PUIALOi2JcfqConN7tOlkaUH7uqduJ1VCb5BIYyngUQA2Cyqv4x4p04CRFJwrFXe+DYzsbTotk3EXkHQC8cW/W1G8AEADMBvAfgDADfAbhBVSP+wZujb71w7E/Xf5/cfPw9doT7dhGAzwGsAVAWuHg8jr2/jtpjZ/RrKKLwuHGGH5GnOMOPyFMsfiJPsfiJPMXiJ/IUi5/IUyx+Ik+x+Ik8xeIn8tT/AxFw40EH2JeVAAAAAElFTkSuQmCC\n",
"text/plain": [
"<matplotlib.figure.Figure at 0x7f893de1ae80>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
}
],
"source": [
"plt.imshow(test_image[:, :, 0])"
]
},
{
"cell_type": "code",
"execution_count": 30,
"metadata": {},
"outputs": [],
"source": [
"clean = autoencoder.predict(test_image.reshape(1, 28, 28, 1))"
]
},
{
"cell_type": "code",
"execution_count": 31,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"<matplotlib.image.AxesImage at 0x7f893d401748>"
]
},
"execution_count": 31,
"metadata": {},
"output_type": "execute_result"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAP8AAAD8CAYAAAC4nHJkAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAERZJREFUeJzt3XuMXdV1x/HvmvGMx0+wMX5gG5tXXShtoJo4qdwSUkpC0igGVdBYbeRUCEdqkJo2VYv4J/zRSqQqUNQ2aUyxMBUhIUoAJ6VNkBvJJFSEgVAMODxCBmxs/MDgJ/Y87uofcx0NZs46w9znsH4f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ve4D7ab/dh3ef2CS1+nVPi/vzK+20c/NYO0vTBueunXa8bkX4HwfOM7OzzKwb+AywqQX9eBczm1H9RQxmNgP4GO23+/AmYG31+7XAgy3syzu0y87NRTtL0+Jz1247XrfkJp/qUMY/AZ3ABnf/+6Z3YgxmdjYjV3sYWdn4G63sm5ndC1zKyKyv3cCXgQeA+4AzgVeBq9296b94K+jbpYy8df3Vzs0nPmM3uW+/CzwCbAVOLJ18IyOfr1t27oJ+raEF5013+IkkpTv8RJJS+EWSUvhFklL4RZJS+EWSUvhFklL4RZJS+EWS+n+E8N27srYvNQAAAABJRU5ErkJggg==\n",
"text/plain": [
"<matplotlib.figure.Figure at 0x7f893d4cccc0>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
}
],
"source": [
"plt.imshow(clean[0, :, :, 0])"
]
},
{
"cell_type": "code",
"execution_count": 36,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"<matplotlib.image.AxesImage at 0x7f893d385b70>"
]
},
"execution_count": 36,
"metadata": {},
"output_type": "execute_result"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAP8AAAD8CAYAAAC4nHJkAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAADa9JREFUeJzt3X2MXPV1xvHnib1e4jW0OMTGNQYnhKA4NJBqYxK5rRxRp9AEmSiBYqmWK6UsakGCKmqLLEVBaptSFEJpk0ZyihsT8ZYGKFbipkFWW4pKHS+Id9NCqUtcb72AaW0C+AWf/rHX0QZ2fjvM2531+X4ka2buuXfu0fU+e2f2N3d+jggByOcddTcAoB6EH0iK8ANJEX4gKcIPJEX4gaQIP5AU4QeSIvxAUrN7ubM5HozjNNTLXQKpvK4f62AccDPrthV+2+dLuknSLEl/FRHXldY/TkM61+e1s0sABdtia9Prtvyy3/YsSV+TdIGkZZLW2F7W6vMB6K123vMvl/RsRDwXEQcl3SFpdWfaAtBt7YR/saQfTXq8q1r2U2yP2B61PXpIB9r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ain": [
"<matplotlib.figure.Figure at 0x7f893d1bc6d8>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
}
],
"source": [
"plt.imshow(x_test[0].reshape(28, 28))"
]
},
{
"cell_type": "code",
"execution_count": 38,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"<matplotlib.image.AxesImage at 0x7f893cf53320>"
]
},
"execution_count": 38,
"metadata": {},
"output_type": "execute_result"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAsMAAAD0CAYAAAB+bCt+AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XecnHW5/vHrzmbTQwgpkEYahE4AQ7cE0BMISlUBAQFpgoIeFeSg54D1gF1REBCkg3SRFimG3gKGUFIJgfSEACEJKVu+vz92+Lnm7PUkmd2dmc3zeb9eeWV3rn2e5zuzc8/cO/vsPZFSEgAAAJBH7cq9AAAAAKBcaIYBAACQWzTDAAAAyC2aYQAAAOQWzTAAAAByi2YYAAAAuUUz3IZFxGsRMbrc6wBQWhFxTUT8eD2/dlZEfLq11wRg/UTE+Ig4pdzrwL/QDLdhKaUdUkrjW/MYG/KkCwDAxqS5P0xGxIURcUNLrgktj2YYAABgA0VE+3KvAS2DZrgN++gn1sJPnrdGxHURsaxw+sSotb7uvyLi9Yh4LyL+HBGdCtmJEfHkWvtNEbFVRJwm6VhJ50bE8oj4W2mvIdC2FWrvnIiYFBErIuKqiNg8Ih4o1OrDEdGz8LWHFGr3/cKvUbdrtJ9dI+KlwjZ/kdRpreN8NiImFrZ9OiJ2LvFVBTY6EXG9pC0l/a3wHHhu4fnx5Ih4W9KjETE6Iuastd1Hz80HSjpf0lGF7V9u9GWDI+KpQk3/PSJ6l+6aYW00wxuPQyTdImlTSfdI+v1a+bGSxkgaLmmEpO+va4cppSsk3SjpZymlbimlz7XoioF8OFLSZ9RQd5+T9IAaniB7q+Ex+OyIGCHpZknflNRH0v1qeALuEBEdJN0t6Xp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qPgcJXo9omIkHSVpMkppV81ikp+27i1lOu2KbGKqVepYmuWeqVeK0nF1Cz1mo16raB6TSmV/J+ksWr4a9c3JH2vHGsorGOYpJcL/14rx1ok3ayGXwHUqOEn+pMl9ZL0iKTphf83K+Narpf0iqRJaiiUfiVay8fV8Ku9SZImFv6NLcdtk7GWstw2ZbiPVkS9FtZS1pqlXu1aqNcK+lcpNUu9rnMt1GuF1CvvQAcAAIDc4h3oAAAAkFs0wwAAAMgtmmEAAADkFs0wAAAAcotmGAAAALlFMwwAAIDcohkGAABAbtEMAwAAILf+H7roXeexr6uwAAAAAElFTkSuQmCC\n",
"text/plain": [
"<matplotlib.figure.Figure at 0x7f893d074b70>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
}
],
"source": [
"figure, axes = plt.subplots(1, 3, figsize=(12, 12))\n",
"axes[0].set_title(\"input\")\n",
"axes[0].imshow(test_image[:, :, 0])\n",
"axes[1].set_title(\"model\")\n",
"axes[1].imshow(clean[0, :, :, 0])\n",
"axes[2].set_title(\"truth\")\n",
"axes[2].imshow(x_test[0].reshape(28, 28))"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.5.3"
}
},
"nbformat": 4,
"nbformat_minor": 2
}