title: TensorFlow: Change a variable while training
body: <p>if I change my input pipeline from feed_dict{...} to a tf.data.dataset how can I change the value of a parameter within the network during training after each iteration. To clarify, the old code would look something like this:</p>
  
  <pre><code># Define Training Step:  
  
  # model is some class that defines graph.   
  
  def train_step(x_batch, y_batch, var):
  
          feed_dict = {
              model.input         : x_batch,
              model.labels        : y_batch,
              model.var_to_change : var,
          }
          _, step, summaries, loss, accuracy = sess.run(
              [train_op, global_step, model.cross_entropy, model.accuracy],
              feed_dict)
  
  # Training:  
  
  var_new = 0 
  for i in range(num_epochs):
          batch = mnist.train.next_batch(batch_size)
          train_step(batch[0], batch[1], var_new) 
          var_new = something_new_for_each_iteration
  </code></pre>
  
  <p>For the new stuff it will look something like that:</p>
  
  <pre><code>model = create_model(dataset.inputs, dataset.outputs)
  # where model.train returns tf.group(update_losses, train_op, global_step)
  
  # Training
  
  for step in range(num_epochs):
  
      fetches = {"train": model.train}
      results = sess.run(fetches, options=options)
  </code></pre>
  
  <p>Thank you! </p>