Browse code

코드 복원

Ikseon Kang authored on28/06/2019 16:00:23
Showing1 changed files
1 1
deleted file mode 100644
... ...
@@ -1,23 +0,0 @@
1
-import tensorflow as tf
2
-
3
-def get_simple_graph_def():
4
-  """Create a simple graph and return its graph_def."""
5
-  g = tf.Graph()
6
-  with g.as_default():
7
-    a = tf.placeholder(
8
-        dtype=tf.float32, shape=(None, 24, 24, 2), name="input")
9
-    e = tf.constant(
10
-        [[[[1., 0.5, 4., 6., 0.5, 1.], [1., 0.5, 1., 1., 0.5, 1.]]]],
11
-        name="weights",
12
-        dtype=tf.float32)
13
-    conv = tf.nn.conv2d(
14
-        input=a, filter=e, strides=[1, 2, 2, 1], padding="SAME", name="conv")
15
-    b = tf.constant(
16
-        [4., 1.5, 2., 3., 5., 7.], name="bias", dtype=tf.float32)
17
-    t = tf.nn.bias_add(conv, b, name="biasAdd")
18
-    relu = tf.nn.relu(t, "relu")
19
-    idty = tf.identity(relu, "ID")
20
-    v = tf.nn.max_pool(
21
-        idty, [1, 2, 2, 1], [1, 2, 2, 1], "VALID", name="max_pool")
22
-    tf.squeeze(v, name="output")
23
-  return g.as_graph_def()
Browse code

함수 분리

Ikseon Kang authored on28/06/2019 15:03:29
Showing1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,23 @@
1
+import tensorflow as tf
2
+
3
+def get_simple_graph_def():
4
+  """Create a simple graph and return its graph_def."""
5
+  g = tf.Graph()
6
+  with g.as_default():
7
+    a = tf.placeholder(
8
+        dtype=tf.float32, shape=(None, 24, 24, 2), name="input")
9
+    e = tf.constant(
10
+        [[[[1., 0.5, 4., 6., 0.5, 1.], [1., 0.5, 1., 1., 0.5, 1.]]]],
11
+        name="weights",
12
+        dtype=tf.float32)
13
+    conv = tf.nn.conv2d(
14
+        input=a, filter=e, strides=[1, 2, 2, 1], padding="SAME", name="conv")
15
+    b = tf.constant(
16
+        [4., 1.5, 2., 3., 5., 7.], name="bias", dtype=tf.float32)
17
+    t = tf.nn.bias_add(conv, b, name="biasAdd")
18
+    relu = tf.nn.relu(t, "relu")
19
+    idty = tf.identity(relu, "ID")
20
+    v = tf.nn.max_pool(
21
+        idty, [1, 2, 2, 1], [1, 2, 2, 1], "VALID", name="max_pool")
22
+    tf.squeeze(v, name="output")
23
+  return g.as_graph_def()