Skip to content

Commit

Permalink
fixes for cleanliness
Browse files Browse the repository at this point in the history
  • Loading branch information
tpbarron committed Jun 18, 2017
1 parent 4facbbc commit ca62ad4
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# pytorch-a3c

xvfb-run -s "-screen 0 1400x900x24" python main.py

This is a PyTorch implementation of Asynchronous Advantage Actor Critic (A3C) from ["Asynchronous Methods for Deep Reinforcement Learning"](https://arxiv.org/pdf/1602.01783v1.pdf).

This implementation is inspired by [Universe Starter Agent](https://github.com/openai/universe-starter-agent).
Expand Down
4 changes: 4 additions & 0 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@
env = create_car_racing_env()
model = ActorCritic(env.observation_space.shape[0], env.action_space)

itr = 0
while True:
if itr % 10 == 0:
print ("Itr: ", itr)
train(args, model, env)
test(args, model, env)
itr += 1
2 changes: 1 addition & 1 deletion test.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def test(args, model, env):
actions = deque(maxlen=100)
episode_length = 0
while True:
env.render()
#env.render()
episode_length += 1
# Sync with the shared model
if done:
Expand Down
2 changes: 1 addition & 1 deletion train.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def train(args, model, env, optimizer=None):
episode_length = 0
u = 0
while u < args.num_updates:
print ("update: ", u)
#print ("update: ", u)
episode_length += 1
# Sync with the shared model
# model.load_state_dict(shared_model.state_dict())
Expand Down

0 comments on commit ca62ad4

Please sign in to comment.