def run_train(Env, curr_RL_Config): # run the training process """ Train the agents """ Num_neighbor = Env.n_Neighbor Num_d2d = Env.n_Veh Num_CH = Env.n_RB Num_D2D_feedback = curr_RL_Config.Num_Feedback # construct a BS agent BS_Agent = Agent(Num_d2d, Num_CH, Num_neighbor, Num_D2D_feedback, Env, curr_RL_Config) Num_Episodes = curr_RL_Config.Num_Episodes Num_Train_Step = curr_RL_Config.Num_Train_Steps # get the train loss [Train_Loss, Reward_Per_Train_Step, Reward_Per_Episode, Train_Q_mean, Train_Q_max_mean, Orig_Train_Q_mean, Orig_Train_Q_max_mean] \ = BS_Agent.train(Num_Episodes, Num_Train_Step) return [ Train_Loss, Reward_Per_Train_Step, Reward_Per_Episode, Train_Q_mean, Train_Q_max_mean, Orig_Train_Q_mean, Orig_Train_Q_max_mean ]
def run_train(Env, curr_RL_Config): # run the training process """ Run the Training Process """ # parameters to construct a BS Agent object Num_neighbor = Env.n_Neighbor Num_d2d = Env.n_Veh Num_CH = Env.n_RB Num_D2D_feedback = curr_RL_Config.Num_Feedback BS_Agent = Agent(Num_d2d, Num_CH, Num_neighbor, Num_D2D_feedback, Env, curr_RL_Config) Num_Episodes = curr_RL_Config.Num_Episodes Num_Train_Step = curr_RL_Config.Num_Train_Steps # get the train loss [Train_Loss, Train_Q_mean, Train_Q_max_mean] = BS_Agent.train(Num_Episodes, Num_Train_Step) return [Train_Loss, Train_Q_mean, Train_Q_max_mean]