openai-gym

Low GPU utilisation when running Tensorflow

狂风中的少年 提交于 2021-01-27 07:09:29
问题 I've been doing Deep Reinforcement Learning using Tensorflow and OpenAI gym. My problem is low GPU utilisation. Googling this issue, I understood that it's wrong to expect much GPU utilisation when training small networks ( eg. for training mnist). But my Neural Network is not so small, I think. The architecture is similar to the given in the original deepmind paper (more or less). The architecture of my network is summarized below Convolution layer 1 (filters=32, kernel_size=8x8, strides=4)

How does DQN work in an environment where reward is always -1

删除回忆录丶 提交于 2021-01-05 07:14:05
问题 Given that the OpenAI Gym environment MountainCar-v0 ALWAYS returns -1.0 as a reward (even when goal is achieved), I don't understand how DQN with experience-replay converges, yet I know it does, because I have working code that proves it. By working, I mean that when I train the agent, the agent quickly (within 300-500 episodes) learns how to solve the mountaincar problem. Below is an example from my trained agent. It is my understanding that ultimately there needs to be a "sparse reward"

python OpenAI gym monitor creates json files in the recording directory

只愿长相守 提交于 2021-01-02 07:56:32
问题 I am implementing value iteration on the gym CartPole-v0 environment and would like to record the video of the agent's actions in a video file. I have been trying to implement this using the Monitor wrapper but it generates json files instead of a video file in the recording directory. This is my code: env = gym.make('FrozenLake-v0') env = gym.wrappers.Monitor(env, 'recording', force=True) env.seed(0) optimalValue = valueIteration(env) st = time.time() policy = cal_policy(optimalValue) policy

python OpenAI gym monitor creates json files in the recording directory

五迷三道 提交于 2021-01-02 07:56:02
问题 I am implementing value iteration on the gym CartPole-v0 environment and would like to record the video of the agent's actions in a video file. I have been trying to implement this using the Monitor wrapper but it generates json files instead of a video file in the recording directory. This is my code: env = gym.make('FrozenLake-v0') env = gym.wrappers.Monitor(env, 'recording', force=True) env.seed(0) optimalValue = valueIteration(env) st = time.time() policy = cal_policy(optimalValue) policy

python OpenAI gym monitor creates json files in the recording directory

☆樱花仙子☆ 提交于 2021-01-02 07:55:38
问题 I am implementing value iteration on the gym CartPole-v0 environment and would like to record the video of the agent's actions in a video file. I have been trying to implement this using the Monitor wrapper but it generates json files instead of a video file in the recording directory. This is my code: env = gym.make('FrozenLake-v0') env = gym.wrappers.Monitor(env, 'recording', force=True) env.seed(0) optimalValue = valueIteration(env) st = time.time() policy = cal_policy(optimalValue) policy

Extracting state-space from Atari games at specific frames and hard coding agents?

随声附和 提交于 2020-12-26 04:03:28
问题 I am trying to extract the state space from Amidar in order to hard code an agent for some specific purposes. For example, I want the agent to go down whenever an enemy is 2 cells away or up until they hit a wall then go down again. However, I'm not quite sure how to extract the state space at a specific frame, or in general for that instance, and how to go about interpreting the output. I have tried env.observation_space but that just returns the frame size (i.e: Box(250,160,3) ). Anyone

Extracting state-space from Atari games at specific frames and hard coding agents?

半城伤御伤魂 提交于 2020-12-26 04:03:07
问题 I am trying to extract the state space from Amidar in order to hard code an agent for some specific purposes. For example, I want the agent to go down whenever an enemy is 2 cells away or up until they hit a wall then go down again. However, I'm not quite sure how to extract the state space at a specific frame, or in general for that instance, and how to go about interpreting the output. I have tried env.observation_space but that just returns the frame size (i.e: Box(250,160,3) ). Anyone

OpenAI Gym: Understanding `action_space` notation (spaces.Box)

微笑、不失礼 提交于 2020-12-01 08:18:23
问题 I want to setup an RL agent on the OpenAI CarRacing-v0 environment, but before that I want to understand the action space. In the code on github line 119 says: self.action_space = spaces.Box( np.array([-1,0,0]), np.array([+1,+1,+1])) # steer, gas, brake How do I read this line? Although my problem is concrete wrt CarRacing-v0 I would like to understand the spaces.Box() notation in general 回答1: Box means that you are dealing with real valued quantities. The first array np.array([-1,0,0] are

OpenAI Gym: Understanding `action_space` notation (spaces.Box)

核能气质少年 提交于 2020-12-01 08:17:28
问题 I want to setup an RL agent on the OpenAI CarRacing-v0 environment, but before that I want to understand the action space. In the code on github line 119 says: self.action_space = spaces.Box( np.array([-1,0,0]), np.array([+1,+1,+1])) # steer, gas, brake How do I read this line? Although my problem is concrete wrt CarRacing-v0 I would like to understand the spaces.Box() notation in general 回答1: Box means that you are dealing with real valued quantities. The first array np.array([-1,0,0] are