Skip to content

Commit 6bc61b6

Browse files
committed
tensorflow/
1 parent f4134d9 commit 6bc61b6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+12270
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "markdown",
5+
"metadata": {},
6+
"source": [
7+
"board"
8+
]
9+
},
10+
{
11+
"cell_type": "raw",
12+
"metadata": {},
13+
"source": [
14+
"merged_summary_op = tf.merge_all_summaries()#z在这个位置汇总\n",
15+
"summary_writer = tf.train.SummaryWriter('/tmp/mnist_logs', sess.graph)#logdier,graph\n",
16+
"total_step = 0\n",
17+
"while training:\n",
18+
" total_step += 1\n",
19+
" session.run(training_op)\n",
20+
" if total_step % 100 == 0:\n",
21+
" summary_str = session.run(merged_summary_op)\n",
22+
" summary_writer.add_summary(summary_str, total_step)\n",
23+
" "
24+
]
25+
}
26+
],
27+
"metadata": {
28+
"kernelspec": {
29+
"display_name": "Python 3",
30+
"language": "python",
31+
"name": "python3"
32+
},
33+
"language_info": {
34+
"codemirror_mode": {
35+
"name": "ipython",
36+
"version": 3
37+
},
38+
"file_extension": ".py",
39+
"mimetype": "text/x-python",
40+
"name": "python",
41+
"nbconvert_exporter": "python",
42+
"pygments_lexer": "ipython3",
43+
"version": "3.6.1"
44+
}
45+
},
46+
"nbformat": 4,
47+
"nbformat_minor": 2
48+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "code",
5+
"execution_count": 1,
6+
"metadata": {
7+
"collapsed": true
8+
},
9+
"outputs": [],
10+
"source": [
11+
"import tensorflow as tf\n",
12+
"import numpy as np"
13+
]
14+
},
15+
{
16+
"cell_type": "code",
17+
"execution_count": 6,
18+
"metadata": {},
19+
"outputs": [
20+
{
21+
"name": "stdout",
22+
"output_type": "stream",
23+
"text": [
24+
"[[ 22. 28.]\n",
25+
" [ 49. 64.]]\n"
26+
]
27+
}
28+
],
29+
"source": [
30+
"# 新建一个graph.\n",
31+
"with tf.device('/gpu:0'):\n",
32+
" a = tf.constant([1.0, 2.0, 3.0, 4.0, 5.0, 6.0], shape=[2, 3], name='a')\n",
33+
" b = tf.constant([1.0, 2.0, 3.0, 4.0, 5.0, 6.0], shape=[3, 2], name='b')\n",
34+
"c = tf.matmul(a, b)\n",
35+
"# 新建session with log_device_placement并设置为True.\n",
36+
"sess = tf.Session(config=tf.ConfigProto(log_device_placement=True))\n",
37+
"# 运行这个op.\n",
38+
"print(sess.run(c))"
39+
]
40+
}
41+
],
42+
"metadata": {
43+
"kernelspec": {
44+
"display_name": "Python 3",
45+
"language": "python",
46+
"name": "python3"
47+
},
48+
"language_info": {
49+
"codemirror_mode": {
50+
"name": "ipython",
51+
"version": 3
52+
},
53+
"file_extension": ".py",
54+
"mimetype": "text/x-python",
55+
"name": "python",
56+
"nbconvert_exporter": "python",
57+
"pygments_lexer": "ipython3",
58+
"version": "3.6.4"
59+
}
60+
},
61+
"nbformat": 4,
62+
"nbformat_minor": 2
63+
}

0 commit comments

Comments
 (0)