docstr: Closes the current episode, sums up rewards and stores the parameters
  
  # Argument
      params (object): Parameters associated with the episode to be stored and then retrieved back in sample()
docstr_tok: ["Closes","the","current","episode",",","sums","up","rewards","and","stores","the","parameters","#","Argument","params","(","object",")",":","Parameters","associated","with","the","episode","to","be","stored","and","then","retrieved","back","in","sample","(",")"]
code: def finalize_episode(self, params):
      """Closes the current episode, sums up rewards and stores the parameters
  
      # Argument
          params (object): Parameters associated with the episode to be stored and then retrieved back in sample()
      """
      total_reward = sum(self.intermediate_rewards)
      self.total_rewards.append(total_reward)
      self.params.append(params)
      self.intermediate_rewards = []
  
imports: from __future__ import absolute_import
  from collections import deque, namedtuple
  import warnings
  import random
  import numpy
label_desc: Use image node_id 4 for calling the EpisodeParameterMemory obj's underlying member method code with example usage: obj.finalize_episode(params) without return types