def train(self):
    '\n        Training loop based on the number of episodes\n        :return:\n        '
    for episode in tqdm(range(self.current_episode, self.config.num_episodes)):
        self.current_episode = episode
        self.env.reset()
        self.train_one_epoch()
        if ((self.current_episode % self.config.target_update) == 0):
            self.target_model.load_state_dict(self.policy_model.state_dict())
    self.env.render()
    self.env.close()
Training loop based on the number of episodes
:return:
def train(self):
    '\n        Training loop based on the number of episodes\n        :return:\n        '
    for episode in tqdm(range(self.current_episode, self.config.num_episodes)):
        self.current_episode = episode
        self.env.reset()
        self.train_one_epoch()
        if ((self.current_episode % self.config.target_update) == 0):
            self.target_model.load_state_dict(self.policy_model.state_dict())
    self.env.render()
    self.env.close()