Skip to content

Commit

Permalink
change 2 dqn
Browse files Browse the repository at this point in the history
  • Loading branch information
chris-chris committed Nov 3, 2017
1 parent 90f5151 commit ef948f9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
7 changes: 3 additions & 4 deletions deepq_mineral_shards.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ def make_obs_ph(name):

player_relative = obs[0].observation["screen"][_PLAYER_RELATIVE]

screen = player_relative #+ path_memory
screen = (player_relative == _PLAYER_NEUTRAL).astype(int) #+ path_memory

player_y, player_x = (player_relative == _PLAYER_FRIENDLY).nonzero()
player = [int(player_x.mean()), int(player_y.mean())]
Expand Down Expand Up @@ -314,7 +314,7 @@ def make_obs_ph(name):
obs = env.step(actions=new_action)

player_relative = obs[0].observation["screen"][_PLAYER_RELATIVE]
new_screen = player_relative #+ path_memory
new_screen = (player_relative == _PLAYER_NEUTRAL).astype(int)

player_y, player_x = (player_relative == _PLAYER_FRIENDLY).nonzero()
player = [int(player_x.mean()), int(player_y.mean())]
Expand All @@ -335,8 +335,7 @@ def make_obs_ph(name):
if done:
obs = env.reset()
player_relative = obs[0].observation["screen"][_PLAYER_RELATIVE]

screen = player_relative #+ path_memory
screent = (player_relative == _PLAYER_NEUTRAL).astype(int)

player_y, player_x = (player_relative == _PLAYER_FRIENDLY).nonzero()
player = [int(player_x.mean()), int(player_y.mean())]
Expand Down
8 changes: 4 additions & 4 deletions train_mineral_shards.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,11 +119,11 @@ def main():
act = deepq_mineral_shards.learn(
env,
q_func=model,
num_actions=64,
lr=1e-3,
max_timesteps=20000000,
num_actions=32,
lr=FLAGS.lr,
max_timesteps=FLAGS.timesteps,
buffer_size=10000,
exploration_fraction=0.5,
exploration_fraction=FLAGS.exploration_fraction,
exploration_final_eps=0.01,
train_freq=4,
learning_starts=10000,
Expand Down

0 comments on commit ef948f9

Please sign in to comment.