Skip to content

Commit

Permalink
hidden sweep
Browse files Browse the repository at this point in the history
  • Loading branch information
katetolstaya committed Jun 24, 2019
1 parent a20a4f8 commit ef62ebe
Show file tree
Hide file tree
Showing 3 changed files with 143 additions and 6 deletions.
131 changes: 131 additions & 0 deletions cfg/hidden_size.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
[DEFAULT]

alg = dagger

# learning parameters
batch_size = 20
buffer_size = 10000
updates_per_step = 200
seed = 11
actor_lr = 5e-5

n_train_episodes = 400
beta_coeff = 0.993
test_interval = 40
n_test_episodes = 20

# architecture parameters
k = 3
hidden_size = 32
gamma = 0.99
tau = 0.5

# env parameters
env = FlockingRelative-v0
v_max = 3.0
comm_radius = 1.0
n_agents = 100
n_actions = 2
n_states = 6
debug = False
dt = 0.01


header = n_layers, hidden_size, reward

[1, 4]
n_layers = 1
hidden_size = 4

[1, 8]
n_layers = 1
hidden_size = 8

[1, 16]
n_layers = 1
hidden_size = 16

[1, 32]
n_layers = 1
hidden_size = 32

[1, 64]
n_layers = 1
hidden_size = 64

[1, 128]
n_layers = 1
hidden_size = 128

[2, 4]
n_layers = 2
hidden_size = 4

[2, 8]
n_layers = 2
hidden_size = 8

[2, 16]
n_layers = 2
hidden_size = 16

[2, 32]
n_layers = 2
hidden_size = 32

[2, 64]
n_layers = 2
hidden_size = 64

[2, 128]
n_layers = 2
hidden_size = 128

[3, 4]
n_layers = 3
hidden_size = 4

[3, 8]
n_layers = 3
hidden_size = 8

[3, 16]
n_layers = 3
hidden_size = 16

[3, 32]
n_layers = 3
hidden_size = 32

[3, 64]
n_layers = 3
hidden_size = 64

[3, 128]
n_layers = 3
hidden_size = 128

[4, 4]
n_layers = 4
hidden_size = 4

[4, 8]
n_layers = 4
hidden_size = 8

[4, 16]
n_layers = 4
hidden_size = 16

[4, 32]
n_layers = 4
hidden_size = 32

[4, 64]
n_layers = 4
hidden_size = 64

[4, 128]
n_layers = 4
hidden_size = 128

15 changes: 10 additions & 5 deletions cfg/make_config.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
import itertools

baseline = False
baseline = True
param = 'vel'
param = 'dt'
# baseline = True
# param = 'vel'
# param = 'dt'
# param = 'n'
# param = 'rad'

params = {}
param = 'hidden_size'

params = {}
#
# params['seed'] = range(10)

if baseline:
Expand All @@ -19,8 +21,9 @@
else:
default_fname = 'default.cfg'
out_fname = param + '.cfg'
params['n_layers'] = [1, 2, 3, 4]

params['k'] = [1, 2, 3, 4]
# params['k'] = [1, 2, 3, 4]

if param == 'vel':
params['v_max'] = [0.5, 1.5, 2.5, 3.5, 4.5]
Expand All @@ -30,6 +33,8 @@
params['n_agents'] = [25, 50, 75, 100, 125, 150, 175, 200]
elif param == 'dt':
params['dt'] = [0.1, 0.075, 0.05, 0.025, 0.01, 0.0075]
elif param == 'hidden_size':
params['hidden_size'] = [4, 8, 16, 32, 64, 128]


out_file = open(out_fname, "w")
Expand Down
3 changes: 2 additions & 1 deletion learner/gnn_dagger.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ def __init__(self, device, args, k=None): # , n_s, n_a, k, device, hidden_size=
n_a = args.getint('n_actions')
k = k or args.getint('k')
hidden_size = args.getint('hidden_size')
n_layers = args.getint('n_layers') or 2
gamma = args.getfloat('gamma')
tau = args.getfloat('tau')

Expand All @@ -38,7 +39,7 @@ def __init__(self, device, args, k=None): # , n_s, n_a, k, device, hidden_size=
# Device
self.device = device

hidden_layers = [hidden_size, hidden_size]
hidden_layers = [hidden_size] * n_layers
ind_agg = 0 # int(len(hidden_layers) / 2) # aggregate halfway

# Define Networks
Expand Down

0 comments on commit ef62ebe

Please sign in to comment.