title: Using theano with single examples out of batch
body: <p>I'm currently using the machine learning library theano to produce a project which utilises deep learning techniques, to find an internal representation of the MNIST dataset.</p>
  
  <p>So far my codebase is pretty much the same as this convolutional net tutorial <a href="http://deeplearning.net/tutorial/lenet.html" rel="nofollow">http://deeplearning.net/tutorial/lenet.html</a></p>
  
  <p>Mt problem is arising from the fact that I want to be able to select individual examples out of the test batches (or indeed my own handwritten characters for testing) but I can't seem to get theano to do this.</p>
  
  <p>I have tried quite a few things (been stuck for 4+ days) but my latest attempt which I think is getting somewhere looks like this:</p>
  
  <pre><code>testFunction = theano.function(
          inputs=[index],
          outputs=[layer3.y_pred],
          givens={
              layer0.input: [tData[index]]
          }
  )
  </code></pre>
  
  <p>tData is a theano.shared variable which contains the testing images, layer3.y_pred is the output I'm interested in.</p>
  
  <p>But I keep getting errors related to shape, non-tensor types, and conversions. Anybody who has any experience with theano and knows what's going on under the hood I would really appreciate some input.</p>