Skip to content

Commit 23fa772

Browse files
update
1 parent 5c2bbc9 commit 23fa772

File tree

3 files changed

+109
-209
lines changed

3 files changed

+109
-209
lines changed

DeepLearning/tensorflow/CNN.ipynb

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -114,14 +114,21 @@
114114
"\n",
115115
"for i in range(1000):\n",
116116
" batch = mnist.train.next_batch(50)\n",
117+
" print(batch[0])\n",
117118
" train_step.run(feed_dict={x: batch[0], y_: batch[1]})\n",
118119
"\n",
119120
"correct_prediction = tf.equal(tf.argmax(y,1), tf.argmax(y_,1))\n",
120121
"accuracy = tf.reduce_mean(tf.cast(correct_prediction, \"float\"))\n",
121122
"\n",
122-
"print (accuracy.eval(feed_dict={x: mnist.test.images, y_: mnist.test.labels}))\n",
123-
"\n",
124-
"\n",
123+
"print (accuracy.eval(feed_dict={x: mnist.test.images, y_: mnist.test.labels}))"
124+
]
125+
},
126+
{
127+
"cell_type": "code",
128+
"execution_count": null,
129+
"metadata": {},
130+
"outputs": [],
131+
"source": [
125132
"#CNN\n",
126133
"\n",
127134
"#我们会建立大量权重和偏置项,为了方便,定义初始函数\n",
@@ -264,7 +271,7 @@
264271
"\n",
265272
"\n",
266273
"sess.run(tf.initialize_all_variables())\n",
267-
"for i in range(1000): # 训练3000回合\n",
274+
"for i in range(1): # 训练3000回合\n",
268275
" batch = mnist.train.next_batch(50)\n",
269276
" \n",
270277
" if i%100 == 0: # 每100回合输出一次\n",

0 commit comments

Comments
 (0)