Posts

Showing posts with the label reinforcement-learning

Deep reinforcement learning - how to deal with boundaries in action space

Deep reinforcement learning - how to deal with boundaries in action space I've built a custom reinforcement learning environment and agent which is similar to a labyrinth game. environment agent In labyrinth there're 5 possible actions: up, down, left, right, and stay. While if blocked, e.g. agent can't go up, then how do people design env and agent to simulate that? env agent To be specific, the agent is at current state s0 , and by definition taking actions of down, left, and right will change the state to some other values with an immediate reward (>0 if at the exit). One possible approach is when taking action up , the state will stay at s0 and the reward will be a large negative number. Ideally the agent will learn that and never go up again at this state. s0 up s0 up However, my agent seems not learning this. Instead, it still goes up . Another approach is to hard code the agent and the environment that the agent will not be able to perform the action up whe...

How to train Actor-Critic (A2C) reinforcement learning

How to train Actor-Critic (A2C) reinforcement learning I am currently been able to train a system using Q-Learning. I will to move it to Actor_Critic (A2C) method. Please don't ask me why for this move, I have to. I am currently borrowing the implementation from https://github.com/higgsfield/RL-Adventure-2/blob/master/1.actor-critic.ipynb The thing is, I am keep getting a success rate of approx ~ 50% (which is basically random behavior). My game is a long episode (50 steps). Should I print out the reward, the value, or what? How should I debug this? Here are some log: simulation episode 2: Success, turn_count =20 loss = tensor(1763.7875) simulation episode 3: Fail, turn_count= 42 loss = tensor(44.6923) simulation episode 4: Fail, turn_count= 42 loss = tensor(173.5872) simulation episode 5: Fail, turn_count= 42 loss = tensor(4034.0889) simulation episode 6: Fail, turn_count= 42 loss = tensor(132.7567) loss = simulation episode 7: Success, turn_count =22 loss = tensor(2099.5344) ...