From c9a84ccd195c548767cf41ade48b1f5a3082dc2a Mon Sep 17 00:00:00 2001 From: Chris Anderson Date: Mon, 7 Aug 2017 15:47:45 -0600 Subject: [PATCH] Update README.md --- README.md | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 1e51f7a..f0b96c1 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ ![beholder demo video](https://raw.githubusercontent.com/chrisranderson/beholder/master/readme-images/demo.gif) -Beholder is a TensorBoard plugin for viewing frames of a video while your model trains. It comes with tools to visualize the parameters of your network, visualize arbitrary arrays, or view frames that you've already created. +Beholder is a TensorBoard plugin for viewing frames of a video while your model trains. It comes with tools to visualize the parameters of your network, visualize arbitrary arrays (like gradients or activations), or view frames that you've already created. [Watch this video to see it in action.](https://www.youtube.com/watch?v=06HjEr0OX5k) @@ -36,7 +36,7 @@ In your train loop, trigger an update: visualizer.update() # visualizes tf.trainable_variables() by default ``` -`update` takes two optional parameters: `arrays` expects a list of arbitrary NumPy arrays and `frame` expects a 2D NumPy array: +`update` takes two optional parameters: `arrays` expects a list of arbitrary NumPy arrays (like gradients or activations returned from `sess.run`) and `frame` expects a 2D NumPy array: ```python evaluated_tensors = session.run([var1, var2, var3]) @@ -59,7 +59,7 @@ If you don't install the nightly build, you'll be able to use Beholder, but not Each array is reshaped to fit in a rectangular box called a *section*. *Sections* are composed of groups of pixels called *blocks* that represent individual values in the original array. When `tf.trainable_variables()` is selected, the lower the section is in the image, the deeper it is in the network. -Not all values of large arrays will be shown unless the *Show all data* option is selected (with the exception of [oddly shaped arrays](#other-arrays)). +Not all values of large arrays will be shown unless the *Show all data* option is selected (with the exception of [oddly shaped arrays](#other-arrays)). [Here's an example frame when *Show all data* is enabled on a VGG network variant](https://github.com/chrisranderson/beholder/blob/master/readme-images/convolutional-activations.png). You'll need to download it to view the image at full scale. #### 1D arrays (e.g. biases) ![bias](https://raw.githubusercontent.com/chrisranderson/beholder/master/readme-images/bias.png) @@ -80,6 +80,11 @@ The orange 3x3 chunk is a single channel of a kernel. Rows of chunks (in yellow) Using the *current values* option, you can determine whether there is high information content in your kernels. If the network has finished training and you have many columns that look similar, you might be able to conclude that there are redundancy issues and you can decrease the layer size. +If the shape of the network "looks like" a 4D activation (`if shape[0] != shape[1] and shape[1] == shape[2]`) from a conv layer rather than a weight array, I reshape it differently: +![conv activation example](https://raw.githubusercontent.com/chrisranderson/beholder/master/readme-images/conv-activation-example.png) + + + #### Other arrays Other arrays will be flattened and reshaped so that each block is approximately square. If *Show all data* is selected, some values still may not be shown. Rather than pad the final row with zeros, I truncate it.