title: Select specific features in a Tensorflow 1 layer
body: <p>I followed <a href="https://hackernoon.com/deep-dream-with-tensorflow-a-practical-guide-to-build-your-first-deep-dream-experience-f91df601f479" rel="nofollow noreferrer">this</a>  tutorial and used the ipynb notebook from the <a href="https://github.com/ElephantHunters/Deep-Dream-using-Tensorflow" rel="nofollow noreferrer">Github page</a> to generate deepdream images in Google Colaboratory. The tutorial uses the Inception5h network. 12 layers in this model are commonly used for generating images. </p>
  
  <p>Each layer consists of approximately 500 individual features, which recognize different patterns. It is possible to select specific features in a layer, which yield different results. I've generated images of each feature in layer 6, 'mixed4a:0'. What I'm trying to do now is mix these features.</p>
  
  <p>A specific layer is selected like this:</p>
  
  <pre><code>layer_tensor = model.layer_tensors[5]
  # selects layer 6 out of 12
  </code></pre>
  
  <p>I can select a range of features like this:</p>
  
  <pre><code>layer_tensor = model.layer_tensors[5][:,:,:,0:3]
  # selects feature 0 to 2 from layer 6
  </code></pre>
  
  <p>What I'm trying to do is select specific features instead of a range of features. I've tried a couple of things which obviously don't work.</p>
  
  <pre><code>layer_tensor = model.layer_tensors[5][:,:,:,0,2,4]
  layer_tensor = model.layer_tensors[5][:,:,:,0:2:4]
  layer_tensor = model.layer_tensors[5][:,:,:,[0,2,4]]
  layer_tensor = model.layer_tensors[5][:,:,:,[0:2:4]]
  layer_tensor = model.layer_tensors[5][:,:,:,(0,2,4)]
  </code></pre>
  
  <p>Trying to figure out what kind of object/thing/data structure 'layer_tensor' is, I tried printing it with different parameters:</p>
  
  <pre><code>layer_tensor = model.layer_tensors[5]
  # prints Tensor("mixed4a:0", shape=(?, ?, ?, 508), dtype=float32, device=/device:CPU:0)
  # "mixed4a:0" is the layer name. 508 in 'shape' is the number of features in the layer
  
  layer_tensor = model.layer_tensors[5][:,:,:,0:100]
  # prints: Tensor("strided_slice_127:0", shape=(?, ?, ?, 100), dtype=float32)
  
  layer_tensor = model.layer_tensors[5][:,:,:,0]
  # prints: Tensor("strided_slice_128:0", shape=(?, ?, ?), dtype=float32)
  
  </code></pre>
  
  <p>I'm new with Tensorflow and neural networks in general. Does anyone know how to select different features, not just a range of features? Thanks in advance!</p>
  
  <p>To run the code, load the 'DeepDream_using_tensorflow.ipynb' file into Google Colaboratory. Select the Python3 runtime with GPU backend. Upload the files 'download.py' and 'inception5h.py' into the runtime and it should work properly. </p>