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()

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 = []