diff --git a/10_introduction_to_artificial_neural_networks.ipynb b/10_introduction_to_artificial_neural_networks.ipynb index 7f9b57a..9684717 100644 --- a/10_introduction_to_artificial_neural_networks.ipynb +++ b/10_introduction_to_artificial_neural_networks.ipynb @@ -1631,48 +1631,11 @@ }, { "cell_type": "code", - "execution_count": 28, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ - "# 크롬 브라우저는 확인되었지만 다른 브라우저에서는 작동되지 않을 수 있습니다.\n", - "\n", - "from IPython.display import clear_output, Image, display, HTML\n", - "\n", - "def strip_consts(graph_def, max_const_size=32):\n", - " \"\"\"Strip large constant values from graph_def.\"\"\"\n", - " strip_def = tf.GraphDef()\n", - " for n0 in graph_def.node:\n", - " n = strip_def.node.add() \n", - " n.MergeFrom(n0)\n", - " if n.op == 'Const':\n", - " tensor = n.attr['value'].tensor\n", - " size = len(tensor.tensor_content)\n", - " if size > max_const_size:\n", - " tensor.tensor_content = b\"\"%size\n", - " return strip_def\n", - "\n", - "def show_graph(graph_def, max_const_size=32):\n", - " \"\"\"Visualize TensorFlow graph.\"\"\"\n", - " if hasattr(graph_def, 'as_graph_def'):\n", - " graph_def = graph_def.as_graph_def()\n", - " strip_def = strip_consts(graph_def, max_const_size=max_const_size)\n", - " code = \"\"\"\n", - " \n", - " \n", - "
\n", - " \n", - "
\n", - " \"\"\".format(data=repr(str(strip_def)), id='graph'+str(np.random.rand()))\n", - "\n", - " iframe = \"\"\"\n", - " \n", - " \"\"\".format(code.replace('\"', '"'))\n", - " display(HTML(iframe))" + "from tensorflow_graph_in_jupyter import show_graph" ] }, { @@ -2237,7 +2200,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.5.5" + "version": "3.6.5" }, "nav_menu": { "height": "264px", diff --git a/14_recurrent_neural_networks.ipynb b/14_recurrent_neural_networks.ipynb index 3e08016..c023e2c 100644 --- a/14_recurrent_neural_networks.ipynb +++ b/14_recurrent_neural_networks.ipynb @@ -312,46 +312,11 @@ }, { "cell_type": "code", - "execution_count": 14, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ - "from IPython.display import clear_output, Image, display, HTML\n", - "\n", - "def strip_consts(graph_def, max_const_size=32):\n", - " \"\"\"Strip large constant values from graph_def.\"\"\"\n", - " strip_def = tf.GraphDef()\n", - " for n0 in graph_def.node:\n", - " n = strip_def.node.add() \n", - " n.MergeFrom(n0)\n", - " if n.op == 'Const':\n", - " tensor = n.attr['value'].tensor\n", - " size = len(tensor.tensor_content)\n", - " if size > max_const_size:\n", - " tensor.tensor_content = \"b\"%size\n", - " return strip_def\n", - "\n", - "def show_graph(graph_def, max_const_size=32):\n", - " \"\"\"Visualize TensorFlow graph.\"\"\"\n", - " if hasattr(graph_def, 'as_graph_def'):\n", - " graph_def = graph_def.as_graph_def()\n", - " strip_def = strip_consts(graph_def, max_const_size=max_const_size)\n", - " code = \"\"\"\n", - " \n", - " \n", - "
\n", - " \n", - "
\n", - " \"\"\".format(data=repr(str(strip_def)), id='graph'+str(np.random.rand()))\n", - "\n", - " iframe = \"\"\"\n", - " \n", - " \"\"\".format(code.replace('\"', '"'))\n", - " display(HTML(iframe))" + "from tensorflow_graph_in_jupyter import show_graph" ] }, { @@ -3490,7 +3455,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.5.5" + "version": "3.6.5" }, "nav_menu": {}, "toc": {