original_docstring: 
          Performs an update of parameters by sampling from replay_buffer
  
          Args:
              t: number of iteration (episode and move)
              replay_buffer: ReplayBuffer instance .sample() gives batches
              lr: (float) learning rate
          Returns:
              loss: (Q - Q_target)^2
          
docstring: Performs an update of parameters by sampling from replay_buffer
docstring_tokens: Performs an update of parameters by sampling from replay_buffer
code: def update_step(self, t, replay_buffer, lr):
          """
          Performs an update of parameters by sampling from replay_buffer
  
          Args:
              t: number of iteration (episode and move)
              replay_buffer: ReplayBuffer instance .sample() gives batches
              lr: (float) learning rate
          Returns:
              loss: (Q - Q_target)^2
          """
  
          s_batch, a_batch, r_batch, sp_batch, done_mask_batch = replay_buffer.sample(
              self.config.batch_size)
  
  
          fd = {
              # inputs
              self.s: s_batch,
              self.a: a_batch,
              self.r: r_batch,
              self.sp: sp_batch, 
              self.done_mask: done_mask_batch,
              self.lr: lr, 
              # extra info
              self.avg_reward_placeholder: self.avg_reward, 
              self.max_reward_placeholder: self.max_reward, 
              self.std_reward_placeholder: self.std_reward, 
              self.avg_q_placeholder: self.avg_q, 
              self.max_q_placeholder: self.max_q, 
              self.std_q_placeholder: self.std_q, 
              self.eval_reward_placeholder: self.eval_reward, 
          }
  
          loss_eval, grad_norm_eval, summary, _ = self.sess.run([self.loss, self.grad_norm, 
                                                   self.merged, self.train_op], feed_dict=fd)
  
  
          # tensorboard stuff
          self.file_writer.add_summary(summary, t)
          
          return loss_eval, grad_norm_eval
code_tokens: def update_step ( self , t , replay_buffer , lr ) : s_batch , a_batch , r_batch , sp_batch , done_mask_batch = replay_buffer . sample ( self . config . batch_size ) fd = { self . s : s_batch , self . a : a_batch , self . r : r_batch , self . sp : sp_batch , self . done_mask : done_mask_batch , self . lr : lr , self . avg_reward_placeholder : self . avg_reward , self . max_reward_placeholder : self . max_reward , self . std_reward_placeholder : self . std_reward , self . avg_q_placeholder : self . avg_q , self . max_q_placeholder : self . max_q , self . std_q_placeholder : self . std_q , self . eval_reward_placeholder : self . eval_reward , } loss_eval , grad_norm_eval , summary , _ = self . sess . run ( [ self . loss , self . grad_norm , self . merged , self . train_op ] , feed_dict = fd ) self . file_writer . add_summary ( summary , t ) return loss_eval , grad_norm_eval
short_docstring: Performs an update of parameters by sampling from replay_buffer
short_docstring_tokens: Performs an update of parameters by sampling from replay_buffer
comment: """
          Performs an update of parameters by sampling from replay_buffer
  
          Args:
              t: number of iteration (episode and move)
              replay_buffer: ReplayBuffer instance .sample() gives batches
              lr: (float) learning rate
          Returns:
              loss: (Q - Q_target)^2
          """$SEP$# inputs$SEP$# extra info$SEP$# tensorboard stuff