title: What is the right way to pass inputs parameters to a Theano function?
body: <p>I'm using Python 2.7 with Theano library installed (updated version) and I've got a problem with the inputs parameters, defining a Theano function. </p>
  
  <p>The code is:</p>
  
  <pre><code>    corruption_level = T.scalar('corruption')  # % of corruption to use
      learning_rate = T.scalar('lr')  # learning rate to use
  
      fn = theano.function(
          inputs=[
              index,
              theano.In(corruption_level, value=0.2),
              theano.In(learning_rate, value=0.1)
          ],
          outputs=cost,
          updates=updates,
          givens={
              self.x: train_set_x[batch_begin: batch_end]
          }
      )
  </code></pre>
  
  <p>It's taken from here:</p>
  
  <p><a href="http://deeplearning.net/tutorial/code/SdA.py" rel="nofollow noreferrer">http://deeplearning.net/tutorial/code/SdA.py</a></p>
  
  <p>and it gives me this error, with Eclipse:</p>
  
  <pre><code>NotImplementedError: In() instances and tuple inputs trigger the old
  semantics, which disallow using updates and givens
  </code></pre>
  
  <p>So, if I change the code in this way:</p>
  
  <pre><code>        fn = theano.function(
              inputs=[
                  index,
                  #theano.In(corruption_level, value=0.2),
                  #theano.In(learning_rate, value=0.1)
                  corruption_level,
                  learning_rate
              ],
              outputs=cost,
              updates=updates,
              givens={
                  self.x: train_set_x[batch_begin: batch_end]
              }
          )
  </code></pre>
  
  <p>it works but I can't pass the value of corruption_level and learning_rate.</p>
  
  <p>Anyone could help? Thanks!</p>
  
  <p>Luca</p>