# TensorFlow Graph visualizer code import numpy as npįrom IPython. To visualize the data, but you also need internet access. The obvious advantage of this approach is that you don’t need to run TensorBoard All you need to do is call show_graph() and it will handle everything, as shown in theĮxample below on our previous graph g. Sends it over to the cloud, and embeds an with the resulting visualization right in the Jupyter notebook. We’ll use the modified snippet from the DeepDream notebook Using a cloud-hosted TensorBoard instance to do the rendering float32, name = "b3" )Īnd here’s how the resulting graph looks like, showing both a compact view of the whole network (left) and what it looks like when you expand one of the nodes (right). We’ll create a very simple feed forward neural network with three layers (with respective weights W 1, W 2, W 3 W_1, W_2, W_3 W 1 , W 2 , W 3 and biases b 1, b 2, b 3 b_1, b_2, b_3 b 1 , b 2 , b 3 ). But first, lets take a look at a more complicated example without using scopes. Luckily, TensorFlow allows us to bundle operations together into a single unit called scope. This becomes more visible when the graph contains a lot more For example, when we type π ∗ r 2 \pi * r^2 π ∗ r 2 we generally don’t think of the r 2 r^2 r 2 as a multiplication operation (even though we implement it as such), we think of it as a square operation. Now this is all nice and interactive, but we can already see some things which make it harder to read. Note that you can also click on the nodes in the graph to inspect them further. This will launch an instance of TensorBoard which you can access at Then navigate to the Graphs section and you should see a graph that looks like the following image. Next, open up a console and navigate to the same directory from which you executed the FileWriter command, and run tensorboard -logdir=logs. # We write the graph out to the `logs` directory Note that we’re giving explicit names to both of the placeholder variables. In our example below, we’ll create a new instance of the tf.Graph object and create a simple operation adding two variables We can access it via tf.get_default_graph(), but we can also change it temporarily. Regular operations such as creating a placeholder with tf.placeholder will create a node in the so called default graph.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |