-
Notifications
You must be signed in to change notification settings - Fork 36
/
Copy pathrun_gpu2_resume
executable file
·74 lines (69 loc) · 2.41 KB
/
run_gpu2_resume
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#!/bin/bash
if [ -z "$1" ]
then echo "Please provide the name of the game, e.g. ./run_gpu breakout "; exit 0
fi
ENV=$1
FRAMEWORK="alewrap"
game_path=$PWD"/roms/"
env_params="useRGB=true"
agent="NeuralQLearner"
# number of times to perform learning during each step
n_replay=1
netfile="\"convnet_atari3\""
# perform learning after every 4 steps
update_freq=4
# how many times to repeat chosen action
actrep=4
# future reward discount
discount=0.99
# random seed used to initialize torch
seed=1
# start learning after this steps
learn_start=512
# ?
pool_frms_type="\"max\""
pool_frms_size=2
# not used?
initial_priority="false"
# replay memory size
replay_memory=1000000
# exploration rate in the end
eps_end=0.1
# how many steps decay exploration rate
eps_endt=0
# learning rate
lr=0.00025
agent_type="DQN3_0_1"
preproc_net="\"net_downsample_2x_full_y\""
agent_name=$agent_type"_"$1"_FULL_Y_A"
agent_nameB=$agent_type"_"$1"_FULL_Y_B"
# state dimensionality 84x84
state_dim=7056
# number of color channels (greyscale)
ncols=1
agent_params="lr="$lr",ep=1,ep_end="$eps_end",ep_endt="$eps_endt",discount="$discount",hist_len=4,learn_start="$learn_start",replay_memory="$replay_memory",update_freq="$update_freq",n_replay="$n_replay",network="$netfile",preproc="$preproc_net",state_dim="$state_dim",minibatch_size=32,rescale_r=1,ncols="$ncols",bufferSize=512,valid_size=500,target_q=10000,clip_delta=1,min_reward=-1,max_reward=1"
# how many steps to train
steps=50000000
# testing frequency
eval_freq=125000
# how many steps to test
eval_steps=62500
# frequency of progress output
prog_freq=10000
# save frequency
save_freq=250000
# how often to save versions (will be used for calculating version numbers)
save_versions=$save_freq
# GPU-s to use, first and second player
gpu=0
gpuB=1
random_starts=30
pool_frms="type="$pool_frms_type",size="$pool_frms_size
num_threads=4
args="-framework $FRAMEWORK -game_path $game_path -name $agent_name -nameB $agent_nameB -env $ENV -env_params $env_params -agent $agent -agent_params $agent_params -steps $steps -eval_freq $eval_freq -eval_steps $eval_steps -prog_freq $prog_freq -save_freq $save_freq -save_versions $save_versions -actrep $actrep -gpu $gpu -gpuB $gpuB -random_starts $random_starts -pool_frms $pool_frms -seed $seed -threads $num_threads -verbose 0"
if [ -n "$2" ]; then
args="$args -network ${agent_name}_$2.t7 -networkB ${agent_nameB}_$2.t7"
fi
echo $args
cd dqn
../torch/bin/qlua train_2agent.lua $args