In my reinforcement learning algorithm, I implemented the following logic in coding(I…
- User
In my reinforcement learning algorithm, I implemented the following logic in coding(I donot know whether my implemented logic is correct or not related to intermediate reward processing), i passed the intermediate reward to the agent, wen we get 'reward = -200' or 'reward >= 90'.
Previously My code was implemented by passing the reward function(append reward) to the agent after completing the maximum step size of the iteration loop in that current episode at the end of each episode, but, later i modified my code by pass the intermediate reward(while drastic deviation occurs) with in the episode to agent to guide it more effectively. So, i updated the previous code based on my requirement which is given below(my modified code is given below for your review).
I donot know whether the logic or the formal procedure which i implemented for passing the intermediate reward to the PPO agent is correct or wrong, because i am passing the data which are corresponding to that timestep where the intermediate reward occurs to the PPO agent to update policy intermediately, and also i am passing all the datas including the data which were passed intermediately at the end os each episode for final policy update. please rewiew the code completely and advice me the potential issue in my logic, whether the intermediate policy updation were properly synchronized and logically correct with the reinforcement algorithm procesures and policy updation procedures.
PPOAgent definition
class PPOAgent: def init(self, state_dim, action_space, lr_actor, lr_critic, gamma, gae_lambda, epsilon, policy_clip, epochs, entropy_coef): # Instantiation
code - Assistant