def finalize_episode(self, params):
total_reward = sum(self.intermediate_rewards)<EOL>self.total_rewards.append(total_reward)<EOL>self.params.append(params)<EOL>self.intermediate_rewards = []<EOL>
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()